% Fig_3_9.m 
% 
%plotting parameters + fontsizes
clear all;
clf;

FS      = 18;	%label fontsize 18
FSN     = 16;	%number fontsize 16
LW      = 2;	%linewidth

% Change default axes fonts.
set(0,'DefaultAxesFontName', 'Times New Roman')
set(0,'DefaultAxesFontSize', FSN)

% Change default text fonts.
set(0,'DefaultTextFontname', 'Times New Roman')
set(0,'DefaultTextFontSize', FSN)

%%%%%%%%%%%%%%%% input parameters data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
eye=complex(0.0,1.0);   %square root of minus one
npoints=600;
tmax=40;
gamma=0.1;              %gamma^2 < omega1 for oscillatory motion
gamma2=gamma^2;
omega1=1;
omega2=eye*(-gamma+sqrt(gamma2-omega1));

t=linspace(0,tmax,npoints);

u1=(real((exp(-gamma.*t).*cos(eye*sqrt(gamma2-omega1).*t))));
u2=(real((exp(-gamma.*t).*sin(eye*sqrt(gamma2-omega1).*t))));
u11=real(exp(-eye*omega1.*t));
u22=real(exp(-eye*omega1.*t));

ttl=['\omega_2/\omega_1 = ',num2str(omega2/omega1)];

%Plot figure
figure(1)
plot(t,u1+u11,'b','LineWidth',LW);
%grid on
hold on
plot(t,u2+u22,'r','LineWidth',LW);
title(ttl,'FontSize',FS);
axis([0,tmax, -2.1, 2.1]);
xlabel('Time, \it{t}\rm','FontSize',FS);
ylabel('\it{u}\rm_1(\it{t}\rm) (blue), \it{u}\rm_2(\it{t}\rm) (red)',...
    'FontSize',FS);



