
function xprime = laser(t,x);
global tau1 tau0 arn AptoA
%LASER: Computes the derivatives involved in solving the laser equations.
% nu1=x(1), nu2=x(2), rho=x(3)
tau1=0.5; 
tau0=10;
arn=2; % normalized pumping 
AptoA=10^(-5);
tautau=tau0*(1-tau1);
xprime=[x(2)+x(3)*(x(2)-x(1))-x(1)/tau1; arn+x(3)*(x(1)-x(2))-x(2);-x(3)/tau0+(AptoA*x(2)+x(3)*(x(2)-x(1)))*(1/tautau)];

% Observe that x is stored as x(1), y is stored as x(2), and z as stored as x(3). 
% Additionally, xprime is a column vector, 
% as is evident from the semicolon following the first appearance of x(2). 
% If in the Command Window, we type
% >> x0=[-8 8 27];
% >> tspan=[0,20];
% >> [t,x]=ode45(@lorenz,tspan,x0)


