How can I define and pass a history prior to t0 to dde23 ?

조회 수: 9 (최근 30일)
Mike AA
Mike AA 2020년 3월 23일
댓글: Mike AA 2020년 3월 23일
In the documentation on dde23, it mentions that you can pass a history defined at t ≤ t0 to the solver, but in the examples it seems t ≤ 0 is the default for history. How can I change it from zero to t0?
Here's the example from the documentation:
function ddex1
%DDEX1 Example 1 for DDE23.
% This is a simple example of Wille' and Baker that illustrates the
% straightforward formulation, computation, and plotting of the solution
% of a system of delay differential equations (DDEs).
%
% The differential equations
%
% y'_1(t) = y_1(t-1)
% y'_2(t) = y_1(t-1)+y_2(t-0.2)
% y'_3(t) = y_2(t)
%
% are solved on [0, 5] with history y_1(t) = 1, y_2(t) = 1, y_3(t) = 1 for
% t <= 0.
%
% The lags are specified as a vector [1, 0.2], the delay differential
% equations are coded in the subfunction DDEX1DE, and the history is
% evaluated by the function DDEX1HIST. Because the history is constant it
% could be supplied as a vector:
% sol = dde23(@ddex1de,[1, 0.2],ones(3,1),[0, 5]);
%
% See also DDE23, FUNCTION_HANDLE.
% Jacek Kierzenka, Lawrence F. Shampine and Skip Thompson
% Copyright 1984-2004 The MathWorks, Inc.
sol = dde23(@ddex1de,[1, 0.2],@ddex1hist,[0, 5]);
figure;
plot(sol.x,sol.y)
title('An example of Wille'' and Baker.');
xlabel('time t');
ylabel('solution y');
% --------------------------------------------------------------------------
function s = ddex1hist(t)
% Constant history function for DDEX1.
s = ones(3,1);
% --------------------------------------------------------------------------
function dydt = ddex1de(t,y,Z)
% Differential equations function for DDEX1.
ylag1 = Z(:,1);
ylag2 = Z(:,2);
dydt = [ ylag1(1)
ylag1(1) + ylag2(2)
y(2) ];
Here's my own code:
t = [0:3000];
lags = 0.1;
hist = @(t) 0.000000001;
r = 0.1;
rm = 0.015;
Ka = 0.5;
Kb = 7;
K0 = 0.501;
sol = dde23(@(t,N,Nlag)Bilogistic(t,N,Nlag,Ka,Kb,r,rm,K0),lags,hist,[0,3000]);
tint = linspace(0,3000);
yint = deval(sol,tint);
plot(tint,yint,'r');
I would like to change the history so it reflects the range (-inf,t0).
  댓글 수: 1
Mike AA
Mike AA 2020년 3월 23일
I think I got it I needed to change the integration time span.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Delay Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by