Magnetism and Numerical Methods# Micromagnetics and Discrete Spin Model Core equations Interactions Landau-Lifshitz-Gilbert (LLG) equation Extended equations Stochastic LLG equation Spin transfer torque (Zhang-Li model) Nonlocal spin transfer torque (full version of Zhang-li model) Spin transfer torque (current-perpendicular-to-plane, CPP) Monte Carlo Simulation Time integration The stabilisation term How much does the value matter? Choosing an integrator The analytical Jacobian Energy minimisation Gradient descent on the sphere The Hubert minimiser Barzilai-Borwein step lengths The steepest descent minimiser How this compares with OOMMF Nudged Elastic Band Method (NEBM) NEBM relaxation Vectors Projections Distances Algorithm Fidimag Code Arrays Cython Codes Geodesic distances code Convergence criteria and force units CVODE linear solver and memory usage Spherical coordinates code FMM/Barnes-Hut Demagnetising Field FFT-based Demag The Barnes-Hut and Fast Multipole Methods Usage 2D systems Performance Where FMM/Barnes-Hut is worth it References