# Laser Rate Equations Simulation

## Homework Statement

Simulate the Rate Equations with Sinusoidal Signal

S: # of Photons Generated N: # of Electrons (Carriers)
Vg: Group Velocity =7.5e9 $$\tau$$e: Electron relaxation time = 1e-9
$$\tau$$p: Photon Lifetime = 1.7e-12 N0: 3.3e18
a: Differential Gain = 1e-15 $$\epsilon$$: nonliner gain suppression = 7.5e-17
I0 = 10e-3

## Homework Equations

dS/dt = (Vg*G - 1/$$\tau$$p)*S - 1/$$\tau$$e

dN/dt = I/q - N/$$\tau$$e - Vg*G*S

G = a(N-N0)/(1- $$\epsilon$$*S)

## The Attempt at a Solution

function dydt = laserrate(t,y)

dydt = zeros(size(y));

q = 1.6e-19; % charge of electron
tau_e = 1e-9; % electron relaxation time
No = 3.3e18; % # of electrons at transparency
a = 1e-15; % Linear gain coefficient
Vg = 7.5e9; % group velocity
tau_p = 1.7e-12; % photon lifetime
beta = 1e-5; % spontateous emission coefficient
eps = 7.5e-17; % Nonlinear gain suppression coefficient

w = 2*pi*10e5;
Io = 10e-3;
I = Io*sin(w*t);

tp = 1/tau_p;
te = 1/tau_e;

N = y(1);
S = y(2);
G = (a* (N-No)/(1-eps*S));

dydt(1) = (Vg*G-tp)*S - te; %dS/dt
dydt(2) = I./q - N*te - Vg*G*S; %dN/dt

When I use the odesolver to evaluate this function, I know that I should get a sinusoidal output for the t vs I plot, and "impulses" on the t vs S plot corresponding to the peak of sinusoid, however I only get a constant line using my code.