function sol1Dwave_main(c1,c2)
% main program where all the functions precomputed are called for ploting
% the function it has two inputs: c1 and c2 the two different speeds of...
% ...propagation required in the exam
x=linspace(-100,100,400);
%discretization of space variable
d=1;
%as required in the exam, d=a=1
t1=[d/(2*c1),d/c1,3*d/(2*c1),2*d/c1,5*d/c1];
% as required in the exam, fix 5 time snapshots to plot a solution
t2=linspace(0,5,20);
% anothe time vector spanning the interval 0,5 with 20 points
u = sol1Dwave(c1,t1,x);
%computes the solution of the 1D wave equation in the exam for c1 ...
%...on the five time snapshots stored in t1 
v1 = sol1Dwave(c1,t2,x);
% computes the solution for propagation speed c1 and time points in t2
v2 = sol1Dwave(c2,t2,x);
%computes the solution for propagation speed c2 and time points in t2

figure(1)
% first figure with 5 subplots of the solution profile ...
%...one below the other for the five different time snapshots ...
% specified in t1
subplot(5,1,1)
%try help subplot on matlab to better understand the comand sintax
plot(x,u(1,:))
% plots the solution u(t1(1),x) versus x where t1 and x are ...
% ... specified above
xlim([-10*d 10*d]) % fix x-axis limits 
ylim([0,5])  % fix y axis limits
title('Plot at t=1/(2*c)') % assigns a title to the first subplot
subplot(5,1,2)
plot(x,u(2,:))
% plots the solution u(t1(2),x) versus x where t1 and x are ...
% ... specified above
xlim([-10*d 10*d])
ylim([0,5])
title('Plot at t=1/c')
subplot(5,1,3)
plot(x,u(3,:))
% plots the solution u(t1(3),x) versus x where t1 and x are ...
% ... specified above
xlim([-10*d 10*d])
ylim([0,5]);
title('Plot at t=3/(2*c)')
subplot(5,1,4)
plot(x,u(4,:))
% plots the solution u(t1(4),x) versus x where t1 and x are ...
% ... specified above
xlim([-10*d 10*d])
ylim([0,5]);
title('Plot at t=2/c')
subplot(5,1,5)
plot(x,u(5,:))
% plots the solution u(t1(5),x) versus x where t1 and x are ...
% ... specified above
xlim([-10*d 10*d])
ylim([0,5]);
title('Plot at t=5/c')

figure(2)
%second figure which plots the tw surface plots of the solution stored... 
% ... in v1 and repectively v2 versus time and space for the ...
% two different respective speed c1 and c2
subplot(1,2,1)
surf(x,t2,v1)
% surface plot of the solution for speed c1. Try help surf in matlab to...
% ...better understand the comand syntax
subplot(1,2,2)
surf(x,t2,v2)
% surface plot of the solution for speed c2. 