How can I solve delay differential equation (using dde23) in a broad range?
Show older comments
Dear all, I am trying to solve a delay differential equation. It is very simple, but I don't get enough accurate answer from these set of equations. The dde equations are as follow:
dA/dt=K*exp(0.5(1-a1i)G(t-T)-0.5(1-a*1i)Q(t-T))A(t-T)-K'*A(t)
dG/dt=D-Gamma*G(t)-exp(-Q(t))*(exp(G(t))-1)*|A|^2
dQ/dt=C-Q(t)-S(1-exp(-Q(t)))*|A|^2
1i in the first row of equations is imaginary number. K, K', D, C, and a are constant coefficients. A, G, Q are time dependent.
I have one basic questions which is that how can I define the arguments of dde23 to get better response? Do I have to use ddeset or options in my dde23? How can I understand there is a jump or discontinuities in solving these equations? How can I recognize that I need other options in defining dde23? I think as I extend the simulation range I get worse answer. I think the truncation error increases as the range increases.
The initial values for A, G, Q are 0, 4.18, 3.20, respectively. The developed code is as follows:
clc
A_0=0.0000; % Initial Condition of optical field
G_0=4.18; % Initail Condition for saturated gain
Q_0=3.20; % Initial Condition for saturated absorption
T=5;
% opts = ddeset('RelTol',1e-6,'AbsTol',1e-10);
options = ddeset('RelTol',1e-6,'AbsTol',1e-8,... 'InitialY',[0.001+0.001i;G_0;Q_0]);
sol = dde23('DDE',T,[A_0;G_0;Q_0],[0, 600],options);
plot(sol.x,(abs(sol.y)).^2);
title('Figure 1. Pulse Propagation.')
xlabel('time t');
ylabel('y(t)'); -------------------------
function v = DDE(t,y,Z)
gamma=39.15;
kappa=0.55;
alpha_g=0.2;
alpha_q=0.2;
Gamma=0.08;
S=4.65;
q0=Gamma*4.18;
g0=3.20/S;
T=5;
ylag1 = Z(:,1);
v = zeros(3,1);
v(1) = gamma*sqrt(kappa)*(exp(0.5*(1-alpha_g*1i)*ylag1(2)-0.5*(1-alpha_q*1i)*ylag1(3)))*ylag1(1)-
gamma*y(1);
v(2) = g0-Gamma*y(2)-exp(-y(3))*(exp(y(2))-1)*(abs(y(1)))^2;
v(3) = q0-y(3)-S*(1-exp(-y(3)))*(abs(y(1)))^2;
end
Thank you in advance for all your help! I am looking forward to your answers!
Answers (0)
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!