24小时热门版块排行榜    

查看: 2225  |  回复: 14

dengwei_19

木虫 (著名写手)

铁齿金不换诚实可靠小郎君

[求助] 现在做到高斯函数的误差函数一步,又是一个方程不知道用matlab怎么写

求w,求详解!谢谢!!!
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
回帖支持 ( 显示支持度最高的前 50 名 )

dbb627

荣誉版主 (著名写手)


dengwei_19: 回帖置顶 2012-04-13 15:38:54
引用回帖:
9楼: Originally posted by dengwei_19 at 2012-04-13 15:07:09:
>>  fun=@(x)-5.4*(pi^(1/2)*erf(10*2^0.5./x))/2-2.8*(pi^(1/2)*erf(40*2^0.5./x))/2+2.6;
x=0.1:0.1:100;
y=feval(fun,x);
plot(x,y)
=fsolve(fun,80)
这个能详解下过程吗?

fun=@(x)-5.4*(pi^(1/2)*erf(10*2^0.5./x))/2-2.8*(pi^(1/2)*erf(40*2^0.5./x))/2+2.6;
这个是将你的积分方程式转为误差函数,-(pi^(1/2)*erf(10*2^0.5./x))/2(pi^(1/2)*erf(40*2^0.5./x))/2,是你的两个积分
w(即x)的解使得fun=0
x=0.1:0.1:100;
y=feval(fun,x);
plot(x,y)
这个是w(即x)在0到100之间变化时fun的取值,用来在做图猜测w大概在什么位置,fun=0
[x,feval,flag]=fsolve(fun,80)是用来求精确数值解

x解即w
feval 取x的值 fun的函数值越接近0越好
flag 判断解的情况
1  FSOLVE converged to a root.
      2  Change in X too small.
      3  Change in residual norm too small.
      4  Computed search direction too small.
      0  Too many function evaluations or iterations.
     -1  Stopped by output/plot function.
     -2  Converged to a point that is not a root.
     -3  Trust region radius too small (Trust-region-dogleg) or
         Regularization parameter too large (Levenberg-Marquardt).
     -4  Line search failed.

» 本帖已获得的红花(最新10朵)

The more you learn, the more you know, the more you know, and the more you forget. The more you forget, the less you know. So why bother to learn.
11楼2012-04-13 15:23:53
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
普通回帖

onesupeng

金虫 (职业作家)

【答案】应助回帖

感谢参与,应助指数 +1
这个matlab有点悬吧?我觉得自己编程序算恐怕更好呢
长期招收博士生,参见http://fsl-unsw.com
2楼2012-04-13 13:47:46
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dengwei_19

木虫 (著名写手)

铁齿金不换诚实可靠小郎君

引用回帖:
2楼: Originally posted by onesupeng at 2012-04-13 13:47:46:
这个matlab有点悬吧?我觉得自己编程序算恐怕更好呢

不会吧。。。。。没办法求吗?
3楼2012-04-13 13:53:05
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dbb627

荣誉版主 (著名写手)

【答案】应助回帖

★ ★ ★ ★ ★ ★
感谢参与,应助指数 +1
dengwei_19: 金币+6, ★★★很有帮助 2012-04-13 14:36:22
dengwei_19: 回帖置顶 2012-04-13 15:40:01
>> syms x
>> syms w;int(exp(-x^2),0,w)

ans =

(pi^(1/2)*erf(w))/2

>> syms w;int(exp(-x^2),0,-w)

ans =

-(pi^(1/2)*erf(w))/2
===========
>> fun=@(x)-5.4*(pi^(1/2)*erf(10*2^0.5./x))/2-2.8*(pi^(1/2)*erf(40*2^0.5./x))/2+2.6;
>> x=0.1:0.1:100;
>> y=feval(fun,x);
>> plot(x,y)
>> [x,feval,flag]=fsolve(fun,80)

Equation solved.

fsolve completed because the vector of function values is near zero
as measured by the default value of the function tolerance, and
the problem appears regular as measured by the gradient.




x =

   81.4787


feval =

-9.0775e-010


flag =

     1

» 本帖已获得的红花(最新10朵)

The more you learn, the more you know, the more you know, and the more you forget. The more you forget, the less you know. So why bother to learn.
4楼2012-04-13 14:19:25
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dingd

铁杆木虫 (职业作家)

【答案】应助回帖

感谢参与,应助指数 +1
不知道你的公式是否正确,没有正确的实数解,如果右边是2.6,到有一个解:
w: -0.280599708910106
5楼2012-04-13 14:34:30
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dengwei_19

木虫 (著名写手)

铁齿金不换诚实可靠小郎君

引用回帖:
4楼: Originally posted by dbb627 at 2012-04-13 14:19:25:
>> syms x
>> syms w;int(exp(-x^2),0,w)

ans =

(pi^(1/2)*erf(w))/2

>> syms w;int(exp(-x^2),0,-w)

ans =

-(pi^(1/2)*erf(w))/2
===========
>> fun=@(x)-5.4* ...

x =

   81.4787

这个是解出来的w吗?
6楼2012-04-13 14:39:24
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dbb627

荣誉版主 (著名写手)

【答案】应助回帖

