Skip to content
/ MagFD2 Public

Solves the 2D demagnetizing field for a given magnetization configuration using the finite difference method

Notifications You must be signed in to change notification settings

Rkiefe/MagFD2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Finite difference method for the demagnetizing field calculation

Solves the 2D and 3D demagnetizing field "Hd" for a given magnetization configuration using the finite difference method.

It considers the vaccum exterior to set the magnetic potential to 0 in "infinity". There is an additional file ending in .c which contains the same algorithm written in C, with about 3x the performance, still in production. In the future, the C code will be implemented in Matlab using mex.

Method:

Main equation:

$$\nabla \cdot \vec{H_d} = -\nabla \cdot \vec{M}$$

Considering $H_d = -\nabla \phi$, results in: $\nabla^2 \phi = \nabla \cdot \vec{M}$, which is a Poisson equation. Now you apply the centered differences to the second order derivatives and iterate over a grid. The border condition for the magnetic region is,

$$(\nabla \phi_{int} - \nabla \phi_{ext} )\cdot n = M \cdot n$$

and for the outside: $\phi = 0$

Potential of the magnetic field Hd, example:

potential

About

Solves the 2D demagnetizing field for a given magnetization configuration using the finite difference method

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published