试一下:
clc,clear
syms k t
y=dsolve('Dy=k*y*(y-18)','t'); %温度与时间的微分方程
xishu=solve(subs(y,'t',0)-98,subs(y,'t',5)-38,'k','C1');
k=xishu.k;C1=xishu.C1;
y=subs(y,{'k' 'C1'},{k,C1}) %温度y与时间t的关系
t1=double(solve(y-20)) %单位:分钟
结果:
y =
18/(1-40/49*exp(1/5*log(49/76)*t))
t1 =
23.9187(分钟)