clear all; 



tauL = 2.5e-6;

tauP = 0.1e-6;

r = linspace(1,50);

dr = -r/(2*tauL); % Damping rate

wr = sqrt((r-1)/(tauL*tauP)-(r/(2*tauL)).^2); % Relaxation freq [s^-1]

sp = dr+j*wr;

sm = dr-j*wr;



subplot(211); 

plot(r,-dr);

grid on;

xlabel('Pump parameter, r');

ylabel('Damping rate [s^{-1}]: -Re(s_{\pm})');

xlim([min(r) max(r)]);

title('6.638: Problem 5.1b');



subplot(212);

fr = wr/(2*pi)/1e3;

plot(r,fr);

grid on;

xlabel('Pump parameter, r');

ylabel('Relaxation osc. freq [kHz]: Im(s_{\pm})');

xlim([min(r) max(r)]);