我自己用dde编了一个,但出现错误,程序如下:
%ddefun.m
%延迟微分方程
function dydt=ddefun(t,y,Z)
ylag = Z(:,1);
dydt=zeros(3,1);
Uvir=420;
Kcdv=0.024;
Kva=1;
Kvi=0.002;
Kcdf=0.001;
Kvd=0.003;
Um=0.03;
Cm=1200000;
dydt(1)=Um*(Cm-y(1)-y(2))*y(1)/Cm-Kcdf*y(1)-Kvi*y(1)*y(3);
dydt(2)=Kvi*y(1)*y(3)-Kcdv*y(2);
dydt(3)=Uvir*ylag(2)-Kvd*y(3)-Kva*y(1)*y(3);
sol=dde23(@ddefun,4.5,[1200000;0;26000000],[0,90]);
Error in ==> dde23 at 413
Z = lagvals(t1,lags,history,X,Y,YP,varargin{:}); |