24小时热门版块排行榜    

北京石油化工学院2026年研究生招生接收调剂公告
查看: 2270  |  回复: 0

mataohk

银虫 (初入文坛)

[求助] Matlab:求高人指点用matlab求解非线性方程组,解出来的值不收敛,提前结束

fsolve解非线性方程组,只迭代了8次就退出了,得到的结果进行复算不等于0,存在较大的误差。(是不是需要修改算法?)
运行程序得到的结果提示如下:
x =

  1.0e+003 *

  Columns 1 through 4

   0.008229968721187   0.000000000008083   0.000006858621379   1.206234368839563

  Column 5

   0.000029820218392


fval =

  -0.003404951183545
   0.109922506812515
   0.055200484333056
   0.009207767273016
  -0.000813641543979


exitflag =

    -2


output =

       iterations: 8
        funcCount: 54
        algorithm: 'trust-region dogleg'
    firstorderopt: 3.163833174781097e+003
          message: [1x775 char]


ans =

No solution found.

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

Stopping criteria details:

fsolve stopped because the relative norm of the current step, 2.142692e-011, is less than
max(options.TolX^2,eps) = 2.500000e-011. However, the sum of squared function values,
r = 1.522709e-002, exceeds sqrt(options.TolFun) = 1.000000e-025.

Optimization Metric                                               Options
relative norm(step) =  2.14e-011                max(TolX^2,eps) =  3e-011 (selected)
r =  1.52e-002                                    sqrt(TolFun) = 1.0e-025 (selected)


程序代码如下:(其中调用了mafun函数,mafun函数中包括五个方程组,Iph,Io,Rs,Rp,Vt是要求的参数,已经赋初值,可以保证初值选择正确,因为所有解的范围是可以估计到的)
options = optimset('Display','iter','TolFun',1e-50,'TolX',0.5e-5);
[x,fval,exitflag,output] = fsolve(@mafun,x0,options)
output.message
format long, x,

如果我将程序中的optimset括号中的“0.5e-5”改为“0.5e-20”,则得到的结果为(好像说是变成奇异方程了):
No solution found.

fsolve stopped because the problem appears to be locally singular.

Stopping criteria details:

fsolve stopped because the trust-region radius, 1.248209e-016, is less than 2*eps.

Optimization Metric                                             Options
trust-region radius =  1.25e-016                              2*eps = 4.4e-016

上面的问题已经说的很详细了,希望高手能帮忙解决。谢谢了。 只有那么多Q币,全给了。

[ Last edited by mataohk on 2012-9-30 at 09:32 ]
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

智能机器人

Robot (super robot)

我们都爱小木虫

相关版块跳转 我要订阅楼主 mataohk 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 0703总分331求调剂 +13 ZY-05 2026-04-04 17/850 2026-04-07 14:36 by 猪会飞
[考研] 288求调剂 +11 没有答案_ 2026-04-05 11/550 2026-04-07 14:35 by qlm5820
[考研] 273求调剂 +31 麦小叮当 2026-04-06 36/1800 2026-04-07 12:25 by 1018329917
[考研] 0703化学 +22 妮妮ninicgb 2026-04-04 25/1250 2026-04-07 10:35 by plum
[考研] 一志愿武理车辆专硕总分 281 求调剂 +4 上岸研究生. 2026-04-02 4/200 2026-04-07 09:52 by 加油向未来啊
[考研] 283分求调剂 +11 试试看呗 2026-04-04 11/550 2026-04-07 09:52 by 猪会飞
[考研] 372求调剂 +4 jj涌77 2026-04-02 4/200 2026-04-07 09:31 by 白云朵朵飞
[考研] 334分控制工程求调剂 +4 姜尚真sadasd 2026-04-03 4/200 2026-04-07 09:26 by 蓝云思雨
[考研] 求调剂 +5 chenxrlkx 2026-04-05 7/350 2026-04-06 07:54 by houyaoxu
[考研] 材料化工306分找合适调剂 +14 沧海轻舟e 2026-04-04 14/700 2026-04-05 09:53 by 朱云虎202
[考研] 266分,一志愿电气工程,本科材料,求材料专业调剂 +11 哇呼哼呼哼 2026-04-01 12/600 2026-04-04 23:17 by 永字号
[考研] 324求调剂 +14 想上学求调 2026-04-02 15/750 2026-04-04 20:31 by 无际的草原
[考研] 265求调剂 +17 林深温澜 2026-04-01 20/1000 2026-04-04 01:09 by userper
[考研] 282求调剂 +20 ycy1201 2026-04-01 22/1100 2026-04-04 00:42 by userper
[考研] 335求调剂 +7 沈清璃 2026-04-03 7/350 2026-04-03 18:55 by lijunpoly
[考研] 266分,一志愿电气工程,本科材料,求材料专业调剂 +9 哇呼哼呼哼 2026-04-02 9/450 2026-04-03 12:05 by 1753564080
[基金申请] 请问共同通讯和共同一作的认可度问题 10+4 psa1234 2026-04-01 10/500 2026-04-03 11:08 by Kittylucky
[考研] 【求调剂】新能源材料本科,一志愿211,初试321 +6 求调剂学校, 2026-04-02 6/300 2026-04-02 09:41 by 晴空210210
[考研] 303分 0807学硕求调剂 +3 TYC3632 2026-04-01 3/150 2026-04-01 19:24 by lwk2004
[考研] 322求调剂 +8 三水sss 2026-04-01 8/400 2026-04-01 10:19 by 唐沐儿
信息提示
请填处理意见