This page derives the weak formulation for magnetostatics using the magnetic vector potential A \boldsymbol{A} A and describes the available interactions and couplings in Allsolve.
Maxwell’s equations
Gauss’s law \text{Gauss's law} Gauss’s law ∇ ⋅ D = ρ \nabla \cdot \boldsymbol{D} = \rho ∇ ⋅ D = ρ Gauss’s law for magnetism \text{Gauss's law for magnetism} Gauss’s law for magnetism ∇ ⋅ B = 0 \nabla \cdot \boldsymbol{B} = 0 ∇ ⋅ B = 0 Faraday’s law \text{Faraday's law} Faraday’s law ∇ × E = − ∂ B ∂ t \nabla \times \boldsymbol{E} = -\frac{\partial \boldsymbol{B}}{\partial t} ∇ × E = − ∂ t ∂ B Ampere-Maxwell law \text{Ampere-Maxwell law} Ampere-Maxwell law ∇ × H = J + ∂ D ∂ t \nabla \times \boldsymbol{H} = \boldsymbol{J} + \frac{\partial \boldsymbol{D}}{\partial t} ∇ × H = J + ∂ t ∂ D
Our starting points along with the material relation are
∇ ⋅ B = 0 ∇ × H = J B = μ H . \begin{align*}
\nabla \cdot \boldsymbol{B} &= 0 \tag{1} \\[5pt]
\nabla \times \boldsymbol{H} &= \boldsymbol{J} \tag{2} \\[5pt]
\boldsymbol{B} &= \mu \boldsymbol{H}. \tag{3}
\end{align*} ∇ ⋅ B ∇ × H B = 0 = J = μ H . ( 1 ) ( 2 ) ( 3 )
Since the magnetic field is divergence-free, we can use the identity for divergence of a curl and write the magnetic field as a curl of some vector A \boldsymbol{A} A
B = ∇ × A . \begin{align*}
\boldsymbol{B} = \nabla \times \boldsymbol{A}. \tag{4}
\end{align*} B = ∇ × A . ( 4 )
Vector A \boldsymbol{A} A is called a magnetic vector potential.
By substituting (4) \text{(4)} (4) into (3) \text{(3)} (3) and rearranging, the material relation becomes
H = 1 μ B = 1 μ ( ∇ × A ) . \begin{align*}
\boldsymbol{H}
= \frac{1}{\mu} \boldsymbol{B}
= \frac{1}{\mu} \left( \nabla \times \boldsymbol{A} \right). \tag{5}
\end{align*} H = μ 1 B = μ 1 ( ∇ × A ) . ( 5 )
Substituting (5) \text{(5)} (5) into (2) \text{(2)} (2) , the strong form becomes
∇ × H = 1 μ ( ∇ × A ) = J . \begin{align*}
\nabla \times \boldsymbol{H}
= \frac{1}{\mu} \left( \nabla \times \boldsymbol{A} \right)
= \boldsymbol{J}. \tag{6}
\end{align*} ∇ × H = μ 1 ( ∇ × A ) = J . ( 6 )
To obtain the weak form, multiply (2) \text{(2)} (2) by the test function A ′ \boldsymbol{A}^\prime A ′ and integrate over the domain Ω \Omega Ω :
∫ Ω ( ∇ × H − J ) ⋅ A ′ d Ω = 0 ∫ Ω ( ∇ × H ) ⋅ A ′ d Ω − ∫ Ω J ⋅ A ′ d Ω = 0. \begin{align*}
\int_{\Omega}\ (\nabla \times \boldsymbol{H}
- \boldsymbol{J}) \cdot \boldsymbol{A^\prime}\ d \Omega
= 0 \tag{7} \\[5pt]
\int_{\Omega}\ (\nabla \times \boldsymbol{H}) \cdot \boldsymbol{A^\prime}\ d \Omega
- \int_{\Omega}\ \boldsymbol{J} \cdot \boldsymbol{A^\prime}\ d \Omega
= 0. \tag{8}
\end{align*} ∫ Ω ( ∇ × H − J ) ⋅ A ′ d Ω = 0 ∫ Ω ( ∇ × H ) ⋅ A ′ d Ω − ∫ Ω J ⋅ A ′ d Ω = 0. ( 7 ) ( 8 )
Using the identity for divergence of a cross product on the first term we get
∫ Ω ∇ ⋅ ( H × A ′ ) d Ω + ∫ Ω H ⋅ ( ∇ × A ′ ) d Ω − ∫ Ω J ⋅ A ′ d Ω = 0. \begin{align*}
\int_{\Omega}\ \nabla \cdot (\boldsymbol{H} \times \boldsymbol{A^\prime})\ d \Omega
+ \int_{\Omega}\ \boldsymbol{H} \cdot (\nabla \times \boldsymbol{A^\prime})\ d \Omega
- \int_{\Omega}\ \boldsymbol{J} \cdot \boldsymbol{A^\prime}\ d \Omega
= 0. \tag{9}
\end{align*} ∫ Ω ∇ ⋅ ( H × A ′ ) d Ω + ∫ Ω H ⋅ ( ∇ × A ′ ) d Ω − ∫ Ω J ⋅ A ′ d Ω = 0. ( 9 )
Applying the divergence theorem on the first term we obtain
∫ Γ ( H × A ′ ) ⋅ n d Γ + ∫ Ω H ⋅ ( ∇ × A ′ ) d Ω − ∫ Ω J ⋅ A ′ d Ω = 0. \begin{align*}
\int_{\Gamma}\ (\boldsymbol{H} \times \boldsymbol{A^\prime}) \cdot \boldsymbol{n}\ d \Gamma
+ \int_{\Omega}\ \boldsymbol{H} \cdot (\nabla \times \boldsymbol{A^\prime})\ d \Omega
- \int_{\Omega}\ \boldsymbol{J} \cdot \boldsymbol{A^\prime}\ d \Omega
= 0. \tag{10}
\end{align*} ∫ Γ ( H × A ′ ) ⋅ n d Γ + ∫ Ω H ⋅ ( ∇ × A ′ ) d Ω − ∫ Ω J ⋅ A ′ d Ω = 0. ( 10 )
Using the scalar triple product rule on the boundary term we get
∫ Γ ( n × H ) ⋅ A ′ d Γ + ∫ Ω H ⋅ ( ∇ × A ′ ) d Ω − ∫ Ω J ⋅ A ′ d Ω = 0. \begin{align*}
\int_{\Gamma}\ (\boldsymbol{n} \times \boldsymbol{H}) \cdot \boldsymbol{A^\prime}\ d \Gamma
+ \int_{\Omega}\ \boldsymbol{H} \cdot (\nabla \times \boldsymbol{A^\prime})\ d \Omega
- \int_{\Omega}\ \boldsymbol{J} \cdot \boldsymbol{A^\prime}\ d \Omega
= 0. \tag{11}
\end{align*} ∫ Γ ( n × H ) ⋅ A ′ d Γ + ∫ Ω H ⋅ ( ∇ × A ′ ) d Ω − ∫ Ω J ⋅ A ′ d Ω = 0. ( 11 )
Substituting (5) \text{(5)} (5) in the second term and by rearranging we get the final weak form as
∫ Ω 1 μ ( ∇ × A ) ⋅ ( ∇ × A ′ ) d Ω + ∫ Ω − J ⋅ A ′ d Ω + ∫ Γ ( n × H ) ⋅ A ′ d Γ = 0. \begin{align*}
\int_{\Omega}\ \frac{1}{\mu}\ (\nabla \times \boldsymbol{A}) \cdot (\nabla \times \boldsymbol{A^\prime})\ d \Omega
+ \int_{\Omega}\ -\ \boldsymbol{J} \cdot \boldsymbol{A^\prime}\ d \Omega
+ \int_{\Gamma}\ (\boldsymbol{n} \times \boldsymbol{H}) \cdot \boldsymbol{A^\prime}\ d \Gamma
= 0. \tag{12}
\end{align*} ∫ Ω μ 1 ( ∇ × A ) ⋅ ( ∇ × A ′ ) d Ω + ∫ Ω − J ⋅ A ′ d Ω + ∫ Γ ( n × H ) ⋅ A ′ d Γ = 0. ( 12 )
Imposes a zero tangential magnetic field n × H = 0 \boldsymbol{n} \times \boldsymbol{H} = 0 n × H = 0 on the boundary, equivalent to a perfect magnetic conductor (PMC).
In the A-formulation, this is a natural boundary condition, meaning it is satisfied automatically if no other condition is applied.
Defines a remanent magnetization B r \boldsymbol{B_r} B r for permanent magnets.
Can be specified as a constant vector or as a vector valued function.
How to use You can use either the matrix editor or the expression editor . With the matrix editor, provide a 3×1 matrix for a 3D problem (2×1 for 2D, etc.) with remanence field vector values for each dimension. In the expression editor, write the direct expression. Example [1; 5; 0] applies a 3D remanence field of B r , x = 1 T B_{r,x} = 1\:T B r , x = 1 T , B r , y = 5 T B_{r,y} = 5\:T B r , y = 5 T and B r , z = 0 T B_{r,z} = 0\:T B r , z = 0 T to the specified region. Same principles apply for 2D. See also Adding spatially varying remanence field to permanent magnets .Unit Remanence magnetic field in Teslas (T)
Imposes periodic boundary conditions on the magnetic vector potential field A \boldsymbol{A} A between two boundaries.
Reduces the computational domain size for geometrically symmetric or antisymmetric problems, avoiding the need to model the full geometry.
Example Periodicity follows the same principles, regardless of which physics module it belongs to. See how periodicity is used in magnetism as a reference: Periodicity in electric motors
This formulation supports the following couplings: