% Book: Laser Electronics by Verdeyen
% Problem: Chapter 7 problem 10
% Script Author: meg noah meg_noah@student.uml.edu
function Lasers_Ch7_Pr10
t=0:0.1:10.0;Tau1=2;Tau2=1;P2=10^20;
N2 = Tau2*P2*(1.0-exp(-t./Tau2));
N1 = Tau1*P2*(1.0+...
    (Tau1/Tau2)*(exp(-t./Tau1))/(1-Tau1/Tau2)...
    -(exp(-t./Tau2))/(1-Tau1/Tau2));
plot(t,N1,'b'),grid on;hold on;
plot(t,N2,'r'),grid on;hold on;
ylabel('Population [cm^-^3]');
xlabel('Time [\mus]');
Legend(['N1 \tau1=2';'N2 \tau2=1']);