0% found this document useful (0 votes)
145 views

Emt Matlab Report

This document describes a computational assignment to generate electromagnetic waves in a conducting medium using MATLAB. The student provides the equations that govern EM wave behavior and defines the attenuation constant, phase constant, and wave impedance. The MATLAB code asks the user to input these values then plots the electric and magnetic field equations to generate an attenuated EM wave traveling through the conducting medium. When run, the code produces figures of the input prompts and the resulting EM wave.

Uploaded by

Abdul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
145 views

Emt Matlab Report

This document describes a computational assignment to generate electromagnetic waves in a conducting medium using MATLAB. The student provides the equations that govern EM wave behavior and defines the attenuation constant, phase constant, and wave impedance. The MATLAB code asks the user to input these values then plots the electric and magnetic field equations to generate an attenuated EM wave traveling through the conducting medium. When run, the code produces figures of the input prompts and the resulting EM wave.

Uploaded by

Abdul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Computational assignment

Electro-Magnetic Theory

Submitted by:
Raja Abdul Wasay Minhas
Roll no:
BS-EE-53220 (34)
Date:
26-12-2018
Submitted to:
Dr. Aftab Ahmed Khattak
Task:
Task assigned is to generate E.M waves in conducting media

Solution:
In order to develop the Mat lab code, we first look at the equation that basically govern the behavior
of the electric and the magnetic field as they travel through a medium at orthogonal angles, also
known as the propagation of E.M waves.

Figure 1.1 equations governing the behavior of EM waves

The relations for the phase constant and the attenuation constant are given below:

And the relation for the wave impedance is given on the next page:
Code:
The code simply asks the user to input attenuation constant, phase constant and wave
impedance and then uses the data to plot an E.M wave by putting the data in the formulas for
both the electric field and the magnetic field respectively.

The code first asks the user to input attenuation constant, phase constant and wave impedance

answer = inputdlg('Enter value of attenuation constant:',...


'Input', [1 40]);
alpha = str2double(answer{1});

answer1 = inputdlg('Enter value of phase constant:',...


'Input', [1 40]);
beta = str2double(answer1{1});
answer2 = inputdlg('Enter value of wave impedance:',...
'Input', [1 40]);
eta= str2double(answer2{1});

the code then defines the axes and forms the equations for the electric field and the magnetic
field by using the above mentioned data

x = linspace(5,10,100);
y = linspace(5,10,100);
z = linspace(5,10,100);
[X, Y, Z] = meshgrid(x, y, z);
Ex = exp(alpha*Z).*sin(2*pi-beta*Z);
Ey = 0*X;
Ez = 0*X;
Bx = 0*X;
By = 1/eta.*exp(alpha*Z).*sin(2*pi-beta*Z);
Bz = 0*X;

Eplot = 0*x;
Bplot = 0*x;
The last part of the code plots the above mentioned equation and results in the formation of an E.M
wave.

for i=1:100 %% Integration-like procedure


Eplot(i) = mean(mean(Ex(:,:,i),1),2);
Bplot(i) = mean(mean(By(:,:,i),1),2);
end

plot3(0*x, y, Eplot, 'b', 'LineWidth', 2); hold on


h = quiver3(0*x(1:3:100), y(1:3:100), 0*z(1:3:100), 0*x(1:3:100),
0*y(1:3:100), Eplot(1:3:100), 0, 'b', 'LineWidth', 1);
set (h, 'maxheadsize', 0.0);

plot3(Bplot, y, 0*z, 'g', 'LineWidth', 2);


h = quiver3(0*x(1:3:100), y(1:3:100), 0*z(1:3:100), Bplot(1:3:100),
0*y(1:3:100), 0*z(1:3:100), 0, 'g', 'LineWidth', 1);
set (h, 'maxheadsize', 0.0);
grid on, axis square

title('Transverse Electromagnetic Waves in Conducting Medium')

results:
when the code is run the following results are obtained

Figure 1.2 the code asks to input value of attenuation constant


Figure 1.3 the code asks to input value of phase constant

Figure 1.4 the code asks to input value of phase constant

The EM wave generated by the code is shown on the next page we can see the attenuation in the
magnetic and the electric field intensity as the wave travels through the conducting medium if the
medium was free space then attenuation constant would have a value of zero hence no attenuation
would be observed.
Figure 1.5 output

You might also like