24小时热门版块排行榜    

查看: 2264  |  回复: 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 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 一志愿天津大学化学工艺专业(081702)315分求调剂 +7 yangfz 2026-03-17 7/350 2026-03-17 23:57 by 星空星月
[考研] 能源材料化学课题组招收硕士研究生8-10名 +3 脱颖而出 2026-03-16 6/300 2026-03-17 21:19 by z1z2z3879
[考研] 070300化学319求调剂 +4 锦鲤0909 2026-03-17 4/200 2026-03-17 18:21 by 重科小霸王
[考研] 材料工程专硕调剂 +5 204818@lcx 2026-03-17 5/250 2026-03-17 17:27 by Little-xue
[硕博家园] 深圳大学硕士招生(2026秋,传感器方向,仅录取第一志愿) +4 xujiaoszu 2026-03-11 9/450 2026-03-17 10:29 by xujiaoszu
[考研] 材料与化工304求B区调剂 +7 邱gl 2026-03-11 8/400 2026-03-17 09:36 by 努力学习赚彩礼
[考研] 11408 一志愿西电,277分求调剂 +3 zhouzhen654 2026-03-16 3/150 2026-03-17 07:03 by laoshidan
[考博] 东华理工大学化材专业26届硕士博士申请 +6 zlingli 2026-03-13 6/300 2026-03-15 20:00 by ryzcf
[考研] 0856专硕279求调剂 +5 加油加油!? 2026-03-15 5/250 2026-03-15 11:58 by 2020015
[考研] 复试调剂 +3 呼呼?~+123456 2026-03-14 3/150 2026-03-14 16:53 by WTUChen
[考研] 一志愿哈工大材料324分求调剂 +5 闫旭东 2026-03-14 5/250 2026-03-14 14:53 by 木瓜膏
[考研] 一志愿中科院,化学方向,295求调剂 +4 一氧二氮 2026-03-11 4/200 2026-03-13 22:35 by JourneyLucky
[考研] 329求调剂 +3 miaodesi 2026-03-12 4/200 2026-03-13 20:53 by 18595523086
[考研] 281求调剂 +9 Koxui 2026-03-12 11/550 2026-03-13 20:50 by Koxui
[考研] 材料专硕350 求调剂 +4 王金科 2026-03-12 4/200 2026-03-13 16:02 by ruiyingmiao
[考研] 工科278分求调剂 +5 周慢热啊 2026-03-12 7/350 2026-03-13 15:49 by JourneyLucky
[考研] 土木第一志愿276求调剂,科研和技能十分丰富,求新兴方向的导师收留 +3 土木小天才 2026-03-12 3/150 2026-03-13 15:01 by JourneyLucky
[考研] 328化工专硕求调剂 +4 。,。,。,。i 2026-03-12 4/200 2026-03-13 14:44 by JourneyLucky
[考研] 材料301分求调剂 +5 Liyouyumairs 2026-03-12 5/250 2026-03-13 14:42 by JourneyLucky
[考研] 一志愿山大07化学 332分 四六级已过 本科山东双非 求调剂! +3 不想理你 2026-03-12 3/150 2026-03-13 14:18 by JourneyLucky
信息提示
请填处理意见