View Single Post
oronno
#1
Feb16-09, 09:31 AM
P: 12
hello...

Can anyone tell me how can I simulate the laser rate equation with matlab? i allready wrote a code whics is as follows,

%have to write one editor

function dy=rate_equation(t,y)
dy = zeros(2,1);
I =50e-3;

%for t=1:10;

q =1.602e-19;
v =9e-11;
eps =3.4e-17;
N0 =1.8e-18;
tn =3e-9;
g0 =3e-6;
lamda=0.44;
bita=4e-4;
tp=1e-12;
dy(1)=(I/(q*v))-((g0*(y(1)-N0)*y(2))/(1+eps*y(2)))-(y(1)/tn);
dy(2)=(lamda*g0*(y(1)-N0)*y(2))/(1+eps*y(2))-(y(2)/tp)-((lamda*bita*y(2))/tn);
end

%have to write other editor
%step size=0.01;
clc
tspan=[0,10];
y0=[0,1];
[T,Y]= ode45(@try1,tspan,y0);
plot(T,Y(:,1),'-',T,Y(:,2),'.');
title('plot of carrier and photon densities');
xlabel('time');
ylabel('densities');
Attached Thumbnails
rate2.JPG   rate3.JPG  
Attached Images
File Type: bmp rate1.bmp (185.9 KB, 186 views)
Phys.Org News Partner Science news on Phys.org
Security CTO to detail Android Fake ID flaw at Black Hat
Huge waves measured for first time in Arctic Ocean
Mysterious molecules in space