24小时热门版块排行榜    

北京石油化工学院2025年硕士研究生招生接受调剂公告
查看: 6760  |  回复: 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的回帖

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的回帖
查看全部 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的回帖

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的回帖

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的回帖
普通表情 高级回复(可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 298求调剂 +9 分母. 2025-04-03 9/450 2025-04-07 18:10 by wandecheng
[考研] 325求调剂 +3 章鱼哥7号 2025-04-07 3/150 2025-04-07 17:40 by lishahe
[考研] 材料与化工284调剂 +9 老田的暖手宝 2025-04-03 9/450 2025-04-07 16:53 by QGZDSYS
[考研] 材料与化工085600求调剂 +12 cs0106 2025-04-04 12/600 2025-04-07 16:15 by zgfa
[考研] 086001生物技术与工程求调剂 +4 饱饱不吃饭 2025-04-07 4/200 2025-04-07 12:12 by zhzhwei2005
[考研] 求化学调剂 +15 求学生涯ing 2025-04-06 15/750 2025-04-07 11:30 by lijunpoly
[考研] 生物学324求调剂 +5 3333月亮 2025-04-05 6/300 2025-04-07 11:17 by zhyzzh
[考研] 求化学调剂 +5 不知道起什么名� 2025-04-06 5/250 2025-04-07 08:10 by Iveryant
[教师之家] 想利用你又要打击你 +5 河西夜郎 2025-04-05 5/250 2025-04-07 08:09 by 走了002
[考研] 求调剂导师 +6 fairy9999 2025-04-03 6/300 2025-04-06 17:47 by calebby
[考研] 317求调剂 +6 小宋必定上岸 2025-04-03 6/300 2025-04-06 17:25 by calebby
[考研] 能动方向求调剂 +3 能动找调剂 2025-04-04 5/250 2025-04-06 16:01 by fmkLL
[考研] 274求调剂 +3 1942987877 2025-04-05 3/150 2025-04-06 12:52 by ukichiaki
[考研] 296求调剂 +11 在结南桃 2025-04-05 12/600 2025-04-06 12:14 by qlm5820
[考研] 调剂!一志愿郑大283材料与化工专硕 +13 不吃香菜菜菜 2025-04-01 14/700 2025-04-06 01:11 by Ade.
[考研] 085601材料292求调剂 +19 故人?? 2025-04-01 25/1250 2025-04-05 08:09 by tbtin
[考研] 一志愿中国科学院大学 专业生物与医药086000 分数326求调剂 本科双非 只过了四级 +4 ccccc12 2025-04-04 5/250 2025-04-05 07:15 by 河大薇薇
[考研] 330求调剂 +3 Lrere 2025-04-04 5/250 2025-04-04 23:07 by Lrere
[考研] 263求调剂 +10 36木木 2025-04-03 10/500 2025-04-04 21:34 by Ade.
[考研] 085602(化学工程)312求调剂 +10 hiimsakura 2025-04-01 10/500 2025-04-04 13:40 by loucr200301.
信息提示
请填处理意见
复试调剂复试调剂
复试调剂二维码获取复试 & 调剂指南!微信扫一扫
商务合作商务合作
商务合作二维码商务合作咨询微信扫一扫(备注:商务合作)
学术干货学术干货
学术干货二维码微信扫一扫了解最新学术干货
论文辅导论文辅导
论文辅导二维码微信扫一扫添加老师,免费咨询
师资招募师资招募