Laser Rate Equation Using ODE45 in MATLAB?

vinny
Messages
3
Reaction score
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

Physics news on Phys.org
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.
 
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?
 
Thread 'Need help understanding this figure on energy levels'
This figure is from "Introduction to Quantum Mechanics" by Griffiths (3rd edition). It is available to download. It is from page 142. I am hoping the usual people on this site will give me a hand understanding what is going on in the figure. After the equation (4.50) it says "It is customary to introduce the principal quantum number, ##n##, which simply orders the allowed energies, starting with 1 for the ground state. (see the figure)" I still don't understand the figure :( Here is...
Thread 'Understanding how to "tack on" the time wiggle factor'
The last problem I posted on QM made it into advanced homework help, that is why I am putting it here. I am sorry for any hassle imposed on the moderators by myself. Part (a) is quite easy. We get $$\sigma_1 = 2\lambda, \mathbf{v}_1 = \begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix} \sigma_2 = \lambda, \mathbf{v}_2 = \begin{pmatrix} 1/\sqrt{2} \\ 1/\sqrt{2} \\ 0 \end{pmatrix} \sigma_3 = -\lambda, \mathbf{v}_3 = \begin{pmatrix} 1/\sqrt{2} \\ -1/\sqrt{2} \\ 0 \end{pmatrix} $$ There are two ways...

Similar threads

Back
Top