ex13ch4.m
来自「these codes are for solving OED with mat」· M 代码 · 共 27 行
M
27 行
function sol = ex13ch4global ds T% The three delays:Delays = [0.2 1.0 2.4];opts = ddeset('RelTol',1e-5,'AbsTol',1e-8);for ds = 1:4 for i = 1:3 T = Delays(i); sol(i) = dde23(@ddes,T,3.5,[0, 25],opts); end figure plot(sol(1).x,sol(1).y,sol(2).x,sol(2).y,sol(3).x,sol(3).y) legend('T = 0.2','T = 1.0','T = 2.4',0) xlabel('time t') title(['Maturation Delay and Nonlinear' ... ' Birth Problem-Data Set ',num2str(ds)])end%=============================================================function v = ddes(t,y,Z)global ds T% The four data sets:a = [1 1 1 1];d = [1 1 1 1];d1 = [1 1 0 0];b = [20 80 20 80];v = b(ds) * exp(-a(ds)*Z)*Z*exp(-d1(ds)*T) - d(ds)*y;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?