matlab编写方程各位大侠,我是个新手,对于编程语言可以说一窍不通.但是我现在急着要写出一个简单的方程求解.拜托大侠帮帮啊,我把仅有的两个麦片奉上了.方程:d(Ct)/dt=k(Cmax-Ct)^2其中:Ct=24.8
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/05 15:59:19
matlab编写方程各位大侠,我是个新手,对于编程语言可以说一窍不通.但是我现在急着要写出一个简单的方程求解.拜托大侠帮帮啊,我把仅有的两个麦片奉上了.方程:d(Ct)/dt=k(Cmax-Ct)^2其中:Ct=24.8
matlab编写方程
各位大侠,我是个新手,对于编程语言可以说一窍不通.但是我现在急着要写出一个简单的方程求解.拜托大侠帮帮啊,我把仅有的两个麦片奉上了.
方程:d(Ct)/dt=k(Cmax-Ct)^2
其中:Ct=24.8 23.86667 23.27333 21.67333 18.48667 16.20667 13.93333 7.70667 5.98667 4.40667 1.59333 0.66667 0
t=0,1,6,12,18,24,30,36,42,48,54,60,72
Cmax=max(Ct)=24.8
ps:d(Ct)/dt一阶导数
求k
matlab编写方程各位大侠,我是个新手,对于编程语言可以说一窍不通.但是我现在急着要写出一个简单的方程求解.拜托大侠帮帮啊,我把仅有的两个麦片奉上了.方程:d(Ct)/dt=k(Cmax-Ct)^2其中:Ct=24.8
先求Ct-t的关系
y=dsolve('Dy-k*(24.8-y)^2=0')
y =
124/5
124/5 - 1/(25*(C1+ (k*t)/25))
再用matlab拟合参数k和C1
t=[0,1,6,12,18,24,30,36,42,48,54,60,72]';
Ct=[24.8 23.86667 23.27333 21.67333 18.48667 16.20667 13.93333...
7.70667 5.98667 4.40667 1.59333 0.66667 0]';
ft_ = fittype('124/5 - 1/(25*(C1 + (k*t)/25))',...
'dependent',{'Ct'},'independent',{'t'},...
'coefficients',{'k','C1'});
st=[-0.001 0.4]
[curve, goodness]= fit(t,Ct,ft_,'Startpoint',st)
figure,plot(t,Ct,'*'),hold on,
plot(curve,'predobs',0.99);
st =
-0.0010 0.4000
curve =
General model:
curve(t) = 124/5 - 1/(25*(C1 + (k*t)/25))
Coefficients (with 95% confidence bounds):
k = -0.001356 (-0.002203, -0.0005092)
C1 = 0.005256 (0.003034, 0.007479)
goodness =
sse: 348.0195
rsquare: 0.6773
dfe: 11
adjrsquare: 0.6480
rmse: 5.6248