% example script for Problem 1.8 in Ulaby % which is problem on 4 on Problem Set 1 of 518 in 2012. % Brian Hornbuckle, January 16, 2012. clear all; close all; % let's visualize the wave % easiest perhaps to do this first by looking how the wave behaves in space % at a certain time alpha = 1; % attenuation constant, Np (I just made up this value in order to visualize the wave) f = 1e9; % frequency, Hz T = 1/f; % period, s lambda = 0.2; % wavelength, m omega = 2*pi*f; % radial frequency, rad/s beta = 2*pi/lambda; % wavenumber, rad/m t = 2.5; % what does the wave look like at t = 2.5 s? z = linspace(0,10*lambda,1001); % space coordinate, m v = 3.*exp(-alpha.*z).*sin(omega.*t - beta.*z); % voltage of wave, V % note carefully how I have used * vs .* figure(1) subplot(1,2,1) plot(z,v,'m-'); xlabel('space, m'); ylabel('voltage, V'); grid on; legend(['using \alpha = ',num2str(alpha),' Np']); % so the amplitude of the wave decreases in space, like we discussed in class % now let's solve the problem, % look at how the wave behaves in time at a certain point in space z = 2; % position, m t = linspace(0,6*T,1001); % let's look at, say, six periods of this wave v = 3.*exp(-alpha.*z).*sin(omega.*t - beta.*z); % voltage of wave, V subplot(1,2,2) plot(t,v,'m-'); legend(['z = ',num2str(z),' m']); xlabel('time, s'); ylabel('voltage, V'); grid on; % what does alpha need to be so that the amplitude at z = 2 m is equal to 1 V? % right now with alpha = 1 the amplitude is about 0.4 V