Example : Permanent Magnet Script

TITLE 'A PERMANENT-MAGNET PROBLEM'

VARIABLES

A     { z-component of Vector Magnetic Potential }

DEFINITIONS

mu { Values will be supplied by region }
J = 0 { current density }
Px = 0 { Magnetization components }
Py = 0
P = vector(Px,Py) { Magnetization vector }
H = (curl(A)-P)/mu { Magnetic field }
y0 = 8 { Size parameter }

EQUATIONS

curl(H) + J = 0

BOUNDARIES

REGION 1 { Air}

mu = 1
start(-40,0)
natural(A) = 0 line to (80,0)
value(A) = 0 line to (80,80) to (-40,80) to close

REGION 2 { Core }

mu = 5000
start(0,0)
line to (15,0) to (15,20) to (30,20) to (30,y0) to (40,y0)
to (40,40) to (0,40) to close

REGION 3 { the permanent magnet }

mu = 1
Py = 10
start (0,0) line to (15,0) to (15,10) to (0,10) to close

MONITORS

contour(A)

PLOTS

grid(x,y)
vector(dy(A),-dx(A)) as 'FLUX DENSITY B'
vector((dy(A)-Px)/mu, (-dx(A)-Py)/mu) as 'MAGNETIC FIELD H'
contour(A) as 'Az MAGNETIC POTENTIAL'
surface(A) as 'Az MAGNETIC POTENTIAL'
contour(magnitude(H)) as "MAGNETIC FIELD STRENGTH" painted

END