| 查看: 1509 | 回復(fù): 13 | ||||
vs570588木蟲(chóng) (正式寫手)
|
[求助]
求高手,擬合求參數(shù)
|
|
function M=Monod(c,Y) M= -c(1).*Y./(Y+c(2)) Y=[255.55 246.44 237.28 228.36 136.08 114 99.16 82.33 69.4 56.94 42.31 0]; x=[-0.78 -2.2268 -5.2033 -6.1377 -8.6137 -8.6428 -8.4792 -8.1692 -7.7128 -7.11 -6.3608 -1.9]; x=x/214.63; c0=[0.03 0.3];beta=nlinfit(Y,x ,’Monod’,c0); 為了參數(shù)c(1),c(2),這個(gè)小程序快把我折磨死了,F(xiàn)在出來(lái)NLINFIT did NOT converge. Returning results from last iteration. beta = 0.0271 -8.1892 按道理,-8.1892不合理。出來(lái)的參數(shù)應(yīng)該和我預(yù)估的差不多。大家看看,這是怎樣回事? |
木蟲(chóng) (正式寫手)
之乎者也

木蟲(chóng) (正式寫手)
|
謝謝你回復(fù),這是我的問(wèn)題,你看看,有啥辦法能解決?ds/dt = -q*S*X/(k+S)這里未知參數(shù)是q和K, q是比最大降解速率,K是半飽和常數(shù),X是污泥濃度214.63,這個(gè)值是定值。S是污染物的濃度, t肯定就是時(shí)間了。我具體試驗(yàn)是隔一段時(shí)間,取一個(gè)樣品測(cè)出S,所以我最原始數(shù)據(jù)是 t=[0 2 7 9 19 22 24 26 28 30 32 40]; S=[255.55 246.44 237.28 228.36 136.08 114 99.16 82.33 69.4 56.94 42.31 0]; 就那這一組數(shù)據(jù)來(lái)擬合出上面微分方程里中的未知參數(shù)。你看能用啥好辦法?另外,我也看宋新山《matlab在環(huán)境科學(xué)中的應(yīng)用》,上面也用個(gè)例子,但是有個(gè)例子直接給出了一系列ds/dt的值,并且這些值呈遞增。但你也知道,實(shí)際試驗(yàn)不會(huì)出現(xiàn)這種理想情況。所以我求ds/dt值是用多項(xiàng)式擬合,求各個(gè)點(diǎn)的導(dǎo)數(shù),肯定這樣誤差大。但我實(shí)在想不出好辦法。也有人說(shuō)用有限差分法,求出數(shù)值解,再代入,求最優(yōu)化參數(shù)。 |
木蟲(chóng) (正式寫手)
之乎者也

木蟲(chóng) (正式寫手)
|
你好,我用你給介紹的,參考別人寫的程序,用數(shù)值解求參數(shù),程序?qū)懙暮芊爆崳隳軒臀腋母膯?另外,現(xiàn)在運(yùn)行不下去,提示說(shuō)divided by zero.你能給看看,怎樣把數(shù)據(jù)處理就能好些? S=dsolve(‘Dy=-k1*y*214.63/(y+k2)’,’y(0)= 255.55’) simplify(S) %微分方程積分,求出來(lái)式子相當(dāng)繁瑣 function monodfit2 clear all; t= [0 2 7 9 19 22 24 26 28 30 32 40]’; c=[255.55 246.44 237.28 228.36 136.08 114 99.16 82.33 69.4 56.94 42.31 0]’; [y_row,y_col]=size(c); beta0=[0.03,0.3]; c0=255.55; lb=[0 0];ub=[inf inf]; [beta,resnorm,residual,exitflag,output,lambda,jacobian] = ... lsqnonlin(@seqfun,beta0,lb,ub,[],t,c,y_col,c0); ci = nlparci(beta,residual,jacobian); function y = seqfun(beta,t,c,y_col,c0) % Objective function tspan = [0 max(t)]; [tt yy] = ode45(@modeleqs,tspan,c0,[],beta); for col = 1:y_col yc(:,col) = spline(tt,yy(:,col),t); end y=[c(:,1)-yc(:,1)]; function dydt = modeleqs(t,y,beta) % Model equation dydt=beta(2)*lambertw(1/beta(2)*exp(-1/100*(21463*t*beta(1)-25555-100*beta(2)*log(19)-100* beta(2)*log(269)+200* beta(2)*log(2)+100* beta(2)*log(5))/ beta(2))); |
榮譽(yù)版主 (著名寫手)
![]() |
專家經(jīng)驗(yàn): +4 |
|
t= [0 2 7 9 19 22 24 26 28 30 32 40]'; c=[255.55 246.44 237.28 228.36 136.08 114 99.16 82.33 69.4 56.94 42.31 0]'; ft_ = fittype('k/(-1+exp(a*t)*C)',... 'dependent',{'c'},'independent',{'t'},... 'coefficients',{'k', 'a', 'C'}); st=[200 1.5 0.1] [curve, goodness]= fit(t,c,ft_,'Startpoint',st) figure plot(curve,'predobs',0.95); hold on,plot(t,c,'b*') st = 200.0000 1.5000 0.1000 curve = General model: curve(t) = k/(-1+exp(a*t)*C) Coefficients (with 95% confidence bounds): k = -269.7 (-288.2, -251.2) a = 0.1438 (0.1191, 0.1685) C = -0.05613 (-0.09544, -0.01682) goodness = sse: 394.4838 rsquare: 0.9955 dfe: 9 adjrsquare: 0.9945 rmse: 6.6205 |

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

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

