Thanks a lot Steve.
I have made the corrections and I have sent you an email too.
This is my code.
I have corrected the error in declaring the equations.
This is my code.
lags = 0.01 ;
tspan = [0,5];
history = [0.01; 0.02; 0.01; 0.01; 0.02; 0.01; 0.02; 0.01; 0.01; 0.02; 0.01; 0.02; 0.01; 0.01; 0.02; 0.01; 0.02; 0.01; 0.01; 0.02];
options = ddeset(options, 'InitialY',[0.02; 0 ; 0.1 ;0 ;0.1 ;0 ;0 ;0 ;0 ;0 ; 0 ;0 ;0 ;0; 0; 0; 0; 0; 0; 0]);
for a = 1:10
sol(a) = dde23(@trail2DDEfunctions,lags,history,tspan,options(a),a)
end
This is a function I have written separately.
function dde_rijketube = trail2DDEfunctions(t,y,Z,a)
% parameters
tw = 1000;
t = 295;
lw = 3.6;
gamma = 1.4;
lamda = 0.0328;
cv = 719;
dw = 0.0005;
rhobar = 1.205;
xf = 0.7;
uo = 0.3;
s = 0.0016;
co = 344.64;
%c1 = 0;
%c2 = 0;
M = uo/co;
pbar = 101325;
k = ((gamma - 1)*2*lw*(tw-t)*sqrt(pi*lamda*cv*rhobar*dw*0.5*uo))/(s*co*pbar*sqrt(3));
ylag1 = Z(1,1);
dde_rijketube(1) = y(2);
dde_rijketube(2) = -a*a*pi*pi*y(1) - (2*k*a*pi/gamma*M)*(sqrt(abs(1/3 + ylag1*cos(1*pi*xf)))- sqrt(1/3))*sin(a*pi*xf);
end
------------------------------------------
Still, errors continue.
Error using dde23 (line 222)
DDEs must return column vectors.
Error in trail2DDE (line 50)
sol(a) = dde23(@trail2DDEfunctions,lags,history,tspan,options(a),a)
"Steven Lord" <
Steve...@mathworks.com> wrote in message <lj6pb4$9ba$
1...@newscl01ah.mathworks.com>...