Laser rate equation using ode45

In summary, the conversation is about a person requesting help with writing MATLAB code for laser rate equations and plotting the LI characteristic of the laser. They have provided a function they have written and are getting errors when they try to run it. They are seeking assistance with troubleshooting the errors.
  • #1
vinny
3
0
Hi,
I've attached the problem that I'm trying to solve. I've also done the manual calculations to calculate Ithreshold. I'm not very good with MATLAB and I need MATLAB code for laser rate equations and I also need to plot LI characteristic of the laser.

I_th=qV/(η_i τ) N_th=qV/(η_i τ) (N_tr+(α_i+1/2L ln⁡〖1/(R_1 R_2 )〗)/Γa)=76.73mA

P_out=(η_i (I-I_th)〖⋅V〗_p⋅hν⋅α_m⋅v_g)/(qVν_g a(N_th-N_tr )-〖εη〗_i (I-I_th)).

Please help me out with the code using ode45. All your help is much appreciated.

Regards,
Vinny
 

Attachments

  • problem.docx
    347.9 KB · Views: 255
Physics news on Phys.org
  • #2
function dy = rate_equation(t,y)
dy = zeros(2,1);
ni=0.9;
Lambda= 1.55*10^-6;
q= 1.602*10^-19;
V= 1.75*10^16;
a= 0.5*10^-20;
E= 1*10^-22;
Tau= 2.1*10^-9;
Ntr= 1*10^24;
Gamma= 0.3;
B= 1*10^-16;
Alphai= 3000;
Bsp= 1*10^-4;
ng= 3.7;
R1=0.32;
R2= 0.32;
L= 350*10^-6;
Alpham = (1/(2*L))*log(1/(R1*R2));
vg = (3*10^8/1.55*10^-6);
Taup = 1/(vg*(Alphai+Alpham));
Rsp=0;
I= 76.73e-3;

dy(1)=(ni*I)/q*V-y(1)/Tau- vg*a*((y(1)-Ntr)/(1+E*y(2)))*y(2);
dy(2) = Gamma*vg*a*((y(1)-Ntr)/(1+E*y(2)))*y(2)+Bsp*Gamma*Rsp-(y(2)/Taup);
end
is the function I wrote and when I use [T,Y] = ode45(@rate_equation,[0 10],[0 0]) the command window becomes non responsive. Please help me.
 
  • #3
clear all
close all
clc

options = odeset('RelTol',1e-4,'AbsTol',[1e-4 1e-4 1e-5]);
[T,Y] = ode45(@rate_equation,[0 10],[0 0], options);
plot(T,Y(:,1));
title('carriers density in high laser level')
hold on;
When I run this I get the following errors

? Undefined function or method 'd' for input arguments of type 'char'.

Error in ==> rate_equation at 25
d y(1)=(ni*I)/q*V-y(1)/Tau- vg*a*((y(1)-Ntr)/(1+E*y(2)))*y(2);

Error in ==> odearguments at 109
f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.

Error in ==> ode45 at 173
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...

Error in ==> laser at 5
[T,Y] = ode45(@rate_equation,[0 10],[0 0], options);

Somebody?anybody?
 

Related to Laser rate equation using ode45

1. How does the laser rate equation work?

The laser rate equation is a mathematical model used to describe the dynamics of a laser system. It takes into account the rate of population inversion, the rate of spontaneous emission, and the rate of stimulated emission to calculate the output power of the laser.

2. What is the role of ODE45 in the laser rate equation?

ODE45 is a numerical solver that is commonly used to solve ordinary differential equations (ODEs) such as the laser rate equation. It allows for efficient and accurate calculation of the laser output over time.

3. How do you incorporate the initial conditions into the laser rate equation using ODE45?

The initial conditions, such as the initial population inversion and the initial laser output, can be incorporated into the laser rate equation by setting them as the initial values for the ODE solver. The solver will then use these values to calculate the values of the variables at each time step.

4. Can the laser rate equation using ODE45 be applied to all types of lasers?

Yes, the laser rate equation using ODE45 can be applied to all types of lasers as long as the system can be described by the rate of population inversion, spontaneous emission, and stimulated emission.

5. How can the laser rate equation using ODE45 be used in practical applications?

The laser rate equation using ODE45 can be used in practical applications to design and optimize laser systems. It allows for the prediction of the laser output under different conditions, such as changes in the population inversion or input power, which can aid in the development of more efficient and powerful lasers.

Similar threads

  • Advanced Physics Homework Help
Replies
10
Views
6K
  • Differential Equations
Replies
2
Views
6K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
5K
  • Differential Equations
Replies
1
Views
2K
  • Differential Equations
Replies
21
Views
29K
Back
Top