% Fig_3_7.m 
% 
clear all;
clf;
%plotting parameters + fontsizes
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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
npoints=600;    %number of points in plot
tmax=100;
omega1=1;
omega2=1.1;
omegap=omega1+omega2;
omegam=omega1-omega2;
t=linspace(0,tmax,npoints);

u1=cos(omegap.*t).*cos(omegam.*t);
u2=sin(omegap.*t).*sin(omegam.*t);

ttl=['\omega_2/\omega_1 = ',num2str(omega2/omega1)];
%Plot 
figure(1)
subplot(2,1,1);plot(t,u1,'b','LineWidth',LW);
axis([0,tmax, -1.1, 1.1]);
%title(ttl,'FontSize',FS);
ylabel('\it{u}\rm_1(\it{t}\rm)','FontSize',FS);
subplot(2,1,2);plot(t,u2,'r','LineWidth',LW);
axis([0,tmax, -1.1, 1.1]);
xlabel('Time, \it{t}\rm','FontSize',FS);
ylabel('\it{u}\rm_2(\it{t}\rm)','FontSize',FS);





