| 查看: 2216 | 回復(fù): 15 | ||||
yan_fei銀蟲 (小有名氣)
|
[求助]
各位朋友,如何用matlab編寫這個(gè)方程,并求解?
|
|
各位朋友,最近遇到這么一個(gè)方程,不知道如何用matlab解決,方程如下: 公式中的未知數(shù)是t,其他的都是已知的。怎么用matlab編寫這個(gè)方程,并求解?請(qǐng)各位朋友幫忙,謝謝! 方程 |
學(xué)習(xí)知識(shí) |
銀蟲 (小有名氣)
榮譽(yù)版主 (著名寫手)
![]() |
專家經(jīng)驗(yàn): +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] |

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

銀蟲 (小有名氣)
|
首先感謝您的回復(fù),我剛試了下您的程序,好像對(duì)初始值的依賴性很強(qiáng),沒次給不同的初始值求的結(jié)果都不一樣,而且結(jié)果幾乎和給的初始值差不多。我是想改變不同的alpha的值求出對(duì)應(yīng)的t. 程序運(yùn)行后的提示為: 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) |
榮譽(yù)版主 (著名寫手)
![]() |
專家經(jīng)驗(yàn): +4 |

銀蟲 (小有名氣)
榮譽(yù)版主 (著名寫手)
![]() |
專家經(jīng)驗(yàn): +4 |

銀蟲 (小有名氣)
榮譽(yù)版主 (著名寫手)
![]() |
專家經(jīng)驗(yàn): +4 |
|
這個(gè)確實(shí)要估計(jì)下t,可以做圖估計(jì) function yan global s phi lam alpha s=0.5; phi=9; lam=0.1389; A=[0,0.07,0.21,0.38,0.54,0.68,0.78,0.86 0.91,0.94,0.97]; for i=1:11 alpha=A(i) ; [X(i),FVAL(i),EXITFLAG,OUTPUT]=fsolve(@sumt,16+i*1.9); end X FVAL t=0.1:0.1:50; for i=1:length(t) ya(i)=sumt(t(i))+alpha; end plot(t,ya,'-') hold on;plot(X,A,'ro') 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=poisspdf(N,lam*t); y=sum(yN)-alpha; %y=y-alpha; |

| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 北科281學(xué)碩材料求調(diào)劑 +8 | tcxiaoxx 2026-03-20 | 10/500 |
|
|---|---|---|---|---|
|
[考研] 考研調(diào)劑 +4 | 呼呼?~+123456 2026-03-24 | 4/200 |
|
|
[考研] 307求調(diào)劑 +3 | 余意卿 2026-03-21 | 6/300 |
|
|
[考研] 求調(diào)劑一志愿武漢理工大學(xué)材料工程(085601) +5 | WW.' 2026-03-23 | 7/350 |
|
|
[考研] 【雙一流院校新能源、環(huán)境材料,材料加工與模擬招收大量調(diào)劑】 +4 | Higraduate 2026-03-22 | 7/350 |
|
|
[考博] 26申博自薦 +3 | whh869393 2026-03-24 | 3/150 |
|
|
[基金申請(qǐng)] 請(qǐng)教下大家 2026年國家基金申請(qǐng)是雙盲審嗎? +3 | lishucheng1 2026-03-22 | 5/250 |
|
|
[考研] 一志愿國科過程所081700,274求調(diào)劑 +3 | 三水研0水立方 2026-03-23 | 3/150 |
|
|
[考研] 生物學(xué)一志愿985,分?jǐn)?shù)349求調(diào)劑 +6 | zxts12 2026-03-21 | 9/450 |
|
|
[考研] 一志愿南京理工大學(xué)085701資源與環(huán)境302分求調(diào)劑 +5 | 葵梓衛(wèi)隊(duì) 2026-03-18 | 7/350 |
|
|
[考研] 接收2026碩士調(diào)劑(學(xué)碩+專碩) +4 | allen-yin 2026-03-23 | 6/300 |
|
|
[考研] 298求調(diào)劑 +8 | 上岸6666@ 2026-03-20 | 8/400 |
|
|
[考研] 275求調(diào)劑 +6 | shansx 2026-03-22 | 8/400 |
|
|
[考研] 求調(diào)劑院校信息 +6 | CX 330 2026-03-21 | 6/300 |
|
|
[考研] 求調(diào)劑 +3 | .m.. 2026-03-21 | 4/200 |
|
|
[考研] 279求調(diào)劑 +5 | 紅衣隱官 2026-03-21 | 5/250 |
|
|
[考研] 085601調(diào)劑 358分 +3 | zzzzggh 2026-03-20 | 4/200 |
|
|
[考研] 317求調(diào)劑 +5 | 申子申申 2026-03-19 | 9/450 |
|
|
[考研]
|
然11 2026-03-19 | 4/200 |
|
|
[考研] 招收調(diào)劑碩士 +4 | lidianxing 2026-03-19 | 12/600 |
|