24小时热门版块排行榜    

查看: 1884  |  回复: 14
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

dengwei_19

木虫 (著名写手)

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

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

求w,求详解!谢谢!!!
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

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的回帖
查看全部 15 个回答

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的回帖
信息提示
请填处理意见