MagneticPDEComponent[vars,pars]
yields a magnetic PDE term with variables vars and pars.
MagneticPDEComponent
MagneticPDEComponent[vars,pars]
yields a magnetic PDE term with variables vars and pars.
Details
- MagneticPDEComponent generates an equation to model magnetostatics and low-frequency electromagnetics with model variables vars and model parameters pars.
- MagneticPDEComponent returns a sum of differential operators to be used as a part of partial differential equations:
- MagneticPDEComponent models static magnetic fields produced by permanent magnets or magnetic and electric fields that are generated by low-frequency electric currents flowing in conductive materials.
- MagneticPDEComponent is typically used to model electric motors, inductors and electromagnets.
- MagneticPDEComponent creates PDE components for stationary, time, frequency and parametric analysis.
- MagneticPDEComponent models magnetostatics and low-frequency electromagnetic phenomena with the dependent magnetic vector potential
in units of [
] and independent variables
in units of [
]. - MagneticPDEComponent can model external currents also in the static case.
- In the static case, when no currents are present, MagnetostaticPDEComponent should be used.
- The vector-valued dependent variable
is specified as a three-vector
={Ax1,Ax2,Ax3}. - Stationary variables vars are vars={
[x1,…,xn],{x1,…,xn}}. - Frequency-dependent variables vars are vars={
[x1,…,xn],ω,{,…,xn}}. - Time-dependent variables vars are vars={
[t,x1,…,xn],t,{x1,…,xn}}. - MagneticPDEComponent provides a stationary magnetic model:
is the vacuum permeability in units of [
],
the magnetization vector in units of [
] and
the external current density vector in units of [
].- The magnetization vector
specifies the magnetic dipole moment per unit volume within a material, indicating the strength and direction of its magnetic properties. - MagneticPDEComponent provides a frequency domain model:
[
] is the vacuum permittivity, relative permittivity
[-], electrical conductivity
[
], angular frequency
[
] and the imaginary unit
.- MagneticPDEComponent provides a time domain model:
- An alternative model to the magnetization vector
, is the remanent magnetic flux density vector
in units of [
]. - The stationary MagneticPDEComponent equation is given as:
is the unitless recoil permeability.- For linear materials, the stationary equation MagneticPDEComponent simplifies to:
is the unitless relative permeability.
can be isotropic, orthotropic or anisotropic.
can be a function of the magnetic field and describe nonlinear materials.- The units of the magnetic model terms are in [
]. - The following parameters pars can be given:
-
parameter default symbol "ExternalCurrentSource" {0,…}
, external current density vector in [
]"Magnetization" {0,…}
, magnetization vector in [
]"MagneticModelForm" None 
"RegionSymmetry" None 
"RelativePermeability" 1
, unitless relative permeability"RemanentMagneticFluxDensity" {0,…}
, remanent magnetic flux density in [
]"Thickness" 1
, thickness in [
] "VacuumPermeability" 
, vacuum permeability in [
] - Additional parameters can be specified for the frequency and time domain models:
-
parameter default symbol "ElectricalConductivity" 1
, electrical conductivity in [
] - The number of independent variables
determines the dimensions of
,
and
and the length of vectors
,
and
. - The models are available in a 2D, a 2D axisymmetric and a 3D form.
- For 3D stationary models with relative permeability
, "MagneticModelForm" can be set to "FreeSpace", and with the Coulomb gauge condition,
, the 3D operator simplifies to: - In 2D, with an out-of-plane direction, the magnetic vector potential has only a
component. In the stationary linear case, the equation is given by:
[
] is a variable denoting a "Thickness" in the
direction and the dependent variable
is specified as
={0,0,Az}.- A possible choice for the parameter "RegionSymmetry" is "Axisymmetric".
- "Axisymmetric" region symmetry represents a truncated cylindrical coordinate system where the cylindrical coordinates are reduced by removing the angle variable as follows:
-
dimension reduction e.g. linear stationary equation 2D 

