| 4 | 1/1 | 返回列表 |
| 查看: 1422 | 回復(fù): 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 結(jié)果: 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 請問是什么問題?如何解決?謝謝! |
榮譽(yù)版主 (著名寫手)
![]() |
專家經(jīng)驗(yàn): +4 |
|
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 我覺得,沒什么大的問題,計(jì)算的值 -2.3283e-010距離0已經(jīng)足夠接近了,你如果還不滿足,那需要調(diào)節(jié)一些參數(shù)。 |

木蟲 (正式寫手)
榮譽(yù)版主 (著名寫手)
![]() |
專家經(jīng)驗(yàn): +4 |
|
中間出現(xiàn)提示可以關(guān)閉,在optimset中設(shè)置一下,這個看你初值給的怎么樣,一般來說你要求的精度不是非常高的話,是可以接受的 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. 可以認(rèn)為已經(jīng)收斂了 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. |

| 4 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 286求調(diào)劑 +3 | lemonzzn 2026-03-16 | 6/300 |
|
|---|---|---|---|---|
|
[考研]
|
胡辣湯放糖 2026-03-15 | 6/300 |
|
|
[考研] 280求調(diào)劑 +6 | 咕嚕曉曉 2026-03-18 | 7/350 |
|
|
[考研] 302求調(diào)劑 +9 | 負(fù)心者當(dāng)誅 2026-03-11 | 9/450 |
|
|
[考研] 本人考085602 化學(xué)工程 專碩 +16 | 不知道叫什么! 2026-03-15 | 18/900 |
|
|
[考研] 332求調(diào)劑 +6 | Zz版 2026-03-13 | 6/300 |
|
|
[考研] 290求調(diào)劑 +6 | 孔志浩 2026-03-12 | 11/550 |
|
|
[考研] 211本,11408一志愿中科院277分,曾在中科院自動化所實(shí)習(xí) +6 | Losir 2026-03-12 | 7/350 |
|
|
[考研] 考研調(diào)劑 +3 | 淇ya_~ 2026-03-17 | 5/250 |
|
|
[考研] 333求調(diào)劑 +3 | 文思客 2026-03-16 | 7/350 |
|
|
[考研] 311求調(diào)劑 +5 | 26研0 2026-03-15 | 5/250 |
|
|
[考研] 0703 物理化學(xué)調(diào)劑 +3 | 我可以上岸的對?/a> 2026-03-13 | 5/250 |
|
|
[考研] 材料與化工 323 英一+數(shù)二+物化,一志愿:哈工大 本人本科雙一流 +4 | 自由的_飛翔 2026-03-13 | 5/250 |
|
|
[考研] 復(fù)試調(diào)劑 +4 | z1z2z3879 2026-03-14 | 5/250 |
|
|
[考研] 266求調(diào)劑 +4 | 學(xué)員97LZgn 2026-03-13 | 4/200 |
|
|
[考研] 0703化學(xué)求調(diào)劑 +7 | 綠豆芹菜湯 2026-03-12 | 7/350 |
|
|
[考研] 274求調(diào)劑 +3 | S.H1 2026-03-12 | 3/150 |
|
|
[考研] 求調(diào)劑 +3 | 程雨杭 2026-03-12 | 3/150 |
|
|
[考研] 土木第一志愿276求調(diào)劑,科研和技能十分豐富,求新興方向的導(dǎo)師收留 +3 | 土木小天才 2026-03-12 | 3/150 |
|
|
[考研] 一志愿山大07化學(xué) 332分 四六級已過 本科山東雙非 求調(diào)劑! +3 | 不想理你 2026-03-12 | 3/150 |
|