
function attenuation

% Plots E-field as function of depth and illustrates
% skin depth effect.

clear all
close all

mu = 4*pi*0.0000001
sigma = 0.1
omega = 2*pi*1


% Set up array of depths
iz=0
for zdum =1:20:8000;
   iz=iz+1;
   z(iz) = zdum;
end
nz = length(z)


k = (1-j)*sqrt((mu*sigma*omega)/2)
  for iz=1:nz 
    ex(iz) = exp(-k*z(iz));
    realex(iz) = real(ex(iz));
    imagex(iz) = imag(ex(iz));
  end
  

plot(realex,-z*0.001)
hold on
plot(imagex,-z*0.001,'--')
title('1 Hz signal :  10 ohm.m earth')
xlabel ('E_x / E_x^o')
ylabel ('depth (km)')

print -dpsc  attenuation_1Hz.ps