mistaken post
1
Numerical Solution of Magnetic Field
Numerical solution of magnetic field problems is relatively more complex compared to electric field problems. There are two approaches to numerical solution of magnetostatics problems which are based on a) scalar magnetic potential and b) magnetic vector potential.
Scalar Magnetic Potential: In electrostatics, we have seen the use of electric potential. It is known that electric field is given by the gradient of the electric potential. Likewise, one can define a magnetic potential Vm and then define H = −∇Vm. Then combining ∇ × H = J and ∇ · B = 0, it is easy to show that
∇ 2Vm = 0 (1)
which hold for J = 0. This equation is same as the Laplace equation for electrostatics problems, and can be solved following the same numerical method as in electrostatics analysis.
Vector Magnetic Potential: This method involves the introduction of a vector magnetic potential which is extremely useful in the analysis of radiation from antennas, wave guides, transmission lines, and similar applications. This project will be based on the second method described below.
The vector magnetic potential is defined by
B = ∇ × A (2)
with the condition that ∇ · A = 0 (3)
Then we have J = ∇ × H
= ∇ × 1
µ B
= ∇ × 1
µ (∇ × A)
= 1
µ
[
∇(∇ · A) − ∇2A ]
(4)
where we have assumed that µ is constant. Sine ∇·A = 0, the above equation simplifies to
∇ 2 A = −µJ (5)
Since both A and J are vectors, the above equation can be written as three scalar equations
∇ 2Ax = −µJx
∇ 2Ay = −µJy
∇ 2Az = −µJz
(6)
2
These equations are very much similar to the Laplace equation found in electrostatics so that one can use the same numerical method. Once the vector magnetic potential A is numerically computed, the magnetic flux density B is easily obtained using (2).
As an example, consider a conductor with rectangular cross section carrying a current I0 in the z-direction.
Conductor
Conductor
As is well known, there will be magnetic fields circulating the conductor. We would like to compute the magnetic field in the surrounding region. For this problem, we have
B =
Bx By 0
(7)
and
A =
0 0 Az
(8)
so that
B = ∇ × A = ∂Az
∂y ax −
∂Az
∂x ay (9)
Then equation (6) simplifies to
∂2Az
∂x2 +
∂2Az
∂y2 = −µJz (10)
3
which is solved using standard methods of solving Laplace equation.
As usual we discretize the space domain is a grid. For domains in Cartesian geometry, a rectangular grid is usually used. For cylindrical geometry, the region is discretized utilizing cylindrical coordinates.
x
y
Fig 1. Discretization
For simplicity, we assume that the grid size be uniform for the x and y coordinates, i.e, ∆x = ∆y. Then following the same approach as in the case of Laplace equation for electrostics, it is easy to show that
Az(x + ∆x, y) + Az(x − ∆x, y) + Az(x, y + ∆y) + Az(x, y − ∆y)
− 4Az(x, y) + (∆x) 2µ(x, y)Jz(x, y) = 0
(11)
Denote the grid points in x coordinate as i = 1, 2, · · · , Nx and those for the y-coordinate as j = 1, 2, · · · , Ny. Then the above equation is expressed as
Ai+1,j + Ai−1,j + Ai,j+1 + Ai,j−1 − 4Ai,j + (∆x) 2µi,jJi,j = 0 (12)
x
y i-1,j i+1,j
i,j+1
i,j-1
i,j
Fig 2. Difference Formula
4
The above difference equation holds for each point in the grid which are then solved simultaneously for the unknown magnetic potential A. For the iterative solution, first assume some values for the unknown potential A for the interior nodes; in fact Ai,j = 0 is also a possible initial guess of the solution. Then sequentially update the solution Ai,j for each node using (12).
Project
Consider the rectangular domain as shown. The small square at the center is the cross section of the conductor that carries a current of 1A in the z-direction. All dimensions in this figure are in centimeters. Compute the magnetic flux density within the entire bigger square including the flux density within the conductor.
x
y
-5
5
-5
5
-0.5
0.5
-0.5
0.5
Fig 3. Domain
1. Assume that the conductor is made up of copper, which is held in air. Write a Matlab code to find the magnetic potential A(x, y) and the magnetic flux density B(x, y) at all grid points in the domain. Discuss your results.
2. Compute an analytical solution assuming that the conductor has circular cross section, and compare with the numerical solution computed above.
5
3. Consider any closed loop with the conductor inside the loop. Verify if Ampere’s law holds.
4. Consider any closed loop that does not include the conductor. Verify if Ampere’s law holds.
5. Suppose the conductor is carrying an alternating current at 60Hz. Investigate how magnetic field varies as a function of time.
6. Assume that the conductor is made up of iron. Repeat Part (1) above. Compare your result with that of part (1).
7. Assume that there is a block of iron at the upper right corner of the domain. The block is of dimension 1cm × 1cm, and has permeability µr = 2000. Repeat Part (1).
8. Compare your results for Part (1) and Part (6).