You are on page 1of 18

LAB THREE (3) REPORT

The Papua New Guinea

EE211 Electromagnetic
Field Theory

LAB REPORT 3

Jr David PERA 22300625


Electrical & Com. Engineering
BEEL/2
By Dr. Hikma SHABANI
2023
22nd of
May May
22, 2023 1
LAB THREE (3) REPORT

INTRODUCTION

Electromagnetic Field is produced by the interaction of time varying electric and


magnetic fields. Maxwell's equations are a set of coupled partial differential equations
that, together with the Lorentz force law, form the foundation of classical
electromagnetism, classical optics, and electric circuits. The equations provide a
mathematical model for electric, optical, and radio technologies, such as power
generation, electric motors, wireless communication, lenses, radar, etc. They describe
how electric and magnetic fields are generated by charges, currents, and changes of
the electric and magnetic fields.

The objective of this lab was to model and calculate the magnetic field generated
by a finite sheet of surface current density using MATLAB. In this laboratory, we write
a MATLAB program to calculate the magnetic field ‘H’ at a given point and plot this
magnetic field in the ‘x’-‘y’ plane in the pre-defined region. The sheet was assumed to
be infinitely thin and have a uniform current density across its surface. The magnetic
field was calculated at various points in space, both on and off the sheet, by summing
up the contributions from small current elements on the sheet. The calculations were
performed numerically using a finite number of subdivisions in both the ‘x’ and ‘y’
directions of the sheet.

The main focus of this lab was to gain an understanding of how to model and
calculate the magnetic field produced by surface currents using MATLAB. The
calculations were based on the, which relates the magnetic field at a point in space to
the current flowing through an element of conductor at that point. By applying this
law to each small element of the sheet, the total magnetic field at any point in space
could be determined.

This lab report presents the methodology and results of the calculations
performed, including the visual representation of the magnetic field using quiver plots.
The report also includes a discussion of the accuracy and limitations of the model
used, as well as potential areas for further exploration and improvement.

May 22, 2023 2


LAB THREE (3) REPORT

METHOD/MATERIALS
In this experiment, we aimed to calculate and visualize the Magnetic Field
generated by a current sheet using MATLAB. The code utilized the Biot-Savart law to
determine the magnetic field at various observation points in the vicinity of the
current sheet. The code that was implemented in the stimulation of this MATLAB
report and further step-by-step that simplify the code by explaining the coding
language, also the material, and methods used for the MATLAB simulation of the
Magnetic Field are described below:

❖ Material:
• MATLAB software (Online)
• MATLAB Code:

