| 5 | 1/1 | 返回列表 |
| 查看: 2231 | 回復: 15 | |||||
| 當前只顯示滿足指定條件的回帖,點擊這里查看本話題的所有回帖 | |||||
[求助]
各位朋友,如何用matlab編寫這個方程,并求解?
|
|||||
學習知識 |
榮譽版主 (著名寫手)
![]() |
專家經(jīng)驗: +4 |
|
或者這么寫也可以 function yan global s phi lam alpha s=3.2; phi=1; lam=3; alpha=0.6; [X,FVAL,EXITFLAG,OUTPUT]=fsolve(@sumt,10) function y=sumt(t) global s phi lam alpha y=0; % for N=0:floor(s*t-phi) % y=y+exp(-lam*t)*(lam*t)^N/gamma(N+1); % end N=0:floor(s*t-phi); yN=exp(-lam*t)*(lam*t).^N./gamma(N+1); y=sum(yN); y=y-alpha; |

榮譽版主 (著名寫手)
![]() |
專家經(jīng)驗: +4 |
|
Equation solved. fsolve completed because the vector of function values is near zero as measured by the default value of the function tolerance, and the problem appears regular as measured by the gradient. X = 10.0881 FVAL = -9.6716e-010 EXITFLAG = 1 OUTPUT = iterations: 2 funcCount: 6 algorithm: 'trust-region dogleg' firstorderopt: 2.0551e-010 message: [1x695 char] |

|
首先感謝您的回復,我剛試了下您的程序,好像對初始值的依賴性很強,沒次給不同的初始值求的結果都不一樣,而且結果幾乎和給的初始值差不多。我是想改變不同的alpha的值求出對應的t. 程序運行后的提示為: No solution found. fsolve stopped because the relative size of the current step is less than the default value of the step size tolerance squared, but the vector of function values is not near zero as measured by the default value of the function tolerance. fsolve stopped because the relative norm of the current step, 4.694166e-013, is less than max(options.TolX^2,eps) = 1.000000e-012. However, the sum of squared function values, r = 9.759502e-003, exceeds sqrt(options.TolFun) = 1.000000e-003. Optimization Metric Options relative norm(step) = 4.69e-013 max(TolX^2,eps) = 1e-012 (default) r = 9.76e-003 sqrt(TolFun) = 1.0e-003 (default) fsolve stopped because the relative norm of the current step, 4.694166e-013, is less than max(options.TolX^2,eps) = 1.000000e-012. However, the sum of squared function values, r = 9.759502e-003, exceeds sqrt(options.TolFun) = 1.000000e-003. Optimization Metric Options relative norm(step) = 4.69e-013 max(TolX^2,eps) = 1e-012 (default) r = 9.76e-003 sqrt(TolFun) = 1.0e-003 (default) |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 294分080500材料科學與工程求調劑 +11 | 柳溪邊 2026-03-26 | 12/600 |
|
|---|---|---|---|---|
|
[考研] 安徽大學專碩生物與醫(yī)藥專業(yè)(086000)324分,英語已過四六級,六級521,求調劑 +10 | 美味可樂雞翅 2026-03-26 | 11/550 |
|
|
[考研] 一志愿華東理工大學,080500學碩,317分,求調劑 +9 | s1145 2026-03-31 | 9/450 |
|
|
[考研] 江蘇蘇北高校誠邀調劑同學 +3 | zzll406 2026-03-31 | 3/150 |
|
|
[考研] 330分求調劑 +6 | qzenlc 2026-03-29 | 6/300 |
|
|
[考研]
|
nnnnnnn5 2026-03-25 | 12/600 |
|
|
[考研] 343求調劑 +8 | 愛羈絆 2026-03-28 | 8/400 |
|
|
[考研] 289求調劑 +3 | Acesczlo 2026-03-29 | 4/200 |
|
|
[考研] 270求調劑 +3 | 小杰pp 2026-03-31 | 4/200 |
|
|
[考研] 262求調劑 +7 | ZZ..000 2026-03-30 | 8/400 |
|
|
[考研] 一志愿中海洋320化學工程與技術學碩求調劑 +8 | 披星河 2026-03-30 | 8/400 |
|
|
[考研]
|
鐘llll 2026-03-26 | 5/250 |
|
|
[考研] 289求調劑 +16 | 新時代材料 2026-03-27 | 16/800 |
|
|
[考研] 一志愿雙一流機械285分求調劑 +4 | 幸運的三木 2026-03-29 | 5/250 |
|
|
[考研] 329求調劑 +10 | 鈕恩雪 2026-03-25 | 10/500 |
|
|
[考研] 283求調劑 +3 | A child 2026-03-28 | 3/150 |
|
|
[考研] 312,生物學求調劑 +3 | 小譯同學abc 2026-03-28 | 3/150 |
|
|
[考研] 一志愿上海理工能源動力(085800)310分求調劑 +3 | zhangmingc 2026-03-27 | 4/200 |
|
|
[考研] 298調劑 +3 | jiyingjie123 2026-03-27 | 3/150 |
|
|
[考研] 調劑推薦 +5 | 清酒714 2026-03-26 | 6/300 |
|