Main Content

wrldmagm

Use World Magnetic Model

Description

[XYZ,H,D,I,F] = wrldmagm(height,latitude,longitude,decimalYear) calculates the Earth magnetic field at a specific location and time using the World Magnetic Model (WMM) WMM2020.

[XYZ,H,D,I,F] = wrldmagm(height,latitude,longitude,decimalYear,model) calculates the Earth magnetic field using World Magnetic Model model.

[XYZ,H,D,I,F] = wrldmagm(height,latitude,longitude,decimalYear,'Custom',filename) calculates the Earth magnetic field using the World Magnetic Model defined in the WMM.cof file. The WMM.cof files must be in their original form as provided by NOAA.

example

Examples

collapse all

This example shows how to calculate the magnetic model 1000 meters over Natick, Massachusetts, on July 4, 2020, using WMM-2020.

[XYZ, H, DEC, DIP, F] = wrldmagm(1000, 42.283, -71.35, decyear(2020,7,4),'2020')
XYZ = 3×1
104 ×

    1.9738
   -0.5014
    4.7556

H = 
2.0364e+04
DEC = 
-14.2536
DIP = 
66.8184
F = 
5.1733e+04

Calculate the magnetic model 1000 meters over Natick, Massachusetts, on July 4, 2020, using a downloaded WMM2020.COF file.

[XYZ, H, D, I, F] = wrldmagm(1000, 42.283, -71.35, decyear(2020,7,4),'Custom','WMM2020.COF')
XYZ = 3×1
104 ×

    1.9738
   -0.5014
    4.7556

H = 
2.0364e+04
D = 
-14.2536
I = 
66.8184
F = 
5.1733e+04

Input Arguments

collapse all

Ellipsoidal height above the WGS84 ellipsoid, specified as a scalar, in meters.

Data Types: double

Geodetic latitude, specified as a scalar, in degrees. North latitude is positive and south latitude is negative.

This function accepts latitude values greater than 90 and less than -90.

Data Types: double

Geodetic longitude, specified as a scalar, in degrees. East longitude is positive and west longitude is negative. This function accepts longitude values greater than 180 and less than -180.

Data Types: double

Year, in decimal format, specified as a scalar. This value can have any fraction of the year that has already passed.

Data Types: double

World Magnetic Model, specified as a character vector or string.

ModelDescription
'2020'

WMM2020 (epoch 2020–2025).

'2015v2' or '2015'

WMM2015v2 (epoch 2015–2020).

'2015v1'

WMM2015 (epoch 2015–2020). This version is not recommended. Use '2015v2' (WMM2015v2) instead.

'2010'

WMM2010 (epoch 2010–2015).

'2005'

WMM2005 (epoch 2005–2010).

'2000'

WMM2000 (epoch 2000–2005).

Data Types: char | string

Coefficient file, WMM.COF, downloaded from https://www.ncei.noaa.gov/products/world-magnetic-model.

Example: 'Custom','WMM.COF'

Data Types: char | string

Output Arguments

collapse all

Magnetic field vector, returned as a vector, in nanotesla. XYZ is defined in the NED frame.

Horizontal intensity, returned as a scalar, in nanotesla.

Declination, returned as a scalar, in degrees (+ve east).

Inclination, returned as a scalar, in degrees (+ve down).

Total intensity, returned as a scalar, in nanotesla (nT).

Limitations

  • The WMM specification produces data that is reliable five years after the epoch of the model, which begins January 1 of the model year selected. The WMM specification describes only the long-wavelength spatial magnetic fluctuations due to the Earth core. Intermediate and short-wavelength fluctuations, contributed from the crustal field (the mantle and crust), are not included. Also, the substantial fluctuations of the geomagnetic field, which occur constantly during magnetic storms and almost constantly in the disturbance field (auroral zones), are not included.

  • This function has the limitations of the World Magnetic Model (WMM). WMM2020 is valid between -1km and 850km, as outlined in the World Magnetic Model 2020 Technical Report.

  • WMM2015v2 was released by NOAA in February, 2019 to correct performance degradation issues in the Arctic region from January 1, 2015 to December 31, 2019. WMM2015v2 supersedes WMM2015. Consider replacing WMM2015 with WMM2015v2 for use with navigation and other systems. It is still acceptable to use WMM2015 in systems below 55 degrees latitude in the Northern hemisphere.

Version History

Introduced in R2006b