>> clc; %clear the command window clear; %clear all variables d=0.30; %the width of the sheet in the x direction L=20; %length of
sheet in the y direction J=5; %value of surface current density Js=J*[0 1 0]; %the vector of surface current density Xmin=-0.15;
%coordinate of lowest x value on sheet Xmax=0.15; %coordinate of maximum x value on sheet Ymin=-10; %coordinate of lowest y
value on sheet Ymax=10; %coordinate of maximum y value on sheet NumberOfXDivisions=20; %number of cells in the x direction
NumberOfYDivisions=100; %number of cells in the y direction dx=(Xmax-Xmin)/NumberOfXDivisions; %step in the x direction
dy=(Ymax-Ymin)/NumberOfYDivisions; %step in the y direction ds=dx*dy; %area of one subsection of sheet ZCellCenter=0; %all points
on sheet has a coordinate z=0 NumberOfXPlottingPoints=10; %number of plotting points along the x axis
NumberOfZPlottingPoints=10; %number of plotting points along the z axis PlotXmin=-0.5; %lowest x value on the plot plane
PlotXmax=0.5; %maximum x value on the plot plane PlotZmin=-0.5; %lowest z value on the plot plane PlotZmax=0.5; %maximum z
value on the plot plane PlotStepX= (PlotXmax-PlotXmin)/(NumberOfXPlottingPoints-1);%plotting step in the x direction
PlotStepZ=(PlotZmax-PlotZmin)/(NumberOfZPlottingPoints-1); %plotting step in the z direction
[XData,ZData]=meshgrid(PlotXmin:PlotStepX:PlotXmax, PlotZmin:PlotStepZ:PlotZmax); %build arrays of plot plane PlotY=0; %all points
on observation plane have zero y coordinate Bx=zeros(NumberOfXPlottingPoints,NumberOfZPlottingPoints); %x component of field
Bz=zeros(NumberOfXPlottingPoints, NumberOfZPlottingPoints);%z component of field for m=1:NumberOfXPlottingPoints %repeat for
all plot points in the x direction for n=1:NumberOfZPlottingPoints %repeat for all plot points in the y direction PlotX=XData(m,n); %x
coordinate of current plot point PlotZ=ZData(m,n); %z coordinate of current plot point if ((PlotZ==0)&(PlotX>=Xmin)&(PlotX<=Xmax))
% if the plotting point is on the current sheet Bx(m,n)=0.5*J; % we use the model of infinite current sheet Bz(m,n)=0; continue; end
Rp=[PlotX PlotY PlotZ]; %poistion vector of observation points for i=1:NumberOfXDivisions %repeat for all divisions in the x direction
for j=1:NumberOfYDivisions %repeat for all cells in the y direction XCellCenter=Xmin+(i-1)*dx+0.5*dx; %X center of current subsection
YCellCenter=Ymin+(j-1)*dy+0.5*dy; %Y center current subsection Rc=[XCellCenter YCellCenter ZCellCenter]; %position vector of
center of current subsection R=Rp-Rc; %vector pointing from current subsection to the current observation point norm_R=norm(R);
%get the distance between the current surface element and the observation point R_Hat=R/norm_R; %unit vector in the direction of
R dH=(ds/(4*pi*norm_R*norm_R))*cross(Js,R_Hat); %this is the contribution from current element Bx(m,n)=Bx(m,n)+dH(1,1);
%increment the x component at the current observation point Bz(m,n)=Bz(m,n)+dH(1,3); %increment the z component at the current
observation point end %end of j loop end %end of i loop end %end of n loop end % end of m loop quiver(XData, ZData, Bx, Bz);
xlabel('x(m)');%label x axis ylabel('z(m)');%label y axis %The following routing caculates the magnetic field at point P P=[0 0
0.25];%position of point P Hp=[0 0 0];%the magnetic field at point P for i=1:NumberOfXDivisions %repeat for all divisions in the x
direction for j=1:NumberOfYDivisions %repeat for all cells in the y direction XCellCenter=Xmin+(i-1)*dx+0.5*dx; %X center of current
subsection YCellCenter=Ymin+(j-1)*dy+0.5*dy; %Y center current subsection Rc=[XCellCenter YCellCenter ZCellCenter]; %position
vector of center of current subsection R=P-Rc; %vector pointing from current subsection to the current observation point
norm_R=norm(R); %get the distance between the current surface element and the observation point R_Hat=R/norm_R; %unit vector
in the direction of R dH=(ds/(4*pi*norm_R*norm_R))*cross(Js,R_Hat); %this is the contribution from current element Hp=Hp+dH; end
%end of j loop end %end of i loop

May 22, 2023 3


LAB THREE (3) REPORT

❖ Methods:

First, the necessary parameters were defined. These included the width (d)
and length (L) of the sheet, the surface current density (J), and the coordinates and
divisions of the sheet. Additionally, parameters related to the plotting of the
magnetic field were set, such as the number of plotting points along the x and z
axes.

• The MATLAB code followed the following steps:

1. Clearing the command window and removing any existing variables using
the ‘clc’ and ‘clear’ commands, respectively.

2. Initializing the parameters mentioned above, including the sheet


dimensions, surface current density, and coordinates of the sheet
boundaries.

3. Creating a meshgrid of plotting points on a plane defined by the specified


