clear
clc

%==================
%===== Wave I =====
%==================
Amplitude=3;

% WaveNumber (Wavelength=1.5708)
X=-10:1/100:10;
WaveNumber1=4;

% Angular Frequency (Period=1.5708)
Time=-10:1/100:10;
AngularFrequency1=4;

for Time=1:10
    
Wave1(Time,1:length(X))=Amplitude.*sin((WaveNumber1.*X)-(AngularFrequency1.*Time));

end

figure(1);
PropagationParameter=[1:1:Time];
PropagationEvolution=Wave1(PropagationParameter,:);
mesh(X,PropagationParameter,PropagationEvolution);
h1=mesh(X,PropagationParameter,PropagationEvolution);
%set(h,'EdgeColor',[0 0 0]);
set(h1,'MeshStyle','row');
title('The First Wave [k=4, ù=4]');
xlabel('Distance');
ylabel('Time');
zlabel('Amplitude');
hidden off

%===================
%===== Wave II =====
%===================
% WaveNumber (Wavelength=1.5708)
WaveNumber2=5;

% Angular Frequency (Period=1.5708)
AngularFrequency2=5;

for Time=1:10
    
Wave2(Time,1:length(X))=Amplitude.*sin((WaveNumber2.*X)-(AngularFrequency2.*Time));

end

figure(2);
PropagationParameter=[1:1:Time];
PropagationEvolution=Wave2(PropagationParameter,:);
mesh(X,PropagationParameter,PropagationEvolution);
h2=mesh(X,PropagationParameter,PropagationEvolution);
%set(h,'EdgeColor',[0 0 0]);
set(h2,'MeshStyle','row');
title('The Second Wave [k=5, ù=5]');
xlabel('Distance');
ylabel('Time');
zlabel('Amplitude');
hidden off

%===============================================
%===== The SUM of The Two Travelling Waves =====
%===============================================

SUMTravellingWave=Wave1+Wave2;

figure(3);
PropagationParameter=[1:1:Time];
PropagationEvolution=SUMTravellingWave(PropagationParameter,:);
mesh(X,PropagationParameter,PropagationEvolution);
h3=mesh(X,PropagationParameter,PropagationEvolution);
%set(h,'EdgeColor',[0 0 0]);
set(h3,'MeshStyle','row');
title('The Sum of the Two Travelling Waves');
xlabel('Distance');
ylabel('Time');
zlabel('Amplitude');
hidden off







