%Waveform Frequency (Hz)
F = 2;
%Transmission line length (m)
L = 1;
%Speed of travel (m/s)
v = 1;
%Amplitude (peak-Volts)
A = 1;
%Transmission line
x = [0:0.01:L];
%Wavelength
wavelength = 1/F;
%Angular frequency
angfreq = 2*pi*F;
%Time value
t = 1;
%Phase constant
phasecont = 2*pi/wavelength;
%Source wavefrom formula
ysrc = A.*sin(phasecont.*x-angfreq.*t);
%Reflected waveform formula
yref = A.*sin(phasecont.*(L-x)-angfreq.*t);
%Summation waveform formula
ysum = ysrc+yref;
%Plot the waveforms
figure()
subplot(211)
plot (x,ysrc)
xlabel('Length along line (m)')
ylabel('Amplitude (V)')
title('Source and reflected wave')
hold on
plot (x,yref)
grid minor
legend('source', 'reference')
subplot(212)
plot (x,ysum)
xlabel('Length along line (m)')
ylabel('Amplitude (V)')
title('Summation of each point along the x axis')
axis([0 1 -1 1])%Set x,y axis
grid minor
by Duane Benson
by Aaron Carman
by Duane Benson
by Jake Hertz