plotting parameters. This meshgrid was used to generate the x and z
coordinates of the observation points.

4. Initializing the matrices ‘Bx’ and ‘Bz’ as zero matrices. These matrices would
store the x and z components of the magnetic field at each observation
point.

5. Using nested loops, the code calculated the magnetic field components at
each observation point. For points lying on the current sheet, a simplified
model for an infinite current sheet was used to calculate the magnetic field
components (‘Bx’ and ‘Bz’).

6. For points not on the sheet, the code entered another set of nested loops
to calculate the magnetic field contribution from each current element. It
computed the position vector of the observation point and the position
vector of the center of each subsection of the sheet. Subsequently, it
determined the distance between the current element and the observation

May 22, 2023 4


LAB THREE (3) REPORT

point and calculated the unit vector pointing from the current element to
the observation point.

7. Utilizing the Biot-Savart law, the code computed the contribution to the
magnetic field at the observation point due to the current element. This
contribution was added to the respective components of the magnetic field
(‘Bx’ and ‘Bz’) at the observation point.

8. After the nested loops, the code generated a quiver plot to visualize the
magnetic field. The plot utilized the x and z coordinates of the observation
points and the corresponding components of the magnetic field (‘Bx’ and
‘Bz’).

9. Finally, the code calculated the magnetic field at a specific point (‘P’) by
summing up the contributions from each current element. It employed a
similar set of nested loops as before but used the point ‘P’ as the
observation point. The resulting magnetic field at ‘P’ was stored in the
variable ‘Hp’.

By executing the MATLAB code, we were able to obtain numerical results for
the magnetic field components at various observation points and visually
represent the magnetic field using quiver plots.

May 22, 2023 5


LAB THREE (3) REPORT

RESULTS
The MATLAB code was executed to calculate and visualize the magnetic field
generated by a current sheet. The results obtained provide insights into the
characteristics of the magnetic field.

By running the code, we obtained numerical values for the ‘x’ and ‘z’
components of the magnetic field (‘Bx’ and ‘Bz’) at various observation points
surrounding the current sheet. These components were then used to generate quiver
plots, which visually represented the direction and magnitude of the magnetic field at
each point.

Figure 01: quiver plot of the magnetic field.

❖ The quiver plots revealed the following key observations:

• Field Distribution around the Current Sheet: The magnetic field lines
exhibited a pattern consistent with the expected behavior around a
current-carrying conductor. They formed closed loops surrounding the
current sheet, indicating a circular magnetic field pattern around the
conductor.

May 22, 2023 6


LAB THREE (3) REPORT

• Field Strength Variation: The magnitude of the magnetic field varied as we


moved away from the current sheet. The field strength was highest near
the surface of the sheet and decreased as we moved further away.
• Symmetry and Direction of Field Lines: The quiver plots demonstrated that
the magnetic field lines were symmetric with respect to the centreline of
the current sheet. They pointed in a direction tangent to the circular loops
surrounding the sheet, following the right-hand rule convention.
• Effect of Observation Point Position: The magnetic field strength and
direction varied at different observation points. Points closer to the current
sheet experienced stronger magnetic fields, while points further away
exhibited weaker fields. Additionally, the direction of the field vectors
changed as we moved around the current sheet.

Figure 02: when increasing the breadth of the conductor from 0.15 – 0.5.

❖ When increasing the breadth (width) of the conductor in the current sheet,
the magnetic field generated by the sheet will also change. Here's what you
can expect to happen:

1. Increase in Magnetic Field Strength: As you increase the breadth of the


conductor, the total current passing through the sheet increases, assuming the
current density remains constant. According to Ampere's law, the magnetic

May 22, 2023 7


LAB THREE (3) REPORT

field strength is directly proportional to the current. Therefore, increasing the


