| 4 | 1/1 | 返回列表 |
| 查看: 1417 | 回復(fù): 3 | ||||
zhs4276689木蟲 (正式寫手)
|
[求助]
用matlab求解方程出問題,請(qǐng)幫忙看看
|
|
我求解一個(gè)方程,中間雖然解出來了,但還是有些問題,請(qǐng)幫忙看下 程序: 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 請(qǐng)問是什么問題?如何解決?謝謝! |
榮譽(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è)置一下,這個(gè)看你初值給的怎么樣,一般來說你要求的精度不是非常高的話,是可以接受的 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ā)表 | |
|---|---|---|---|---|
|
[考研] 268求調(diào)劑 +3 | 簡(jiǎn)單點(diǎn)0 2026-03-17 | 3/150 |
|
|---|---|---|---|---|
|
[考研] 070300化學(xué)319求調(diào)劑 +4 | 錦鯉0909 2026-03-17 | 4/200 |
|
|
[考研] 211本,11408一志愿中科院277分,曾在中科院自動(dòng)化所實(shí)習(xí) +6 | Losir 2026-03-12 | 7/350 |
|
|
[碩博家園] 深圳大學(xué)碩士招生(2026秋,傳感器方向,僅錄取第一志愿) +4 | xujiaoszu 2026-03-11 | 9/450 |
|
|
[考研] 考研調(diào)劑 +3 | 淇ya_~ 2026-03-17 | 5/250 |
|
|
[考研] 278求調(diào)劑 +3 | Yy7400 2026-03-13 | 3/150 |
|
|
[考研] [導(dǎo)師推薦]西南科技大學(xué)國(guó)防/材料導(dǎo)師推薦 +3 | 尖角小荷 2026-03-16 | 6/300 |
|
|
[考研] 東南大學(xué)364求調(diào)劑 +5 | JasonYuiui 2026-03-15 | 5/250 |
|
|
[考研] 304求調(diào)劑 +3 | 曼殊2266 2026-03-14 | 3/150 |
|
|
[考研] 321求調(diào)劑 +5 | 大米飯! 2026-03-15 | 5/250 |
|
|
[考研] 327求調(diào)劑 +6 | 拾光任染 2026-03-15 | 11/550 |
|
|
[考研] 085601材料工程315分求調(diào)劑 +3 | yang_0104 2026-03-15 | 3/150 |
|
|
[基金申請(qǐng)] 現(xiàn)在如何回避去年的某一個(gè)專家,不知道名字 +3 | zk200107 2026-03-12 | 6/300 |
|
|
[考研] 255求調(diào)劑 +3 | 李嘉慧, 2026-03-12 | 4/200 |
|
|
[考研] 304求調(diào)劑 +7 | 7712b 2026-03-13 | 7/350 |
|
|
[考研] 四川大學(xué)085601材料工程專碩 初試294求調(diào)劑 +4 | 祝我們好在冬天 2026-03-11 | 4/200 |
|
|
[考研] 26調(diào)劑/材料科學(xué)與工程/總分295/求收留 +9 | 2026調(diào)劑俠 2026-03-12 | 9/450 |
|
|
[考研] 求調(diào)劑 +7 | 18880831720 2026-03-11 | 7/350 |
|
|
[考研] 295求調(diào)劑 +3 | 小匕仔汁 2026-03-12 | 3/150 |
|
|
[考研] 277求調(diào)劑 +4 | anchor17 2026-03-12 | 4/200 |
|