File Exchange

image thumbnail

Earth Magnetic Field with IGRF 13th Gen.

version 1.0.0 (5.72 KB) by Luigi De Maria
Earth Magnetic Field components using spherical harmonics, from order 1 to order 13,and IGRF 13th Gen. 2020 Gaussian coeff.s.


Updated 05 Mar 2021

View License

The main code computes the Earth's Magnetic Field components (in Earth centered inertial frame) using spherical harmonics from order 1 until order 13.

The Gaussian Coefficients are taken from IGRF 13th Gen. 2020.

Cite As

Luigi De Maria (2021). Earth Magnetic Field with IGRF 13th Gen. (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (5)

Luigi De Maria

Thank you for the review Arthur! I have really appreciated your comparison!
I will investigate the nature of those differences and update the code as soon as I have some free time to dedicate.

Arthur Henry

I have made a comparison, the link should work now:

The function is similar but is not exactly right. I've use the correct gh coefficient interpolated at the right time, not the one provided in IGRF-13 as you only have year 2020 available.
The function is very efficient however:
IGRF-13-DeMaria ... 182.010 ms
IGRF-12-Matlab ... 34145.792 ms (igrfmagm)
IGRF-13-Compston ... 753.822 ms (gh vector pre-allocated)

This is the orbit I am using:
epoch: 7.3367e+05
i_deg: 97.4200
Omega_deg: 247.4627
e: 6.7030e-04
omega_deg: 130.5360
M_deg: 325.0288
a_km: 6821
n_deg_per_s: 0.0642

Initial datetime: 20-Sep-2008 11:01:18

Data generated using Matlab 2020a

Luigi De Maria

Yes I tested it during a project development. However I did not compared it with Matlab igrfmagm, I will do so in the next days. Thank you for the feedback!
P.S. The image you linked results as "not found"

Ash Dove-Jay

The function execution is really good, however the output doesn't match at all with igrfmagm matlab built-in function (Matlab 2020a). See image link below.
I don't have access to Matlab 2020b with 13th model at the moment, did you benchmark your code against igrfmagm?

Arthur Henry

MATLAB Release Compatibility
Created with R2019b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!