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!