In Sec. 3 we have introduced the Gibbs free energy of a micromagnetic system, discretized various contributions to the total energy, and derived the matrix-vector formulation. Some complication was introduced by the demagnetizing field, but the hybrid finite-element/boundary element method provides an elegant way to solve the problem accurately with a finite element mesh, which is restricted to the magnetic bodies.
This enables us to implement a simple energy minimization scheme to find the equilibrium magnetization distribution. If the magnetic polarization
is defined in Cartesian coordinates,
(4.1) |
However, the direct calculation of the energy gradient in spherical coordinates causes various problems due to the periodicity of the polar and azimuth angles.
Therefore, the magnetic polarization for the minimizer is given in spherical coordinates (
,
).
(4.2) |
(4.3) | |||
(4.4) | |||
(4.5) | |||
(4.6) |
For the minimizer itself the limited memory variable metric (LMVM) algorithm - a quasi-Newton-method - of the TAO package [46,47] has been selected, because it requires only the function values and the gradient of the total energy. In replacement for the Hessian (which is not available due to the demagnetizing field) the second-order information is approximated by a limited history of previous points and gradients. A similar method has been used in [44] and showed better convergence rates than Newton- or Gauß-Seidel methods.