| 5 | 1/1 | 返回列表 |
| 查看: 1420 | 回復(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 請問是什么問題?如何解決?謝謝! |
榮譽版主 (著名寫手)
![]() |
專家經(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. 可以認為已經(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. |

榮譽版主 (著名寫手)
![]() |
專家經(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ù)。 |

木蟲 (正式寫手)
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 341求調(diào)劑 +5 | 搗蛋豬豬 2026-03-11 | 7/350 |
|
|---|---|---|---|---|
|
[考研] 301求調(diào)劑 +4 | A_JiXing 2026-03-16 | 4/200 |
|
|
[考研] 【0856】化學(xué)工程(085602)313 分,本科學(xué)科評估A類院校化學(xué)工程與工藝,誠求調(diào)劑 +7 | 小劉快快上岸 2026-03-11 | 8/400 |
|
|
[考研] 26考研求調(diào)劑 +6 | 丶宏Sir 2026-03-13 | 6/300 |
|
|
[考研] 東南大學(xué)364求調(diào)劑 +5 | JasonYuiui 2026-03-15 | 5/250 |
|
|
[考研] 0854控制工程 359求調(diào)劑 可跨專業(yè) +3 | 626776879 2026-03-14 | 9/450 |
|
|
[考研] 化學(xué)調(diào)劑0703 +8 | 啊我我的 2026-03-11 | 8/400 |
|
|
[考研] 一志愿華中師范071000,325求調(diào)劑 +6 | RuitingC 2026-03-12 | 6/300 |
|
|
[考研] 326求調(diào)劑 +3 | mlpqaz03 2026-03-15 | 3/150 |
|
|
[考研]
|
笨笨兔子 2026-03-12 | 3/150 |
|
|
[考研] 22408總分284求調(diào)劑 +3 | InAspic 2026-03-13 | 3/150 |
|
|
[考研] 一志愿西南交大,材料專碩317求調(diào)劑 +5 | lx8568 2026-03-11 | 5/250 |
|
|
[考研] 329求調(diào)劑 +3 | miaodesi 2026-03-12 | 4/200 |
|
|
[考研] 求調(diào)劑 +5 | 一定有學(xué)上- 2026-03-12 | 5/250 |
|
|
[考研] 314求調(diào)劑 +7 | 無懈可擊的巨人 2026-03-12 | 7/350 |
|
|
[考研] 274求調(diào)劑 +3 | S.H1 2026-03-12 | 3/150 |
|
|
[論文投稿]
投稿問題
5+4
|
星光燦爛xt 2026-03-12 | 6/300 |
|
|
[考研] 0856化學(xué)工程280分求調(diào)劑 +4 | shenzxsn 2026-03-11 | 4/200 |
|
|
[考研] 270求調(diào)劑 085600材料與化工專碩 +3 | YXCT 2026-03-11 | 3/150 |
|
|
[考博] 26讀博 +4 | Rui135246 2026-03-12 | 10/500 |
|