24小时热门版块排行榜    

查看: 2529  |  回复: 1

qs001

新虫 (初入文坛)

[求助] fsolve计算结果问题

计算结果感觉误差好大,是由于初值取值造成的影响吗,还是要设置option来控制精度,第一次使用matlab一窍不通,请大家帮忙看下。
                                       First-Order                    Norm of
Iteration  Func-count    Residual       optimality      Lambda           step
     0           8         39.2026       1.13e+003         0.01
     1          16      0.00103045           0.705        0.001       0.294456
     2          24    3.55079e-005          0.0727       0.0001       0.237055
     3          32    7.28141e-006            0.19       1e-005       0.144512
     4          40    2.91808e-006          0.0123       1e-006      0.0248491
     5          48    2.90763e-006       3.58e-007       1e-007    0.000338087
     6          56    2.90763e-006       1.02e-009       1e-008   1.90914e-006

Equation solved, fsolve stalled.

fsolve stopped because the relative size of the current step is less than the
default value of the step size tolerance and the vector of function values
is near zero as measured by the selected value of the function tolerance.




y =

   -2.2413    2.2083   -0.1310    0.1318    1.0596    0.0211   -0.0272


fval =

    0.0000
    0.0008
   -0.0008
    0.0003
    0.0000
    0.0000
   -0.0011
    0.0006


下面是我要解的方程组
function F=myfun(x)
b=1;a=1;
F=[-0.0575*x(3)/a-x(7)*a*0.5-x(6);
x(3)/a^2+x(4)+17.39*x(7)*log(a)+0.8695652174*b*log(a);
-x(1)/(x(5)^2)-x(2)+x(3)/(x(5)^2)+x(4)-92.49880554*x(7)*log(x(5))+0.8695652174*b*log(x(5));
0.0065*x(1)/x(5)-0.0026*x(2)*x(5)-0.0575*x(3)/x(5)+x(7)*x(5)*((0.7-0.4*log(x(5)))/1.4-0.9347826087);
-2*x(1)/(x(5)^2)+109.8901099*x(7)-b;
2*x(1)/(1.5^2)-109.8901099*x(7)-b;
0.444444444444444*x(1)/a^2+x(2)+109.8901099*x(7)*log(1.5*a);
-x(1)*log(1.5*a/x(5))+0.5*(1.5^2*a^2-x(5)^2)*x(2)-x(3)*log(x(5)/a)+0.5*(x(5)^2-a^2)*x(4)+17.39130435*x(7)*(0.5*x(5)^2*(log(x(5))+0.5)-0.5*a^2*(log(a)+0.5))+109.8901099*x(7)*(0.5*1.5*1.5*a^2*(0.5+log(1.5*a))-0.5*x(5)^2*(log(x(5))+0.5))+0.0209742*1.5^2*a^2*b+0.8695652174*b*(0.5*x(5)^2*(log(x(5))+0.5)-0.5*a^2*(log(a)+0.5))];

选取的初值是x0=[-2,2,-0.5,0.5,1.05,0.01,-0.01]
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

nono2009

超级版主 (文学泰斗)

No gains, no pains.

优秀区长优秀区长优秀区长优秀区长优秀版主

【答案】应助回帖

★ ★ ★ ★ ★ ★
感谢参与,应助指数 +1
qs001: 金币+5, 有帮助 2013-01-08 20:44:22
xiegangmai: 金币+1, 谢谢建议 2013-01-08 21:06:39
建议楼主采用 format long(双精度)再试试
2楼2013-01-07 14:23:41
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 qs001 的主题更新
信息提示
请填处理意见