breadth of the conductor will result in a stronger magnetic field.
2. Increase in Magnetic Field Coverage: A wider conductor means that the
magnetic field generated by the current sheet will cover a larger area around it.
The magnetic field lines will extend further away from the sheet and have a
greater influence on points located farther from the conductor.
3. Change in Magnetic Field Distribution: The distribution of the magnetic field
around the conductor may also change. With a wider conductor, the magnetic
field near the center of the sheet may become more uniform and symmetric.
However, the edges of the sheet might still exhibit variations in the field
strength and direction.
4. Change in Field Gradient: The gradient of the magnetic field, which represents
the rate of change of the field strength, may be affected by the increased
breadth of the conductor. Depending on the specific geometry of the sheet and
the current distribution, the field gradient may become steeper or more
gradual.

Figure 03: when decrease the breadth of the conductor from 0.15 – 0.05.

May 22, 2023 8


LAB THREE (3) REPORT

❖ When decrease the breadth (width) of the conductor in the current sheet, the
magnetic field generated by the sheet will also be affected. Here are the
expected changes:

1. Decrease in Magnetic Field Strength: Reducing the breadth of the conductor


will result in a decrease in the total current passing through the sheet,
assuming the current density remains constant. As per Ampere's law, the
magnetic field strength is directly proportional to the current. Therefore,
decreasing the breadth of the conductor will lead to a weaker magnetic field.
2. Narrower Magnetic Field Coverage: A narrower conductor means that the
magnetic field generated by the current sheet will have a reduced area of
influence. The magnetic field lines will be confined closer to the conductor and
may not extend as far away from the sheet as they did before.
3. Change in Magnetic Field Distribution: The distribution of the magnetic field
around the conductor may be altered. With a narrower conductor, the
magnetic field near the center of the sheet may become less uniform and more
concentrated. The field lines may exhibit stronger curvature and greater
variations in strength and direction.
4. Change in Field Gradient: The gradient of the magnetic field, representing the
rate of change of the field strength, may also be affected by reducing the
breadth of the conductor. Depending on the specific geometry of the sheet and
the current distribution, the field gradient may become less steep or more
abrupt.

It is important to note that the accuracy and precision of the results depend on
the chosen parameters and assumptions made in the model, such as the current
distribution and the dimensions of the current sheet. We can clearly observe that the
specific behavior of the magnetic field will depend on the details of the current sheet,
including the current density distribution and the geometry of the conductor. Further
analysis and modeling can provide more precise insights into the effects of changing
the conductor's breadth on the magnetic field characteristics.

May 22, 2023 9


LAB THREE (3) REPORT

DISCUSSION

The results obtained from the MATLAB code provide valuable insights into the
behavior of the magnetic field generated by a current sheet. In this discussion, we will
explore the implications of the results and their significance in relation to the
theoretical concepts of electromagnetism.

1. Magnetic Field Distribution and Symmetry: The observed circular pattern of


magnetic field lines surrounding the current sheet is consistent with the
theoretical expectations for a current-carrying conductor. The symmetrical nature
of the field lines, both in terms of shape and direction, supports the right-hand rule
and the principle of superposition in magnetic fields. This symmetry arises due to
the uniform current density assumption and the circular geometry of the sheet.

2. Influence of Observation Point Position: The results clearly indicate that the
magnetic field strength and direction vary depending on the distance from the
current sheet. As expected, the field strength is strongest near the surface of the
sheet and decreases as the distance from the sheet increases. This behavior aligns
with the inverse square relationship between magnetic field strength and distance
from a current-carrying conductor.

3. Magnetic Field Variation with Conductor Width: By observing the results, it is


apparent that changing the breadth (width) of the conductor affects the magnetic
field. Increasing the breadth of the conductor leads to a stronger and more
extensive magnetic field, while decreasing the breadth results in a weaker and
narrower magnetic field. These findings are consistent with the expectations based
on Ampere's law and the relationship between current and magnetic field
strength.

4. Limitations and Assumptions: It is important to acknowledge the limitations and


