
function xprime = noRWA(t,x);
global LS OmegaR OmegaRp Omega omega A1h % A21

% Computes the derivatives involved in solving the two-level system without RWA.
%xprime=[i*OmegaR*cos(omega*t)*exp(-i*Omega*t)*x(2)-(A1h/2)*x(1); i*OmegaR*cos(omega*t)*exp(i*Omega*t)*x(1)];
%xprime=[i*OmegaR*cos(omega*t)*exp(-i*Omega*t)*x(2)-(A1h/2)*x(1)+(A21/2)*x(2); i*OmegaR*cos(omega*t)*exp(i*Omega*t)*x(1)-(A21/2)*x(2)];
if LS==2
xprime=[i*OmegaR*cos(omega*t)*exp(-i*Omega*t)*x(2)-(A1h/2)*x(1); i*OmegaR*cos(omega*t)*exp(i*Omega*t)*x(1)];
elseif LS==3
xprime=[i*OmegaR*cos(omega*t)*exp(-i*Omega*t)*x(2)-(A1h/2)*x(1); i*OmegaR*cos(omega*t)*exp(i*Omega*t)*x(1)+i*OmegaRp*cos(omega*t)*exp(-i*Omega*t)*x(3);i*OmegaRp*cos(omega*t)*exp(i*Omega*t)*x(2)];
end   
%xprime=[i*OmegaR*cos(omega*t)*exp(-i*Omega*t)*x(2)-(A1h/2)*x(1)+(A21/2)*abs(x(2)); i*OmegaR*cos(omega*t)*exp(i*Omega*t)*x(1)-(A21/2)*abs(x(2))];
% The terms with A1h refer to Spontaneous Emission 
% from level 1 to level h (help level below level 1). A1h is the relevant Einstein coefficient.  
% The terms with A21 refer to Spontaneous Emission 
% from level 2 to level 1. A21 is the relevant Einstein coefficient. 