★ ★ ★ ★
dengwei_19: 金币+4, ★★★★★最佳答案 2012-04-13 14:49:55
dengwei_19: 回帖置顶 2012-04-13 15:17:11
引用回帖:
6楼: Originally posted by dengwei_19 at 2012-04-13 14:39:24:
x =

   81.4787

这个是解出来的w吗?

是的,这个就是matlab求出的数值解,做图也可以看出来在80附近。
The more you learn, the more you know, the more you know, and the more you forget. The more you forget, the less you know. So why bother to learn.
7楼2012-04-13 14:43:37
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dengwei_19

木虫 (著名写手)

铁齿金不换诚实可靠小郎君

引用回帖:
7楼: Originally posted by dbb627 at 2012-04-13 14:43:37:
是的,这个就是matlab求出的数值解,做图也可以看出来在80附近。

学到很多东西 这个程序我好好看看 有不懂的语句再请教!非常感谢!!!!
8楼2012-04-13 14:49:36
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dengwei_19

木虫 (著名写手)

铁齿金不换诚实可靠小郎君

引用回帖:
7楼: Originally posted by dbb627 at 2012-04-13 14:43:37:
是的,这个就是matlab求出的数值解,做图也可以看出来在80附近。

>>  fun=@(x)-5.4*(pi^(1/2)*erf(10*2^0.5./x))/2-2.8*(pi^(1/2)*erf(40*2^0.5./x))/2+2.6;
x=0.1:0.1:100;
y=feval(fun,x);
plot(x,y)
[x,feval,flag]=fsolve(fun,80)
这个能详解下过程吗?
9楼2012-04-13 15:07:09
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dengwei_19

木虫 (著名写手)

铁齿金不换诚实可靠小郎君

引用回帖:
7楼: Originally posted by dbb627 at 2012-04-13 14:43:37:
是的,这个就是matlab求出的数值解,做图也可以看出来在80附近。

fun=@(x)-5.4*(pi^(1/2)*erf(10*2^0.5./x))/2-2.8*(pi^(1/2)*erf(40*2^0.5./x))/2+2.6
把方程都移到一边等于函数
x=0.1:0.1:100;  从0.1到100 0.1的增长
y=feval(fun,x);
plot(x,y)
[x,feval,flag]=fsolve(fun,80)  看x为多少是函数为0 ?

基本是这样的思路?
10楼2012-04-13 15:18:58
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 dengwei_19 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 明天应该可查了!? +4 chengyan1220 2026-08-23 4/200 2026-08-24 08:47 by gloomy6159
[基金申请] 范进中举一文的中心思想 +5 炎黄贵胄 2026-08-22 6/300 2026-08-24 06:34 by sincosx
[基金申请] 2026国自然函评费到账 +16 羊腰板 2026-08-21 17/850 2026-08-23 23:02 by tianxiaochun
[基金申请] 让我中一个面上吧! +12 大萍1987 2026-08-20 15/750 2026-08-23 20:44 by 大萍1987
[基金申请] 2026年的国家社科基金项目通讯评审的新规则与新动向、新挑战 +4 process2012 2026-08-23 5/250 2026-08-23 19:58 by jurkat.1640
[教师之家] 跳槽后在研项目怎么办? +5 简单化xn 2026-08-22 10/500 2026-08-23 12:38 by 简单化xn
[基金申请] 93BebMhtakh前后11位开头都是大写 +7 且听虎啸 2026-08-17 8/400 2026-08-22 21:55 by 医学老男孩
[基金申请] 只有每年这种时候来逛逛小木虫 +24 yaoyewhu2008 2026-08-20 26/1300 2026-08-22 17:43 by kammury
[基金申请] filecode,4个jtjc了 +13 ziyangfang 2026-08-19 16/800 2026-08-22 17:08 by WH3796
[基金申请] 今天基金会出结果吗?20260819 +16 kkkl_v 2026-08-19 17/850 2026-08-22 16:12 by 阿布Abu
[基金申请] 时间戳今天,20号变了 +5 archvillain 2026-08-20 5/250 2026-08-22 06:12 by hui_daxiao
[基金申请] 放榜前的不淡定 40+4 snowwithsea 2026-08-19 14/700 2026-08-21 23:51 by cratir
[基金申请] 科研孤儿太难了 +17 我4大白菜 2026-08-20 18/900 2026-08-21 20:57 by zhangev
[基金申请] 时间戳又变了 +13 wuchongjun 2026-08-20 19/950 2026-08-21 17:21 by 紫杉醇
[基金申请] 感觉是下周放榜了 +7 angus9576 2026-08-17 12/600 2026-08-21 13:38 by weiyin
[基金申请] 我面上完蛋了 +7 且听虎啸 2026-08-20 8/400 2026-08-21 12:31 by 酷酷墨镜
[基金申请] 今天放榜没戏了吧 +9 yuleib84 2026-08-19 11/550 2026-08-21 10:06 by gltch
[基金申请] 基金啊基金 +4 longfie172 2026-08-20 4/200 2026-08-21 08:58 by mark mao
[基金申请] 时间戳变了,能看出什么问题? +18 基诺咪客 2026-08-17 23/1150 2026-08-20 17:19 by Godzela
[基金申请] 明天放榜? +5 Shxjjxjkx 2026-08-18 5/250 2026-08-18 18:14 by -大大大大大-
信息提示
请填处理意见