wrldmagm

Use World Magnetic Model

Description

example

[xyz,h,dec,dip,f] = wrldmagm(height,lat,lon,dyear) calculates the Earth magnetic field at a specific location and time using World Magnetic Model (WMM) model WMM2015v2, which is valid from January 1, 2015 to December 31, 2019.

Note

WMM2015v2 supersedes WMM2015 and corrects performance degradation issues present in WMM2015 above 55-degrees latitude in the Northern hemisphere.

[xyz,h,dec,dip,f] = wrldmagm(height,lat,lon,dyear,model) calculates the Earth magnetic field using World Magnetic Model model.

[xyz,h,dec,dip,f] = wrldmagm(height,lat,lon,dyear,'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.

Examples

collapse all

Calculate the magnetic model 1000 meters over Natick, Massachusetts, on July 4, 2015, using the WMM2015v2 model.

[XYZ, H, DEC, DIP, F] = wrldmagm(1000, 42.283, -71.35, decyear(2015,7,4),'2015')
XYZ =
   1.0e+04 *
    1.9455
   -0.5087
    4.8169

H =
   2.0110e+04

DEC =
  -14.6533

DIP =
   67.3405

F =
   5.2198e+04

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

[XYZ, H, DEC, DIP, F] = wrldmagm(1000, 42.283, -71.35, decyear(2015,7,4),'Custom','WMM.COF')
XYZ =
   1.0e+04 *
    1.9455
   -0.5087
    4.8169

H =
   2.0110e+04

DEC =
  -14.6533

DIP =
   67.3405

F =
   5.2198e+04

Input Arguments

collapse all

Height of the magnetic field, 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.

Data Types: double

Geodetic longitude, specified as a scalar, in degrees. East longitude is positive and west latitude is negative.

Data Types: double

Decimal year is the desired year in a 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
'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.ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml.

Example: 'Custom','WMM.COF'

Data Types: char | string

Output Arguments

collapse all

Magnetic field vector, returned as a vector, in nanotesla.

Horizontal intensity, returned as a scalar, in nanotesla.

Declination, returned as a scalar, in degrees.

Inclination, returned as a scalar, in degrees.

Total intensity, returned as a scalar, in nanotesla.

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.

  • 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.

Introduced in R2006b