1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Laser rate equation using ode45

  1. Jun 16, 2014 #1
    I've attached the problem that I'm trying to solve. I've also done the manual calculations to calculate Ithreshold. I'm not very good with matlab and I need matlab code for laser rate equations and I also need to plot LI characteristic of the laser.

    I_th=qV/(η_i τ) N_th=qV/(η_i τ) (N_tr+(α_i+1/2L ln⁡〖1/(R_1 R_2 )〗)/Γa)=76.73mA

    P_out=(η_i (I-I_th)〖⋅V〗_p⋅hν⋅α_m⋅v_g)/(qVν_g a(N_th-N_tr )-〖εη〗_i (I-I_th)).

    Please help me out with the code using ode45. All your help is much appreciated.


    Attached Files:

  2. jcsd
  3. Jun 16, 2014 #2
    function dy = rate_equation(t,y)
    dy = zeros(2,1);
    Lambda= 1.55*10^-6;
    q= 1.602*10^-19;
    V= 1.75*10^16;
    a= 0.5*10^-20;
    E= 1*10^-22;
    Tau= 2.1*10^-9;
    Ntr= 1*10^24;
    Gamma= 0.3;
    B= 1*10^-16;
    Alphai= 3000;
    Bsp= 1*10^-4;
    ng= 3.7;
    R2= 0.32;
    L= 350*10^-6;
    Alpham = (1/(2*L))*log(1/(R1*R2));
    vg = (3*10^8/1.55*10^-6);
    Taup = 1/(vg*(Alphai+Alpham));
    I= 76.73e-3;

    dy(1)=(ni*I)/q*V-y(1)/Tau- vg*a*((y(1)-Ntr)/(1+E*y(2)))*y(2);
    dy(2) = Gamma*vg*a*((y(1)-Ntr)/(1+E*y(2)))*y(2)+Bsp*Gamma*Rsp-(y(2)/Taup);
    is the function I wrote and when I use [T,Y] = ode45(@rate_equation,[0 10],[0 0]) the command window becomes non responsive. Please help me.
  4. Jun 16, 2014 #3
    clear all
    close all

    options = odeset('RelTol',1e-4,'AbsTol',[1e-4 1e-4 1e-5]);
    [T,Y] = ode45(@rate_equation,[0 10],[0 0], options);
    title('carriers density in high laser level')
    hold on;
    When I run this I get the following errors

    ??? Undefined function or method 'd' for input arguments of type 'char'.

    Error in ==> rate_equation at 25
    d y(1)=(ni*I)/q*V-y(1)/Tau- vg*a*((y(1)-Ntr)/(1+E*y(2)))*y(2);

    Error in ==> odearguments at 109
    f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.

    Error in ==> ode45 at 173
    [neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...

    Error in ==> laser at 5
    [T,Y] = ode45(@rate_equation,[0 10],[0 0], options);

Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted