| 4 | 1/1 | 返回列表 |
| 查看: 1421 | 回復(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ā)表 | |
|---|---|---|---|---|
|
[考研] 297求調(diào)劑 +5 | 戲精丹丹丹 2026-03-17 | 5/250 |
|
|---|---|---|---|---|
|
[考研] 考研求調(diào)劑 +3 | 橘頌. 2026-03-17 | 4/200 |
|
|
[考研] 268求調(diào)劑 +7 | 好運(yùn)連綿不絕 2026-03-12 | 8/400 |
|
|
[考研] 328求調(diào)劑,英語六級551,有科研經(jīng)歷 +3 | 生物工程調(diào)劑 2026-03-16 | 8/400 |
|
|
[考研] 332求調(diào)劑 +6 | Zz版 2026-03-13 | 6/300 |
|
|
[考研] 26考研求調(diào)劑 +6 | 丶宏Sir 2026-03-13 | 6/300 |
|
|
[考研] 285化工學(xué)碩求調(diào)劑(081700) +9 | 柴郡貓_ 2026-03-12 | 9/450 |
|
|
[論文投稿] 有沒有大佬發(fā)小論文能帶我個二作 +3 | 增銳漏人 2026-03-17 | 4/200 |
|
|
[考研] [導(dǎo)師推薦]西南科技大學(xué)國防/材料導(dǎo)師推薦 +3 | 尖角小荷 2026-03-16 | 6/300 |
|
|
[考研] 0854控制工程 359求調(diào)劑 可跨專業(yè) +3 | 626776879 2026-03-14 | 9/450 |
|
|
[考研] 304求調(diào)劑 +3 | 曼殊2266 2026-03-14 | 3/150 |
|
|
[考研] 283求調(diào)劑 +10 | 小樓。 2026-03-12 | 14/700 |
|
|
[考研] 085600材料與化工 求調(diào)劑 +13 | enenenhui 2026-03-13 | 14/700 |
|
|
[考研] 一志愿華中師范071000,325求調(diào)劑 +6 | RuitingC 2026-03-12 | 6/300 |
|
|
[考研] 326求調(diào)劑 +3 | mlpqaz03 2026-03-15 | 3/150 |
|
|
[考研] 294求調(diào)劑 +3 | Zys010410@ 2026-03-13 | 4/200 |
|
|
[考研] 080500,材料學(xué)碩302分求調(diào)劑學(xué)校 +4 | 初識可樂 2026-03-14 | 5/250 |
|
|
[考研] 290求調(diào)劑 +3 | ADT 2026-03-13 | 3/150 |
|
|
[考博] 福州大學(xué)楊黃浩課題組招收2026年專業(yè)學(xué)位博士研究生,2026.03.20截止 +3 | Xiangyu_ou 2026-03-12 | 3/150 |
|
|
[考研] 081200-11408-276學(xué)碩求調(diào)劑 +3 | 崔wj 2026-03-12 | 4/200 |
|