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.
Luigi De Maria (2021). Earth Magnetic Field with IGRF 13th Gen. (https://www.mathworks.com/matlabcentral/fileexchange/88406-earth-magnetic-field-with-igrf-13th-gen), MATLAB Central File Exchange. Retrieved .
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.
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:
Initial datetime: 20-Sep-2008 11:01:18
Data generated using Matlab 2020a
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"
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?
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!