24小时热门版块排行榜    

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

zhs4276689

木虫 (正式写手)

[求助] 用matlab求解方程出问题,请帮忙看看

我求解一个方程,中间虽然解出来了,但还是有些问题,请帮忙看下
程序:
clc;
Ts=800; Cs=1134;ks=218;  Ps=2591;
Tm=933;
Cl=921;
z=0.65
as=ks/Cs/Ps

t=ks*(Tm-Ts)*exp(-z^2)/sqrt(as)/(1+erf(z))
f31=@(x)(t-(60.3+0.033*x)*(x-Tm)*exp(-z^2*as/(2.39e-5+1.9e-8*x))/sqrt(2.39e-5+1.9e-8*x)*erf(z*sqrt(as/(2.39e-5+1.9e-8*x))))
x=fsolve(f31,1100)
Ts
f(1)=t-(60.3+0.033*x)*(x-Tm)*exp(-z^2*as/(2.39e-5+1.9e-8*x))/sqrt(2.39e-5+1.9e-8*x)*erf(z*sqrt(as/(2.39e-5+1.9e-8*x)));
f

结果:

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 squared and the vector of function values
is near zero as measured by the default value of the function tolerance.




x =

  1.1734e+003


Ts =

   800


f =

-2.3283e-010

请问是什么问题?如何解决?谢谢!
回复此楼

» 猜你喜欢

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

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

dbb627

荣誉版主 (著名写手)

【答案】应助回帖

★ ★ ★ ★ ★
感谢参与,应助指数 +1
zhs4276689(金币+5): 谢谢,继续帮我解答哦,呵呵 2012-03-05 16:28:18
clc;
Ts=800; Cs=1134;ks=218;  Ps=2591;
Tm=933;
Cl=921;
z=0.65
as=ks/Cs/Ps
t=ks*(Tm-Ts)*exp(-z^2)/sqrt(as)/(1+erf(z))
f31=@(x)(t-(60.3+0.033*x)*(x-Tm)*exp(-z^2*as/(2.39e-5+1.9e-8*x))/sqrt(2.39e-5+1.9e-8*x)*erf(z*sqrt(as/(2.39e-5+1.9e-8*x))))
[x,feval,exflag]=fsolve(f31,10,optimset('TolFun',1e-8))

[x,feval,exflag]=fsolve(f31,10,optimset('TolFun',1e-8))

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 squared and the vector of function values
is near zero as measured by the selected value of the function tolerance.




x =

  1.1734e+003


feval =

-2.3283e-010


exflag =

     2
我觉得,没什么大的问题,计算的值 -2.3283e-010距离0已经足够接近了,你如果还不满足,那需要调节一些参数。
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.
2楼2012-03-05 15:38:56
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dbb627

荣誉版主 (著名写手)

【答案】应助回帖

★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★
zhs4276689(金币+15): 谢谢! 2012-03-05 17:46:47
中间出现提示可以关闭,在optimset中设置一下,这个看你初值给的怎么样,一般来说你要求的精度不是非常高的话,是可以接受的
clc;
Ts=800; Cs=1134;ks=218;  Ps=2591;
Tm=933;
Cl=921;
z=0.65
as=ks/Cs/Ps
t=ks*(Tm-Ts)*exp(-z^2)/sqrt(as)/(1+erf(z))
f31=@(x)(t-(60.3+0.033*x)*(x-Tm)*exp(-z^2*as/(2.39e-5+1.9e-8*x))/sqrt(2.39e-5+1.9e-8*x)*erf(z*sqrt(as/(2.39e-5+1.9e-8*x))))
[x,feval,exflag]=fsolve(f31,10,optimset( 'Display','off',TolFun',1e-8))
x =

  1.1734e+003


feval =

-2.3283e-010


exflag =

     2

fsolve的exflag =     2 表示  2  Change in X too small. 可以认为已经收敛了

  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.
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-03-05 17:11:12
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 zhs4276689 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[有机交流] 三颈瓶加热 5+4 wzjwx888 2024-06-20 5/250 2024-06-27 11:32 by f1yfish
[教师之家] 高校辞职,要求赔偿,这到底合不合理 +24 传动_海神 2024-06-23 36/1800 2024-06-27 11:26 by f1yfish
[有机交流] 脱酯基合成步骤 5+4 小辉灰@anhui 2024-06-25 8/400 2024-06-27 11:17 by 火龙骑士
[基金申请] 国基在研影响申请结果吗 +13 WOWO159357 2024-06-26 21/1050 2024-06-27 09:44 by WOWO159357
[育儿交流] 暑假孩子一个人在家可以干什么 +8 唠叨的映 2024-06-25 9/450 2024-06-27 09:28 by 晓目崇
[基金申请] 基金评审时,评审专家还回去看申请人代表作之外的文章吗? +10 孤单12站 2024-06-26 15/750 2024-06-27 08:41 by 孤单12站
[硕博家园] 博士该不该读? +8 L1009225316 2024-06-25 8/400 2024-06-26 16:26 by huixiong0627
[硕博家园] 【45岁以上博士】柔性人才引进项目,有补贴 +9 Dreamsummit 2024-06-24 18/900 2024-06-26 12:28 by hujm159
[有机交流] 大佬们,打的核磁氢谱与chemdraw预测的有偏差 +4 来了个 2024-06-26 4/200 2024-06-26 08:45 by czyzsu
[基金申请] 基金申请书名称有变化 +5 xuel2011 2024-06-25 7/350 2024-06-26 00:07 by 老虎当猫养
[考博] 申博好难 +6 自强不息a?a 2024-06-24 6/300 2024-06-25 23:02 by 考研吒儿
[基金申请] 这样的说辞是上会了吗 +12 学员d3zYCz 2024-06-24 15/750 2024-06-25 22:05 by 3115321
[基金申请] 博后面上到底什么时候出结果??? +7 爱学lsy 2024-06-24 7/350 2024-06-25 19:24 by 暴走的蒜泥
[基金申请] 2024安徽省哲社立项名单公示 +3 robin_work 2024-06-24 6/300 2024-06-25 14:37 by Pickfoot
[基金申请] 焦虑没有毛线用,默默前行是王道! +4 漠上藜梭 2024-06-24 8/400 2024-06-25 14:32 by 漠上藜梭
[教师之家] 有没有今年的影响因子? +6 jurkat.1640 2024-06-22 10/500 2024-06-24 22:48 by 潇湘之迷
[催化] 求助原位红外 +3 jfdhj 2024-06-21 7/350 2024-06-24 10:52 by qvhm2609
[基金申请] 国自然青年基金,1A4B能上会吗?青年和面上的上会标准是一样的吗? +19 今晚推荐22 2024-06-20 32/1600 2024-06-23 23:17 by andywei1028
[博后之家] 在国内某高校做全职博士后2年,现在找到新的单位,出站或退站对新工作有什么影响? +10 nxplfcc 2024-06-20 10/500 2024-06-22 07:52 by 徐长安
[论文投稿] ACS 编辑的意见 10+3 哈哈妞1993 2024-06-20 3/150 2024-06-21 17:06 by 投个论文
信息提示
请填处理意见