Solving DDE using MATLAb

78 views Asked by At
% declare the variables:
X = 2;
C = 2;
b = 1;
sv = 4;
M = 3;
a = 2;
% specify the lag:
lags = 1;
% specifying the time-span:
tf = 5;
tspan = linspace(1,tf,100);
% history function:
function ph = phist(t)
    ph = 1;
end 
% main function:
function dp = ddefunc(p, t, PL, X, C, sv, b, M, a)
    dp = X*(((C*(p/sv)^(b-1))-(M*(1-(sv/PL)^a)))/(M*(1-(sv/PL)^a)))*p;
end
% finally, I used dde23 to solve:
sol = dde23(@ddefunc, lags, @phist, tspan);

I am getting the following error (bifurcation is the name of my file):

>> bifurcation
Not enough input arguments.

Error in bifurcation>ddefunc (line 25)
    dp = X*(((C*(p/sv)^(b-1))-(M*(1-(sv/PL)^a)))/(M*(1-(sv/PL)^a)))*p;

Error in dde23 (line 217)
f0 = feval(ddefun,t0,y0,Z0,varargin{:});

Error in bifurcation (line 17)
sol = dde23(@ddefunc, lags, @phist, tspan);
 

I have no idea why this error is appearing. It is my first time trying to use dde23. Can anyone help?

0

There are 0 answers