Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Unreasonable behavior of ODE45 solver

1 Ansicht (letzte 30 Tage)
Arjun Iyer
Arjun Iyer am 29 Dez. 2015
Geschlossen: John D'Errico am 29 Dez. 2015
I have been seeing some weird behavior when using the ODE45 solver to solve a system of coupled differential equations. There is strange behavior around t=0, after which it converges to the required steady state values, since I am interested in the transient behavior, I would like to know what is going wrong. This behavior seems to pretty much independent of the initial values I choose. The system of equations are laser rate equations. I am attaching the solution recovered and the code.
if true
-------calling the solver-----------
paramfile='laser_param_1';
eval(paramfile);
global R A_fr del_om;
A_fr= sqrt(( J-(gamma_n*N_th))/gamma_p);
R=db2mag(-12.055);
del_om=1.7e9*2*pi;
options = odeset('RelTol',1e-7,'AbsTol',[1e-5,1e-5]);
[t,Y] = ode45(@leqn_solver_fun2,[0 5e-9],[A_fr N_th],options);
--------------defining the system of equations--------------
function [dY] = leqn_solver_fun2(t,Y)
paramfile='laser_param_1';
eval(paramfile);
% A simple function to simulate laser rate equations.
global R A_fr del_om;
dY=zeros(2,1);
dY(1)=0.5*g*(Y(2)-N_th)*(1+1i*3.5)*Y(1)+k*(R)*A_fr-1i*del_om*Y(1);
dY(2)= J-gamma_n*Y(2)-(gamma_p+g*(Y(2)-N_th))*abs(Y(1))^2;
end

Antworten (0)

Diese Frage ist geschlossen.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by