assumptions inherent in the current simulation. The code assumes a uniform
current density throughout the entire sheet and neglects any resistive effects.
Furthermore, the model assumes an idealized situation without considering edge
effects or the three-dimensional geometry of the conductor. These simplifications
may affect the accuracy and applicability of the results in real-world scenarios.

May 22, 2023 10


LAB THREE (3) REPORT

5. Practical Applications: Understanding the behavior of magnetic fields around


current-carrying conductors is crucial in various practical applications. This
knowledge finds relevance in designing and analyzing devices such as
electromagnets, transformers, and induction coils. The results obtained from the
MATLAB code provide a foundation for further exploration and analysis of such
applications.

6. Future Improvements: To enhance the accuracy and realism of the simulations,


future iterations of this experiment could incorporate additional factors. These
factors include considering non-uniform current distributions, edge effects, and
the three-dimensional geometry of the conductor. Implementing more complex
models and comparing the results with experimental data could further validate
the computational approach.

The experiment you conducted, which involved analyzing the magnetic field generated
by a current sheet, is based on several fundamental principles and concepts in
electromagnetism.

❖ Some of the important formulas behind the stimulation and the phenomenon
of this Lab report are:

• A current sheet 𝑲 = 5.0𝒂𝑦 A/m flows in the region −0.15 𝑚 < 𝑥 < 0.15 𝑚.
Calculate 𝑯 at 𝑃(0,0,0.25). Write a MATLAB program to verify your answer and
plot the magnetic field in the 𝑥-𝑦 plane in the region −0.5 𝑚 ≤ 𝑥 ≤ 0.5 𝑚 −0.5 m
≤ x ≤ 0.5 and −0.5 𝑚 ≤ 𝑧 ≤ 0.5 𝑚.

May 22, 2023 11


LAB THREE (3) REPORT

• We can calculate the magnetic field at a point 𝑃 by calculating the magnetic


field resulting from each surface element and adding all these elementary
magnetic fields together. This can be formulated in the mathematical form;

