24小时热门版块排行榜     石溪大学接受考研调剂申请>

【调剂】北京石油化工学院2024年16个专业接受调剂
查看: 6322  |  回复: 21
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

yupeifeng

金虫 (小有名气)

[交流] matlab求解方程中的参数已有4人参与

搞了这么久还是没有解决这个问题。现在求助于高手给予指点。谢谢了!!
实验数据为:(t,c)=(0,0.69)(2,0.645)(4,0.635)(8,0.62)(24,0.61)(48,0.61).其中t为时间,c为某离子的浓度。
动力学方程模型为:-dc/dt=k*(c0-c)^(1/3)*(c-c~).
其中c0为初始浓度可以取0.7,c~为平衡浓度取0.61.
怎么样才能拟合出参数k的值呢?谢谢大家给出程序代码,再次感谢
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

憧憬未来
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dbb627

荣誉版主 (著名写手)

★ ★ ★ ★
fegg7502: 金币+4, 应助指数+1, 专家考核, 多谢交流 2012-07-09 08:07:38
结果如下
Local minimum possible.

lsqnonlin stopped because the final change in the sum of squares relative to
its initial value is less than the default value of the function tolerance.




Estimated Parameters by Lsqnonlin():
         k = 1.0138 ± 0.3000
  The sum of the residual squares is: 1.5e-004


The more you learn, the more you know, the more you know, and the more you forget. The more you forget, the less you know. So why bother to learn.
3楼2012-07-02 17:39:27
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 22 个回答

dbb627

荣誉版主 (著名写手)

★ ★ ★ ★ ★
小木虫: 金币+0.5, 给个红包,谢谢回帖
fegg7502: 金币+4, 多谢交流 2012-07-09 08:07:15
这个其实论坛里有很多例子,参考就能写出来。
给你写了个
CODE:
function parafit
clear all;
t=[0 2 4 8 24 48];
y=[0.69 0.645 0.635 0.62 0.61 0.61];
y0=0.69;

% Nonlinear least square estimate using lsqnonlin()
beta0=0.5;
lb=[0];ub=[inf];
[beta,resnorm,residual,exitflag,output,lambda,jacobian] = ...
    lsqnonlin(@Func,beta0,lb,ub,[],t,y,y0);         
ci = nlparci(beta,residual,jacobian);
beta;
% result
fprintf('\n Estimated Parameters by Lsqnonlin():\n')
fprintf('\t k = %.4f ± %.4f\n',beta(1),ci(1,2)-beta(1))
fprintf('  The sum of the residual squares is: %.1e\n\n',sum(residual.^2))

% plot of fit results
tspan = [0  max(t)];
[tt yc] = ode45(@ModelEqs,tspan,y0,[],beta);
tc=linspace(0,max(t),200);
yca = spline(tt,yc,tc);
plot(t,y,'ro',tc,yca,'r-');
hold on
xlabel('Time');
ylabel('Concentration');
hold off
% =======================================
function f1 = Func(beta,t,y,y0)        % Define objective function
tspan =t;
[tt yy] = ode45(@ModelEqs,tspan,y0,[],beta);
yc= spline(tt,yy,t);
f1=y-yc;
% ==================================
function dydt = ModelEqs(t,y,beta)          % Model equations
dydt = -beta*(0.7-y).^(1/3)*(y-0.61);

The more you learn, the more you know, the more you know, and the more you forget. The more you forget, the less you know. So why bother to learn.
2楼2012-07-02 17:38:01
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

yupeifeng

金虫 (小有名气)

引用回帖:
3楼: Originally posted by dbb627 at 2012-07-02 17:39:27
结果如下
Local minimum possible.

lsqnonlin stopped because the final change in the sum of squares relative to
its initial value is less than the default value of the function tolerance.

< ...

首先感谢这位 学长啊,我有点看不懂啊,你帮我 分析下思路,步骤是什么?就是先做设么计算,
憧憬未来
4楼2012-07-02 22:01:21
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dingd

铁杆木虫 (职业作家)

★ ★ ★
小木虫: 金币+0.5, 给个红包,谢谢回帖
fegg7502: 金币+2, 多谢交流 2012-07-09 08:07:55
1stOpt求解:
CODE:
Constant c0=0.7,cp=0.61;
Variable t,c;
ODEFunction c'=-k*(c0-c)^(1/3)*(c-cp)
Data;
t,c
0,0.69
2,0.645
4,0.635
8,0.62
24,0.61
48,0.61

均方差(RMSE): 0.00535058522113925
残差平方和(SSE): 0.000143143811043369
相关系数(R): 0.955733024504782
相关系数之平方(R^2): 0.913425614129058
决定系数(DC): 0.852429060780033

参数                  最佳估算
--------------------        -------------
k        1.02159845408008
5楼2012-07-03 08:52:49
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[有机交流] 傅克酰基化,产率大于百分之一百,求解,很急 90+5 hsn991013 2024-04-15 11/550 2024-04-19 14:49 by scdxyouji
[硕博家园] +5 s150535912 2024-04-18 5/250 2024-04-19 12:10 by bingdian_46
[考研] 考研英语带学 +5 choice666 2024-04-18 5/250 2024-04-19 10:39 by 阿777
[找工作] 家乡二本高校/沿海传统私企,如何抉择? 10+5 化学巷 2024-04-15 13/650 2024-04-19 09:54 by 光催京城
[基金申请] 下雨了 +13 zju2000 2024-04-16 19/950 2024-04-19 09:24 by duxin_30
[找工作] 杭州国企和浙江高校如何选择? +14 restart2024 2024-04-15 20/1000 2024-04-18 22:24 by 西瓜霜华
[论文投稿] 最近遇到这样一个问题 4+3 asd123gfa689 2024-04-18 6/300 2024-04-18 18:43 by chaodanming
[论文投稿] The total environment格式 25+4 lyyyyds0 2024-04-13 9/450 2024-04-18 09:33 by 我为人人研
[考研] 0854计算机技术316分调剂,求求导师 捞我一下,有学就上 +6 zhushijie218 2024-04-16 7/350 2024-04-17 23:33 by petro
[基金申请] 请问教育部人文社科难度大吗 +9 锦衣卫寒战 2024-04-15 14/700 2024-04-16 23:10 by 锦衣卫寒战
[考研] 347求调剂 +3 寒辰ovo 2024-04-15 7/350 2024-04-16 19:05 by 寒辰ovo
[考研] 329求调剂 +6 Kaylawander 2024-04-13 7/350 2024-04-16 12:00 by 风来花开1
[考研] 320求调剂 +5 陆志伟 2024-04-15 5/250 2024-04-16 11:11 by 19862091
[论文投稿] with efitor 越久是不是越容易拒稿。我的已经一个多月了 +5 lizhengke06 2024-04-14 5/250 2024-04-15 18:33 by jonewore
[考研] 328求调剂 +3 send rgsc 2024-04-14 7/350 2024-04-15 18:17 by zw_muchong
[材料综合] 请问哪里可以测试低压吸氢的PCT曲线 +3 yunshengcd 2024-04-14 5/250 2024-04-15 13:59 by zqdsb
[考研] 300求调剂 +5 @Xqy668800 2024-04-14 6/300 2024-04-14 23:03 by lincunhui
[考研] 309求调剂 +3 留不住放不下 2024-04-14 6/300 2024-04-14 15:28 by 19902169
[考研] 334求调剂 +4 学药救人 2024-04-13 6/300 2024-04-13 20:27 by 献世的王
[硕博家园] 生物炭采购 +3 锦鲤附体@ 2024-04-12 3/150 2024-04-12 22:10 by Danny614
信息提示
请填处理意见