| 查看: 1388 | 回复: 13 | ||||
vs570588木虫 (正式写手)
|
[求助]
求高手,拟合求参数
|
|
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); 为了参数c(1),c(2),这个小程序快把我折磨死了。现在出来NLINFIT did NOT converge. Returning results from last iteration. beta = 0.0271 -8.1892 按道理,-8.1892不合理。出来的参数应该和我预估的差不多。大家看看,这是怎样回事? |
» 猜你喜欢
【复旦大学】二维材料方向招收2026年博士研究生1名
已经有0人回复
北京纳米能源与系统研究所 王中林院士/曹南颖研究员课题组2026级硕/博/博后招生
已经有10人回复
物理学I论文润色/翻译怎么收费?
已经有61人回复
荷兰Utrecht University超快太赫兹光谱王海教授课题招收2026 CSC博士生
已经有23人回复
反铁磁体中的磁性切换:两种不同的机制已成功可视化
已经有0人回复
求标准粉末衍射卡号 ICDD 01-076-1802
已经有0人回复
新西兰Robinson研究所招收全奖PhD
已经有0人回复
石墨烯转移--二氧化硅衬底石墨烯
已经有0人回复
笼目材料中量子自旋液体基态的证据
已经有0人回复
» 本主题相关价值贴推荐,对您同样有帮助:
用parstat2273电化学工作站测正极材料的循环伏安曲线、交流阻抗的参数怎么设置呀?
已经有4人回复
高手帮忙拟合一组曲线,解决另加分!
已经有19人回复
求助粉晶拟合,欢迎各位高手!
已经有19人回复
origin 曲线拟合求助,高手请进
已经有11人回复
利用origin 拟合曲线求参数,程序老出现错误,急死了,求各位高手指点!
已经有7人回复
origin 拟合公式求助
已经有4人回复
帮帮忙看看我的难题
已经有15人回复
求助origin高手 非线性拟合问题
已经有6人回复
用1stopt进行数据拟合时,无法运行sharedmodel ,求助高手
已经有7人回复
【求助】Arcgis与GS+在地统计分析中的区别
已经有39人回复
lidaxue
木虫 (正式写手)
之乎者也
- 应助: 10 (幼儿园)
- 金币: 1952.1
- 散金: 612
- 红花: 2
- 帖子: 527
- 在线: 856.1小时
- 虫号: 259962
- 注册: 2006-06-17
- 性别: GG
- 专业: 几何学

2楼2011-05-31 10:06:39
vs570588
木虫 (正式写手)
- 应助: 0 (幼儿园)
- 金币: 3112.1
- 散金: 456
- 红花: 1
- 帖子: 923
- 在线: 420.6小时
- 虫号: 822119
- 注册: 2009-08-04
- 性别: GG
- 专业: 环境工程
|
谢谢你回复,这是我的问题,你看看,有啥办法能解决?ds/dt = -q*S*X/(k+S)这里未知参数是q和K, q是比最大降解速率,K是半饱和常数,X是污泥浓度214.63,这个值是定值。S是污染物的浓度, t肯定就是时间了。我具体试验是隔一段时间,取一个样品测出S,所以我最原始数据是 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]; 就那这一组数据来拟合出上面微分方程里中的未知参数。你看能用啥好办法?另外,我也看宋新山《matlab在环境科学中的应用》,上面也用个例子,但是有个例子直接给出了一系列ds/dt的值,并且这些值呈递增。但你也知道,实际试验不会出现这种理想情况。所以我求ds/dt值是用多项式拟合,求各个点的导数,肯定这样误差大。但我实在想不出好办法。也有人说用有限差分法,求出数值解,再代入,求最优化参数。 |
3楼2011-05-31 16:42:18
lidaxue
木虫 (正式写手)
之乎者也
- 应助: 10 (幼儿园)
- 金币: 1952.1
- 散金: 612
- 红花: 2
- 帖子: 527
- 在线: 856.1小时
- 虫号: 259962
- 注册: 2006-06-17
- 性别: GG
- 专业: 几何学

4楼2011-05-31 18:47:03
vs570588
木虫 (正式写手)
- 应助: 0 (幼儿园)
- 金币: 3112.1
- 散金: 456
- 红花: 1
- 帖子: 923
- 在线: 420.6小时
- 虫号: 822119
- 注册: 2009-08-04
- 性别: GG
- 专业: 环境工程
|
你好,我用你给介绍的,参考别人写的程序,用数值解求参数,程序写的很繁琐,你能帮我改改吗?另外,现在运行不下去,提示说divided by zero.你能给看看,怎样把数据处理就能好些? 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))); |
5楼2011-06-02 15:08:43
dbb627
荣誉版主 (著名写手)
-

专家经验: +4 - 计算强帖: 12
- 应助: 289 (大学生)
- 贵宾: 0.589
- 金币: 24640.4
- 散金: 551
- 红花: 61
- 沙发: 1
- 帖子: 1246
- 在线: 1794.8小时
- 虫号: 149791
- 注册: 2005-12-29
- 性别: GG
- 专业: 污染控制化学
- 管辖: 计算模拟
【答案】应助回帖
|
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 |

6楼2011-06-02 21:41:09
dbb627
荣誉版主 (著名写手)
-

专家经验: +4 - 计算强帖: 12
- 应助: 289 (大学生)
- 贵宾: 0.589
- 金币: 24640.4
- 散金: 551
- 红花: 61
- 沙发: 1
- 帖子: 1246
- 在线: 1794.8小时
- 虫号: 149791
- 注册: 2005-12-29
- 性别: GG
- 专业: 污染控制化学
- 管辖: 计算模拟

7楼2011-06-02 21:48:41
dbb627
荣誉版主 (著名写手)
-

专家经验: +4 - 计算强帖: 12
- 应助: 289 (大学生)
- 贵宾: 0.589
- 金币: 24640.4
- 散金: 551
- 红花: 61
- 沙发: 1
- 帖子: 1246
- 在线: 1794.8小时
- 虫号: 149791
- 注册: 2005-12-29
- 性别: GG
- 专业: 污染控制化学
- 管辖: 计算模拟

8楼2011-06-02 21:50:44
vs570588
木虫 (正式写手)
- 应助: 0 (幼儿园)
- 金币: 3112.1
- 散金: 456
- 红花: 1
- 帖子: 923
- 在线: 420.6小时
- 虫号: 822119
- 注册: 2009-08-04
- 性别: GG
- 专业: 环境工程
|
你好,谢谢你了。你用maple做出的解析解。我matlab是个菜鸟,怎样用matlab实现,我不会。你能帮我看看吗?另外,这里还有几篇英文文献,处理类似的问题。 第一篇: 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. 我希望我出来的拟合图形不应该是折线图,而是如附件所示。我的数据和第三篇中的数据很像,也是一式三组试验,其中一组和另外两组数据有区别。第三篇拟合求参方法如上所示。 最后,还是要谢谢你。 |
9楼2011-06-04 18:32:27
vs570588
木虫 (正式写手)
- 应助: 0 (幼儿园)
- 金币: 3112.1
- 散金: 456
- 红花: 1
- 帖子: 923
- 在线: 420.6小时
- 虫号: 822119
- 注册: 2009-08-04
- 性别: GG
- 专业: 环境工程
10楼2011-06-04 18:37:03













回复此楼