• Biot-Savart law (https://www.britannica.com/science/Biot-Savart-law): A


current in a loop produces magnetic field lines B that form loops around the
current. The Biot-Savart law expresses the partial contribution dB from a small
segment of the conductor to the total B field of a current in the conductor. The
Biot-Savart law relates the magnetic field generated by a small current element
to its magnitude, direction, and the distance from the observation point. It
serves as the basis for calculating the magnetic field produced by a current-
carrying conductor. For a segment of conductor of length and
orientation dl that carries a current i,

Figure 04: magnetic field from current Figure 05: magnetic field produced
loop by electric current

May 22, 2023 12


LAB THREE (3) REPORT

• Ampere's Law: one of the basic relations between electricity and magnetism,
stating quantitatively the relation of a magnetic field to the electric current or
changing electric field that produces it. Ampere's law states that the magnetic
field around a closed loop is directly proportional to the current passing
through the loop. It provides a mathematical relationship between the
magnetic field and the current distribution in a conductor.
• Superposition principle
(https://en.wikipedia.org/wiki/Superposition_principle): The superposition
principle states that the total magnetic field at a given point due to multiple
current elements is the vector sum of the individual magnetic fields produced
by each element. It allows for the calculation of the magnetic field from a
complex current distribution by breaking it down into simpler elements.

Figure 05: Two waves traveling in opposite directions across the same
medium combine linearly.(
https://en.wikipedia.org/wiki/Superposition_principle)

• Right-Hand Rule: The right-hand rule is a convention used to determine the


direction of the magnetic field around a current-carrying conductor. It states
that if the thumb of the right-hand points in the direction of the current, the
curled fingers represent the direction of the magnetic field lines.

Figure 06: Right-Hand-Rule (https://web.ua.es/docivis/magnet/righthand_rule.html/)

May 22, 2023 13


LAB THREE (3) REPORT

• Inverse Square Law: The magnetic field strength decreases with distance from
a current-carrying conductor following the inverse square law. According to
this principle, the strength of the magnetic field is inversely proportional to the
square of the distance from the source.

Figure 07: Inverse square


law(https://energyeducati
on.ca/encyclopedia/Invers
e_square_law). It can be
seen as the force spreading
out over an ever-increasing
area.

• Laplace equation:
(https://tutorial.math.lamar.edu/classes/de/laplaceseqn.aspx ):

• Some important equations behind this principle (Maxwell’s equations):

May 22, 2023 14


LAB THREE (3) REPORT

• Lorentz force law:

• Figure 05: Lorentz force F on a charged particle (of charge q) in motion


(instantaneous velocity v). The E field and B field vary in space and time.
(source : Lorentz force – Wikipedia)

❖ Figure 05: Lorentz force F on a charged particle (of charge q) in motion


(instantaneous velocity v). The E field and B field vary in space and time.
(source : Lorentz force - Wikipedia)

Moreover, the results obtained through the MATLAB code provided valuable
insights into the magnetic field generated by a current sheet. The observed patterns
and variations in the field strength and direction align with theoretical expectations.
These findings contribute to our understanding of electromagnetism and have
implications for practical applications in various fields.

May 22, 2023 15


LAB THREE (3) REPORT

CONCLUSION
In conclusion, this lab successfully demonstrated the use of MATLAB simulations
to study the magnetic field generated by a current sheet. The results obtained deepen
our knowledge of magnetic field characteristics and provide a foundation for further
exploration in the field of electromagnetism. The result we obtained gives us a clear
insight into the theoretical understanding of the current sheet that produces a
magnetic field. It also demonstrates some of the important laws that govern
Electromagnetic Field Theory that were also stated above in the discussion area.

These results can be useful in designing and optimizing electrical systems that
involve two conductors. By adjusting the spacing and size of the conductors, the
voltage and electric field distribution can be controlled to meet specific design
requirements.

Overall, the MATLAB simulation is a powerful tool for understanding and


optimizing electrical systems. By modeling and simulating the behavior of electrical
systems, engineers can gain insights into the underlying physics and design systems
that are both efficient and effective.

May 22, 2023 16


LAB THREE (3) REPORT

REFERENCE
➢ Some of the source were from the Lab sheet 03 provided by Dr. Hikma
SHABANI.
➢ Chapter 9, sections 9.1, 9.2, 9.3 and 9.4, Hayt W. H. and Buck. J, “Engineering
Electromagnetics”, 9th Ed, McGraw Hill, New York, 2018
➢ Online MATLAB: https://matlab.mathworks.com/
➢ Laplace equation: https://tutorial.math.lamar.edu/classes/de/laplaceseqn.aspx
➢ Lorentz force: Lorentz force – Wikipedia
➢ Biot-Savart law, google, webpage “Britannica”,
(https://www.britannica.com/science/Biot-Savart-law)
➢ Superposition princliple, google, Wikipedia
(https://en.wikipedia.org/wiki/Superposition_principle)
➢ Laplace equation:
(https://tutorial.math.lamar.edu/classes/de/laplaceseqn.aspx

May 22, 2023 17


LAB THREE (3) REPORT

ACKNOWLEDGE
I would like to express my sincere gratitude to Dr. Hikma SHABANI for providing
us this Laboratory Report to work on, it really helped us to understand the concept
behind the Electromagnetic Field, which is so vast and immense field in the theoretical
application but the general stand point is that we are slightly at the edge. I also would
like to appreciate some of my colleagues for their bright ideas and discussion that help
me accomplish this report. I also would like to thank my roommate, Tapi Morea (Steel)
he is and always will be my dear brother for life, thank you for keeping me through
these tough times my brother.

My biggest appreciation to the Electrical and Mechanical department for keeping


the classrooms open to acquire us at night hours to work on this report. Also thank
you again for the departmental wi-fi that made everything possible.

Last but not least, I want to thank the Heavenly Father for his love and mercy that
he has for me to live my everyday life, to help me survive through these rough times,
and to always be there for me when nobody else does.

May 22, 2023 18

You might also like