New to matlab. Why i get this answer?

1 次查看(过去 30 天)
>> syms y(t) yef(t);
ymax=120*0.40680;
yef(t)= 0.95*(1/(1+(y(t)/ymax)*y(t)+(1-(1/(1+(y(t)/ymax))*ymax))));
yo=0.40680*140;
k10=2.37;
R=0.00831447;
T=395;
HA=0.08;
n1=1.51;
E1=83.3;
K1=k10*(10^10)*(HA^n1)*exp(-E1/R*T);
ode=diff(y(t),t)==-K1*yef(t);
cond=y(0)==yo;
ySol(t)=dsolve(ode,cond)
ySol(t) =7119/125
  3 个评论
Georgios Stefanis
Georgios Stefanis 2021-11-8
Sorry new to all this. Am i trying to solve that differential equation.I was expecting getting a function of t as a result and not a number.
Rik
Rik 2021-11-8
I haven't checked the math, so I don't know if you should have expected something as a function of t. If you have reason to expect that, you should check the implementation step.

请先登录,再进行评论。

采纳的回答

Rik
Rik 2021-11-8
syms y(t) yef(t);
ymax=120*0.40680;
yef(t)= 0.95*(1/(1+(y(t)/ymax)*y(t)+(1-(1/(1+(y(t)/ymax))*ymax))));
yo=0.40680*140;
k10=2.37;
R=0.00831447;
T=395;
HA=0.08;
n1=1.51;
E1=83.3;
K1=k10*(10^10)*(HA^n1)*exp(-E1/R*T);
ode=diff(y(t),t)==-K1*yef(t);
cond=y(0)==yo;
ySol(t)=dsolve(ode,cond)
ySol(t) = 
This is what you get, because it is the solution. If you want it in a decimal form you can easily extract the numeric value:
double(ySol(t))
ans = 56.9520

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Number Theory 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by