%Exercise for Section 4.4, critically damped harmonic motion
% x'' + 6*x' + 9*x=0
% with solution y(t)=c1*exp((-3-2*sqrt(5))*t) + c2*exp((-3=2*sqrt(5))*t) 
% The damping constant is c=6/2=3, 
% the natural frequency omega0=sqrt(9)=3.
% The constants depending on the initial conditions
c1=1;c2=2;

t = linspace(0,5,50);
y = c1*exp(-3*t) + c2*t.*exp(-3*t) ;
Amplitude=norm([c1 c2]);

figure(3)
hold all
plot(t,y,'-r')
title('Critically damped harmonic motion c=\omega_0=3')
legend('y(t)')