# 2D formulation for Magnetostatic Problems

From KratosWiki

The 2D Magnetostatic Poisson's equation given by the governing PDE and its boundary conditions:

can be written as (see the General formulation for Magnetostatic Problems):

**Failed to parse (unknown function\J): \mathbf{f}^{(e)}= \int_{\Omega^{(e)}} \mathbf{N^T} \J_S \partial \Omega^{(e)} - \oint_{\Gamma_q^{(e)}} \mathbf{N^T} \bar q_n \partial \Gamma_q^{(e)} - \oint_{\Gamma_{{A_z}^{(e)}}} \mathbf{n^T} \mathbf{N^T} \mathbf{q_n} \partial \Gamma_{\varphi^{(e)}}**

with (* n* is the number of nodes of the element):

## 2D formulation for Triangular Elements

After applying the numerical integration for triangular elements by using the natural coordinates, we obtain:

### Stiffness Matrix K^{(e)}

### Source Vector f^{(e)}

**Linear case**(**n**=1 integration point):_{p}

**Quadratic case**(**n**=3 integration points):_{p}