| 查看: 1508 | 回復: 13 | ||||
vs570588木蟲 (正式寫手)
|
[求助]
求高手,擬合求參數(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),這個小程序快把我折磨死了。現(xiàn)在出來NLINFIT did NOT converge. Returning results from last iteration. beta = 0.0271 -8.1892 按道理,-8.1892不合理。出來的參數(shù)應該和我預估的差不多。大家看看,這是怎樣回事? |
木蟲 (正式寫手)
之乎者也

木蟲 (正式寫手)
|
謝謝你回復,這是我的問題,你看看,有啥辦法能解決?ds/dt = -q*S*X/(k+S)這里未知參數(shù)是q和K, q是比最大降解速率,K是半飽和常數(shù),X是污泥濃度214.63,這個值是定值。S是污染物的濃度, t肯定就是時間了。我具體試驗是隔一段時間,取一個樣品測出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ù)來擬合出上面微分方程里中的未知參數(shù)。你看能用啥好辦法?另外,我也看宋新山《matlab在環(huán)境科學中的應用》,上面也用個例子,但是有個例子直接給出了一系列ds/dt的值,并且這些值呈遞增。但你也知道,實際試驗不會出現(xiàn)這種理想情況。所以我求ds/dt值是用多項式擬合,求各個點的導數(shù),肯定這樣誤差大。但我實在想不出好辦法。也有人說用有限差分法,求出數(shù)值解,再代入,求最優(yōu)化參數(shù)。 |
木蟲 (正式寫手)
之乎者也

木蟲 (正式寫手)
|
你好,我用你給介紹的,參考別人寫的程序,用數(shù)值解求參數(shù),程序?qū)懙暮芊爆,你能幫我改改嗎?另外,現(xiàn)在運行不下去,提示說divided by zero.你能給看看,怎樣把數(shù)據(jù)處理就能好些? S=dsolve(‘Dy=-k1*y*214.63/(y+k2)’,’y(0)= 255.55’) simplify(S) %微分方程積分,求出來式子相當繁瑣 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))); |
榮譽版主 (著名寫手)
![]() |
專家經(jīng)驗: +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 |

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

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

木蟲 (正式寫手)
|
你好,謝謝你了。你用maple做出的解析解。我matlab是個菜鳥,怎樣用matlab實現(xià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. 我希望我出來的擬合圖形不應該是折線圖,而是如附件所示。我的數(shù)據(jù)和第三篇中的數(shù)據(jù)很像,也是一式三組試驗,其中一組和另外兩組數(shù)據(jù)有區(qū)別。第三篇擬合求參方法如上所示。 最后,還是要謝謝你。 |
木蟲 (正式寫手)
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 265求調(diào)劑 +4 | 梁梁校校 2026-03-19 | 4/200 |
|
|---|---|---|---|---|
|
[考研] 329求調(diào)劑 +5 | 想上學吖吖 2026-03-19 | 5/250 |
|
|
[考研] 307求調(diào)劑 +9 | 冷笙123 2026-03-17 | 9/450 |
|
|
[考研] 0703化學調(diào)劑 ,六級已過,有科研經(jīng)歷 +12 | 曦熙兮 2026-03-15 | 12/600 |
|
|
[考研] 0703化學調(diào)劑 +5 | pupcoco 2026-03-17 | 8/400 |
|
|
[考研] 328求調(diào)劑,英語六級551,有科研經(jīng)歷 +4 | 生物工程調(diào)劑 2026-03-16 | 12/600 |
|
|
[考研] 274求調(diào)劑 +6 | S.H1 2026-03-18 | 6/300 |
|
|
[考研] 材料工程專碩調(diào)劑 +5 | 204818@lcx 2026-03-17 | 6/300 |
|
|
[考研] 材料專業(yè)求調(diào)劑 +5 | hanamiko 2026-03-18 | 5/250 |
|
|
[考研]
|
胡辣湯放糖 2026-03-15 | 6/300 |
|
|
[考博] 環(huán)境領域全國重點實驗室招收博士1-2名 +3 | QGZDSYS 2026-03-13 | 5/250 |
|
|
[考研] 301求調(diào)劑 +9 | yy要上岸呀 2026-03-17 | 9/450 |
|
|
[考研] 085601求調(diào)劑 +4 | Du.11 2026-03-16 | 4/200 |
|
|
[考博] 26申博 +4 | 八6八68 2026-03-16 | 4/200 |
|
|
[考研] 一志愿211 0703方向310分求調(diào)劑 +3 | 努力奮斗112 2026-03-15 | 3/150 |
|
|
[考研] 277材料科學與工程080500求調(diào)劑 +3 | 自由煎餅果子 2026-03-16 | 3/150 |
|
|
[考研] 0703 物理化學調(diào)劑 +3 | 我可以上岸的對?/a> 2026-03-13 | 5/250 |
|
|
[考研] 22408總分284求調(diào)劑 +3 | InAspic 2026-03-13 | 3/150 |
|
|
[考研] 080500,材料學碩302分求調(diào)劑學校 +4 | 初識可樂 2026-03-14 | 5/250 |
|
|
[考研] 311求調(diào)劑 +3 | 冬十三 2026-03-13 | 3/150 |
|