木蟲(chóng) (正式寫手)
|
你好,謝謝你了。你用maple做出的解析解。我matlab是個(gè)菜鳥(niǎo),怎樣用matlab實(shí)現(xiàn),我不會(huì)。你能幫我看看嗎?另外,這里還有幾篇英文文獻(xiàn),處理類似的問(wèn)題。 第一篇: Non-linear least-square error minimization was used to estimate best-fit values for the kinetic parameters (Sa´ez and Rittmann, 1992). In this technique, the modeling equations are solved numerically, and parameters are selected to minimize the sum of the relative least-square residuals. The equations were solved by finite differences in a Microsoft Excel spreadsheet. 第二篇: 2.7.5. Data fitting AQUASIM version 2.1f (Reichert, 1995) was used to fit kinetic parameters. AQUASIM estimates kinetic parameters by minimizing the sum of the squares of the weighted deviations between actual data and results of the calculated model. The calculation step size was 0.01 days. The secant method was used with a maximum iteration number of 100. 第三篇: The fitting method adopted is detailed as follows. Eqs. (1) and(8) were solved numerically by the finite-difference method with a finite-difference of dt= 0.00625 h and with an initial guess of qmax and Ks. The optimal qmax and Ks were then obtained by changing their values in Microsoft Excel Solver to reach the minimum SSE between the model-calculated and observed data. 我希望我出來(lái)的擬合圖形不應(yīng)該是折線圖,而是如附件所示。我的數(shù)據(jù)和第三篇中的數(shù)據(jù)很像,也是一式三組試驗(yàn),其中一組和另外兩組數(shù)據(jù)有區(qū)別。第三篇擬合求參方法如上所示。 最后,還是要謝謝你。 |
木蟲(chóng) (正式寫手)
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 290求調(diào)劑 +4 | ^O^乜 2026-03-19 | 4/200 |
|
|---|---|---|---|---|
|
[考研]
|
簡(jiǎn)木ChuFront 2026-03-19 | 6/300 |
|
|
[考研] 286分人工智能專業(yè)請(qǐng)求調(diào)劑愿意跨考! +3 | lemonzzn 2026-03-17 | 4/200 |
|
|
[考研] 材料專碩英一數(shù)二306 +6 | z1z2z3879 2026-03-18 | 6/300 |
|
|
[考研] 266求調(diào)劑 +5 | 陽(yáng)陽(yáng)哇塞 2026-03-14 | 10/500 |
|
|
[考研] 一志愿 西北大學(xué) ,070300化學(xué)學(xué)碩,總分287,雙非一本,求調(diào)劑。 +3 | 晨昏線與星海 2026-03-19 | 3/150 |
|
|
[考研] 一志愿福大288有機(jī)化學(xué),求調(diào)劑 +3 | 小木蟲(chóng)200408204 2026-03-18 | 3/150 |
|
|
[考研] 354求調(diào)劑 +4 | Tyoumou 2026-03-18 | 7/350 |
|
|
[考研] 331求調(diào)劑(0703有機(jī)化學(xué) +7 | ZY-05 2026-03-13 | 8/400 |
|
|
[考研] 302求調(diào)劑 +10 | 呼呼呼。。。。 2026-03-17 | 10/500 |
|
|
[考研] 材料,紡織,生物(0856、0710),化學(xué)招生啦 +3 | Eember. 2026-03-17 | 9/450 |
|
|
[考研] 生物學(xué)071000 329分求調(diào)劑 +3 | 我愛(ài)生物生物愛(ài)?/a> 2026-03-17 | 3/150 |
|
|
[考博] 26博士申請(qǐng) +3 | 1042136743 2026-03-17 | 3/150 |
|
|
[考研] 085601求調(diào)劑 +4 | Du.11 2026-03-16 | 4/200 |
|
|
[考研] 東南大學(xué)364求調(diào)劑 +5 | JasonYuiui 2026-03-15 | 5/250 |
|
|
[考研] 機(jī)械專碩325,尋找調(diào)劑院校 +3 | y9999 2026-03-15 | 5/250 |
|
|
[考研] 333求調(diào)劑 +3 | 文思客 2026-03-16 | 7/350 |
|
|
[考研] 求老師收留調(diào)劑 +4 | jiang姜66 2026-03-14 | 5/250 |
|
|
[考研] 070305求調(diào)劑 +3 | mlpqaz03 2026-03-14 | 4/200 |
|
|
[考研] 招收0805(材料)調(diào)劑 +3 | 18595523086 2026-03-13 | 3/150 |
|