- To solve this equation, the covariant formulation is made use of. The covariant formulation is a method in which a change of variable is applied to axisymmetric equation, given by
: - The input specification for the parameters is exactly the same as for their corresponding operator terms.
- If no parameters are specified, the default magnetic PDE is:
- If the MagneticPDEComponent depends on parameters
that are specified in the association pars as …,keypi…,pivi,…, the parameters
are replaced with
.
Examples
open all close allBasic Examples (3)
Define a symbolic 3D magnetic PDE model with vacuum permeability
and relative permeability
:
MagneticPDEComponent[{{Ax[x, y, z], Ay[x, y, z], Az[x, y, z]}, {x, y, z}}, <|"VacuumPermeability" -> Subscript[μ, 0], "RelativePermeability" -> Subscript[μ, r]|>]Set up the default magnetic PDE model with vacuum permeability
and relative permeabilityMagneticPDEComponent[{{Ax[x, y, z], Ay[x, y, z], Az[x, y, z]}, {x, y, z}}, <||>]Define a symbolic time-dependent magnetic PDE model:
MagneticPDEComponent[{{Ax[t, x, y, z], Ay[t, x, y, z], Az[t, x, y, z]}, t, {x, y, z}}, <|"VacuumPermeability" -> Subscript[μ, 0], "RelativePermeability" -> Subscript[μ, r], "ElectricalConductivity" -> σ|>]//MatrixFormScope (7)
Define a magnetic PDE model with a relative permeability set to 5:
MagneticPDEComponent[{{Ax[x, y, z], Ay[x, y, z], Az[x, y, z]}, {x, y, z}}, <|"RelativePermeability" -> 5|>]Activate a magnetic PDE model:
MagneticPDEComponent[{{Ax[x, y, z], Ay[x, y, z], Az[x, y, z]}, {x, y, z}}, <|"RelativePermeability" -> 5|>]//ActivateDefine a symbolic 2D out-of-plane magnetic PDE model with vacuum permeability
, relative permeability
and an external current in the
direction:
MagneticPDEComponent[{{0, 0, Az[x, y]}, {x, y}}, <|"VacuumPermeability" -> Subscript[μ, 0], "RelativePermeability" -> Subscript[μ, r], "ExternalCurrentSource" -> {0, 0, Jz[x, y]}|>]Note that the
and
direction currents are not considered:
MagneticPDEComponent[{{0, 0, Az[x, y]}, {x, y}}, <|"VacuumPermeability" -> Subscript[μ, 0], "RelativePermeability" -> Subscript[μ, r], "ExternalCurrentSource" -> {Jx[x, y], Jy[x, y], Jz[x, y]}|>]Define a symbolic 2D axisymmetric magnetic PDE model:
MagneticPDEComponent[{{0, Aθ[r, z], 0}, {r, z}}, <|"VacuumPermeability" -> Subscript[μ, 0], "RelativePermeability" -> Subscript[μ, r], "ExternalCurrentSource" -> {0, Jθ[r, z], 0}, "RegionSymmetry" -> "Axisymmetric"|>]Note that the
and
direction currents are not considered:
MagneticPDEComponent[{{0, Aθ[r, z], 0}, {r, z}}, <|"VacuumPermeability" -> Subscript[μ, 0], "RelativePermeability" -> Subscript[μ, r], "ExternalCurrentSource" -> {Jr[r, z], Jθ[r, z], Jz[r, z]}, "RegionSymmetry" -> "Axisymmetric"|>]Define a 3D free-space magnetic PDE model with relative permeability of 1:
MagneticPDEComponent[{{Ax[x, y, z], Ay[x, y, z], Az[x, y, z]}, {x, y, z}}, <|"VacuumPermeability" -> Subscript[μ, 0], "ExternalCurrentSource" -> {Jx[x, y, z], Jy[x, y, z], Jz[x, y, z]}, "MagneticModelForm" -> "FreeSpace"|>]Define a symbolic 2D-frequency magnetic PDE model:
MagneticPDEComponent[{{0, 0, Az[x, y]}, ω, {x, y}}, <|"VacuumPermeability" -> Subscript[μ, 0], "RelativePermeability" -> Subscript[μ, r], "ExternalCurrentSource" -> {0, 0, Jz[x, y]}, "ElectricalConductivity" -> σ|>]Set up the default magnetic PDE model with vacuum permeability
and relative permeability
and maintain Quantity objects:
MagneticPDEComponent[{{Ax[x, y, z], Ay[x, y, z], Az[x, y, z]}, {x, y, z}}, <|"Quantities" -> True|>]Applications (2)
2D Stationary Analysis (1)
To model a long wire of circular cross section, define the mesh to use:
mesh = [image];wireRegion = Disk[{0, 0}, 0.2];Solve the magnetic PDE model with a uniform current density in the
direction in the wire:
AzFun = NDSolveValue[{MagneticPDEComponent[{{0, 0, Az[x, y]}, {x, y}}, <|"ExternalCurrentSource" -> {0, 0, Piecewise[{{1, RegionMember[wireRegion][{x, y}]}}, 0]}|>] == 0, MagneticPotentialCondition[x ^ 2 + y ^ 2 >= 1, {{0, 0, Az[x, y]}, {x, y}}, <||>]}, Az, {x, y}∈mesh]Show[StreamPlot[Evaluate[Curl[{0, 0, AzFun[x, y]}, {x, y, z}][[1 ;; 2]]], {x, y}∈mesh], Graphics[{Darker[Orange], wireRegion}]]2D Frequency Analysis (1)
Define the mesh to model a long copper wire of circular cross section:
mesh = \!\(\*GraphicsBox[«3»]\);wireRegion = Disk[{0, 0}, 0.01];Define the parameters of the model with:
pars = <|"ElectricalConductivity" -> Piecewise[{{5.9*^7, RegionMember[wireRegion][{x, y}]}}, 0], "RelativePermeability" -> 1|>;vars = {{0, 0, Az[x, y]}, ω, {x, y}};Define the uniform external current density in the
direction:
Je0 = 100000;
pars["ExternalCurrentSource"] = {0, 0, Piecewise[{{Je0, RegionMember[wireRegion][{x, y}]}}]};op = MagneticPDEComponent[vars, pars]Define a zero magnetic potential condition at the exterior boundary:
Subscript[Γ, zero] = MagneticPotentialCondition[x ^ 2 + y ^ 2 >= 0.1 ^ 2, vars, pars]pde = {op == 0, Subscript[Γ, zero]};Set up an angular frequency of 800 Hz:
ω0 = 2 * Pi * 800;Replace the angular frequency
and solve the PDE:
AzFun = NDSolveValue[pde /. ω -> ω0, Az, {x, y}∈mesh]Efield = {0, 0, -I * ω0 * AzFun[x, y]};Compute the conduction current:
Jc = pars["ElectricalConductivity"] * Efield;Je = pars["ExternalCurrentSource"];Jfield = Jc + Je;Visualize the total current magnitude:
DensityPlot[Sqrt[Total[Abs[Jfield] ^ 2]], {x, y}∈mesh, ...]Tech Notes
Related Guides
History
Text
Wolfram Research (2025), MagneticPDEComponent, Wolfram Language function, https://reference.wolfram.com/language/ref/MagneticPDEComponent.html.
CMS
Wolfram Language. 2025. "MagneticPDEComponent." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MagneticPDEComponent.html.
APA
Wolfram Language. (2025). MagneticPDEComponent. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MagneticPDEComponent.html
BibTeX
@misc{reference.wolfram_2026_magneticpdecomponent, author="Wolfram Research", title="{MagneticPDEComponent}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/MagneticPDEComponent.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_magneticpdecomponent, organization={Wolfram Research}, title={MagneticPDEComponent}, year={2025}, url={https://reference.wolfram.com/language/ref/MagneticPDEComponent.html}, note=[Accessed: 12-June-2026]}