% Lossy Medium is a general case of mediums for propagation of waves
% In the progrm below Specify the values of attenuation constant,phase constant, permeability
% permittivity, intensities of electric & magnetic fields e.t.c according
% to requirements.
t=0:0.001:10;                           % Time for analysis
z=0:0.0005:5;                           % Range of Space under analysis
eta=377;                                % Intrinsic Impedance of medium
theta=pi/2;                             % 0.5*tan(conductivity/w*e)^-1:----angle of intrinsic impedance
E0=50;                                  % Electric Field intensity
a=0;                                    % Attenuation Constant
u=1.256*(10.^-6);                       % Permeabilty of medium
e=8.854*(10.^-12);                      % Permittivity of medium
f=600000000;                            % Frquency of EM Wave
w=2*pi*f;                   
b=w*((u*e).^0.5);                       % Phase Constant
E=E0/eta;                               % Magnetic Field Intensity H0
H=E*exp(-a*z).*cos(w*t-b*z-theta);      %Magnetic Field as a Function of space and time
Ez=E0*exp(-a*z).*cos(w*t-b*z);          %Electric Field as a function of space and time
figure(1);
subplot(211),plot(z,H,'r');
xlabel('Dispalcement(metres)');
ylabel('Magnetic Field Intensity(H)');
title('Plane wave propagation in Lossy medium');
subplot(212),plot(z,Ez,'g');
xlabel('Dispalcement(metres)');
ylabel('Electric Field Intensity(H)');
title('Plane wave propagation in Lossy medium');
