| 5 | 1/1 | 返回列表 |
| 查看: 1419 | 回復(fù): 3 | ||||
| 當(dāng)前只顯示滿足指定條件的回帖,點擊這里查看本話題的所有回帖 | ||||
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)驗: +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 我覺得,沒什么大的問題,計算的值 -2.3283e-010距離0已經(jīng)足夠接近了,你如果還不滿足,那需要調(diào)節(jié)一些參數(shù)。 |

榮譽(yù)版主 (著名寫手)
![]() |
專家經(jīng)驗: +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. |

| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 環(huán)境工程調(diào)劑 +7 | 大可digkids 2026-03-16 | 7/350 |
|
|---|---|---|---|---|
|
[考研] 278求調(diào)劑 +5 | 煙火先于春 2026-03-17 | 5/250 |
|
|
[考研] 332求調(diào)劑 +6 | Zz版 2026-03-13 | 6/300 |
|
|
[考研] 一志愿蘇州大學(xué)材料工程(085601)專碩有科研經(jīng)歷三項國獎兩個實用型專利一項省級立項 +6 | 大火山小火山 2026-03-16 | 8/400 |
|
|
[考研] 考研調(diào)劑 +3 | 淇ya_~ 2026-03-17 | 5/250 |
|
|
[考研] 278求調(diào)劑 +3 | Yy7400 2026-03-13 | 3/150 |
|
|
[考研] [導(dǎo)師推薦]西南科技大學(xué)國防/材料導(dǎo)師推薦 +3 | 尖角小荷 2026-03-16 | 6/300 |
|
|
[考研] 326求調(diào)劑 +4 | 諾貝爾化學(xué)獎覬?/a> 2026-03-15 | 7/350 |
|
|
[考研] 321求調(diào)劑 +5 | 大米飯! 2026-03-15 | 5/250 |
|
|
[考研] 0703化學(xué)調(diào)劑 290分有科研經(jīng)歷,論文在投 +7 | 膩膩gk 2026-03-14 | 7/350 |
|
|
[考研] 326求調(diào)劑 +3 | mlpqaz03 2026-03-15 | 3/150 |
|
|
[考研] 材料與化工 323 英一+數(shù)二+物化,一志愿:哈工大 本人本科雙一流 +4 | 自由的_飛翔 2026-03-13 | 5/250 |
|
|
[考研] 中科大材料專碩319求調(diào)劑 +3 | 孟鑫材料 2026-03-13 | 3/150 |
|
|
[考研] 材料與化工求調(diào)劑一志愿 985 總分 295 +8 | dream…… 2026-03-12 | 8/400 |
|
|
[考研] 求材料調(diào)劑 +5 | 隔壁陳先生 2026-03-12 | 5/250 |
|
|
[考研] 281求調(diào)劑 +9 | Koxui 2026-03-12 | 11/550 |
|
|
[考研] 求調(diào)劑 +5 | 一定有學(xué)上- 2026-03-12 | 5/250 |
|
|
[考研] 295求調(diào)劑 +3 | 小匕仔汁 2026-03-12 | 3/150 |
|
|
[考研] 085600材料與化工 309分請求調(diào)劑 +7 | dtdxzxx 2026-03-12 | 8/400 |
|
|
[考研] 0817化學(xué)工程與技術(shù)考研312分調(diào)劑 +3 | T123 tt 2026-03-12 | 3/150 |
|