Solving laser rate equation with ode45
조회 수: 15 (최근 30일)
이전 댓글 표시
Hey! I am kinda new to Matlab and I am currently doing my thesis on Semiconductor lasers. I am currently trying to model the rate equations for semiconductor lasers. I have wrote a code but it shows some errors. I have been stuck on this issue for quite some time and it seems that I have done something wrong with ode45. Any type of help is greatly appreciated.
------Main program-----------
ti = 0;
tf = 10;
tspan=[ti tf];
y0=[0, 1];
% tp = photon lifetime
tp = 1E-12;
% n0 = internal efficiency
n0 = 1E-18;
% a = linewidth broadening factor
a = 2.5E-16;
% L = optical confinement factor
L = 0.3;
% te = electron lifetime
te = 1E-19;
% Rsp = recombination rate
Rsp = ((n0 *1E-18)/te);
% Ng = group refractive index
Ng = 4;
% d = active layer thickness
d = 3E-7;
% g = optical gain
g = 3.16E-12;
b = 2E-5;
J = 2000;
S = 1;
%options?
[T,Y]= ode45(@rate_eq,tspan,y0,tp,n0,L,Rsp,S,Ng,d,g,b,J);
plot(T,Y(:,1),'-',T,Y(:,2),'.');
title('plot of carrier and photon densities');
xlabel('time');
ylabel('densities');
-------function--------
function df = rate_eq(tspan,y0,tp,n0,L,Rsp,S,Ng,d,g,b,J,c,e)
% e = electron charge
e = 1.602E-19;
% c = speed of light
c = 3E8;
% rate equation for carrier density
% Carriers
df(1,1) = (J/(e * d)) - (Rsp/n0) - ((c*L*g*S)/(Ng));
% Photons
df(2,1) = ((c*L*g*S)/(Ng)) - (S/tp) + (b*Rsp);
end
Thanks in advance for helping!!
댓글 수: 1
chandrakanth MS
2020년 6월 22일
can you explain me about the output, like why exactly is it linear? and could give me the refernce from where you got the rate equations from
답변 (2개)
Torsten
2017년 1월 2일
ti = 0;
tf = 10;
tspan=[ti tf];
y0=[0; 1];
% tp = photon lifetime
tp = 1E-12;
% n0 = internal efficiency
n0 = 1E-18;
% a = linewidth broadening factor
a = 2.5E-16;
% L = optical confinement factor
L = 0.3;
% te = electron lifetime
te = 1E-19;
% Rsp = recombination rate
Rsp = ((n0 *1E-18)/te);
% Ng = group refractive index
Ng = 4;
% d = active layer thickness
d = 3E-7;
% g = optical gain
g = 3.16E-12;
b = 2E-5;
J = 2000;
S = 1;
% e = electron charge
e = 1.602E-19;
% c = speed of light
c = 3E8;
[T,Y]= ode45(@(t,y)rate_eq(t,y,tp,n0,L,Rsp,S,Ng,d,g,b,J,c,e),tspan,y0);
plot(T,Y(:,1),'-',T,Y(:,2),'.');
title('plot of carrier and photon densities');
xlabel('time');
ylabel('densities');
function df = rate_eq(t,y,tp,n0,L,Rsp,S,Ng,d,g,b,J,c,e)
% rate equation for carrier density
% Carriers
df(1,1) = (J/(e * d)) - (Rsp/n0) - ((c*L*g*S)/(Ng));
% Photons
df(2,1) = ((c*L*g*S)/(Ng)) - (S/tp) + (b*Rsp);
end
Best wishes
Torsten.
댓글 수: 2
Razia Sultana
2022년 5월 19일
ti = 0;
tf = 10;
tspan=[ti tf];
y0=[0; 1];
% tp = photon lifetime
tp = 1E-12;
% n0 = internal efficiency
n0 = 1E-18;
% a = linewidth broadening factor
a = 2.5E-16;
% L = optical confinement factor
L = 0.3;
% te = electron lifetime
te = 1E-19;
% Rsp = recombination rate
Rsp = ((n0 *1E-18)/te);
% Ng = group refractive index
Ng = 4;
% d = active layer thickness
d = 3E-7;
% g = optical gain
g = 3.16E-12;
b = 2E-5;
J = 2000;
S = 1;
% e = electron charge
e = 1.602E-19;
% c = speed of light
c = 3E8;
[T,Y]= ode45(@(t,y)rate_eq(t,y,tp,n0,L,Rsp,S,Ng,d,g,b,J,c,e),tspan,y0);
plot(T,Y(:,1),'-',T,Y(:,2),'.');
title('plot of carrier and photon densities');
xlabel('time');
ylabel('densities');
function df = rate_eq(t,y,tp,n0,L,Rsp,S,Ng,d,g,b,J,c,e)
% this function is not working, showing errors....
%help me out
% rate equation for carrier density
% Carriers
df(1,1) = (J/(e * d)) - (Rsp/n0) - ((c*L*g*S)/(Ng));
% Photons
df(2,1) = ((c*L*g*S)/(Ng)) - (S/tp) + (b*Rsp);
end
Susrutanarayan Chaudhury
2020년 10월 5일
Actually i am unable to solve a coupled laser rate eq in matlab. I am giving these two rate eq and corresponding parameters.
dy/dt=a-y*(x+1+d)...(1)
dx/dt=s+g*x*(y-alpha)....(2)
where x,y the photon intensity and population inversion respectively. The alpha is the modulated loss which is equal toalpha0*(1+m*sin(2*pi*f*t)), where alpha0 is my off set value which I kept 0.2. and 'm' is my modulation index which i kept 0.001. So I have to modulated the loss inside the cavity sinusoidally .
Other parameters are g=1.2E5,
s=5.65;
d=0.3;
a=23.37;
Can any one please help me to solve it in matlab??
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Atomic, Molecular & Optical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!