# Homework Help: Laser rate equation using matlab

1. May 29, 2014

### mya246

Hi, is there anyone familiar with rate equation solving using Matlab? I need help on this

2. May 29, 2014

### Staff: Mentor

Hi mya, welcome to PF!

You need to be more specific. What equation are you trying to solve? What exactly is the problem you are having?

3. Jun 1, 2014

### mya246

I need to plot the light-current characteristic of laser (Pout vs I) by solving using ode45.

dy(1)= ((ni*I)/(q*V))-(N/tau)-(v_g*a*((N-N_tr)/(1+epsilon*N_p))*N_p);
dy(2)= (T*v_g*a*((N-N_tr)/(1+epsilon*N_p))*N_p) + (B_sp*T*R_sp) - (N_p/tau_p);

Pout = N_p*Vp*h*v*alpha_m*v_g;

how can I do that?

4. Jun 2, 2014

### mya246

I need to plot the light-current characteristic of laser (Pout vs I) by solving using ode45.

dy(1)= ((ni*I)/(q*V))-(N/tau)-(v_g*a*((N-N_tr)/(1+epsilon*N_p))*N_p);
dy(2)= (T*v_g*a*((N-N_tr)/(1+epsilon*N_p))*N_p) + (B_sp*T*R_sp) - (N_p/tau_p);

Pout = N_p*Vp*h*v*alpha_m*v_g;

how can I do that?

5. Jun 2, 2014

### Staff: Mentor

I'm sorry, but this is not clear at all. You have dy(1) and dy(2), but I don't see any y(1) or y(2). And these are the derivatives with respect to what? And how does Pout relate to those ODEs?

6. Jun 2, 2014

### mya246

sorry for that y(1) = N, y(2) = N_p. How can I plot the Pout vs current? Pout is related to N_p by solving the ODE

7. Jun 9, 2014

### Staff: Mentor

I'm sorry, but I'm still not clear on what you are solving. Are the derivatives with respect to time?

8. Jun 10, 2014

### reza 86

rate equation

clc
clear all
close all
tau_s = 3e-9;
N0 = 1e24;
A =1e-12;
P0 = 1/(A*tau_s);
TSPAN = [0 10];
Y0 =[0 0];
[T,Y] = ODE45(@rate_equation,TSPAN,Y0);
subplot(2,1,1)
plot(T*tau_s ,Y(:,1)*N0)
title('carriers density in high laser level') % carriers density in high laser level
subplot(2,1,2)
plot(T*tau_s ,Y(:,2)*P0)
title('photons density in activer region') % photons density in activer region
And this is the function.
function dy = rate_equation(t,y)
dy = zeros(2,1);
tau_s = 3e-9; % carriers lifetime
tau_p = 1e-12; % photons lifetime
A = 1e-12; % linear gain costant
N0 = 1e24; % trasparency carries density
V = 3.75e-14; % modal volume
gamma = 1e-5; % gain compression factor
q = 1.6e-19; % electron charge
I0 = N0*q*V/tau_s; % trasparency current
tau_norm = tau_s/tau_p;
eta = A*tau_p*N0; % efficiency
I = 2.5*I0; % pumping current ( try: from I0 to 3*I0 for example ...and see what happens!)
dy(1)= I/I0 -y(2)*(y(1) - 1) -y(1);
dy(2) = tau_norm*(y(2)*(eta*(y(1) - 1) -1) + gamma*eta*y(1))

Last edited: Jun 10, 2014
9. Jun 10, 2014

### reza 86

I hope that it would be helpful,

Can any one help me by giving MATLAB code to simulate semiconductor laser rate equation by finite difference methord. i wrote a code but it is not working. please help me.

10. Jun 13, 2014

qzsas