Main Content

World Magnetic Model

Calculate Earth's magnetic field at specific location and time using World Magnetic Model

  • Library:
  • Aerospace Blockset / Environment / Gravity

  • World Magnetic Model block

Description

The World Magnetic Model block implements the mathematical representation of the National Geospatial Intelligence Agency (NGA) World Magnetic Model. The World Magnetic Model block calculates the Earth magnetic field vector, horizontal intensity, declination, inclination, and total intensity at a specified location and time. The reference frame is north-east-down (NED).

Note

Use this block to model the Earth magnetic field between altitudes of -1,000 m to 850,000 m meters.

Limitations

All specifications have these limitations:

  • The internal calculation of decimal year does not take into account local time or leap seconds.

  • The specifications describe only the long-wavelength spatial magnetic fluctuations in the Earth's 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 block 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.

In addition, each specification has these limitations:

  • WMM2015v2 supersedes WMM2015(v1). Consider replacing WMM2015(v1) with WMM2015v2 when used for navigation and other systems. WMM2015v2 was released by National Oceanic and Atmospheric Administration (NOAA) in February 2019 to correct performance degradation issues in the Arctic region for January 1, 2015, to December 31, 2019. Therefore, it is still acceptable to use WMM2015(v1) in systems below 55 degrees latitude in the Northern hemisphere.

  • The WMM2020 specification produces data that is reliable five years after the epoch of the model, which is January 1, 2020.

  • The WMM2015 specification produces data that is reliable five years after the epoch of the model, which is January 1, 2015.

  • The WMM2010 specification produces data that is reliable five years after the epoch of the model, which is January 1, 2010.

  • The WMM2005 specification produces data that is reliable five years after the epoch of the model, which is January 1, 2005.

  • The WMM2000 specification produces data that is reliable five years after the epoch of the model, which is January 1, 2000.

Ports

Input

expand all

Height, specified as a scalar, in selected units.

Data Types: double

Latitude, specified as a scalar, in degrees. If latitude is out of range, the block wraps it to be within the range when Action for out-of-range input is set to None or Warning. It does not wrap when Action for out-of-range is set to Error.

Data Types: double

Longitude, specified as a scalar, in degrees. If longitude is out of range, the block wraps it to be within the range when Action for out-of-range input is set to None or Warning. It does not wrap when Action for out-of-range is set to Error.

Data Types: double

Desired year in a decimal format to include any fraction of the year that has already passed. The value is the current year plus the number of days that have passed in this year divided by 365.

For example, to calculate the decimal year, dyear, for March 21, 2015:

dyear=decyear('21-March-2015','dd-mmm-yyyy')
dyear =
   2.0152e+03

Data Types: double

Output

expand all

Magnetic field, returned as a vector, in selected units.

Data Types: double

Horizontal intensity, returned as a scalar, in specified units.

Data Types: double

Declination, returned as a scalar, in degrees.

Data Types: double

Inclination, returned as a scalar, in degrees.

Data Types: double

Total intensity, returned as a scalar, in selected units.

Data Types: double

Parameters

expand all

World Magnetic Model coefficient file, selected from the list.

  • WMM2000 (2000-2005) — World Magnetic Model 2000 coefficient file

  • WMM2005 (2005-2010) — World Magnetic Model 2005 coefficient file

  • WMM2010 (2010-2015) — World Magnetic Model 2010 coefficient file

  • WMM2015 V1 (2015-2020) — World Magnetic Model 2015(v1) coefficient file

  • WMM2015 V2 (2015-2020) — World Magnetic Model 2015v2 coefficient file

  • WMM2020 (2020-2025) — World Magnetic Model 2020 coefficient file

  • Custom — Specify your own World Magnetic Model coefficient file. You can download a World Magnetic Model coefficient file from The NOAA World Magnetic Model.

Dependencies

Selecting Custom enables the Custom .COF file parameter.

Programmatic Use

Block Parameter: model
Type: character vector
Values: 'WMM2020 (2020-2025)' | 'WMM2015 V2 (2015-2020)' | 'WMM2000 (2000-2005)' | 'WMM2005 (2005-2010)' | 'WMM2010 (2010-2015)' | 'WMM2015 V1 (2015-2020)' | 'Custom'
Default: 'WMM2020 (2020-2025)'

World Magnetic Model coefficient file, downloaded from The NOAA World Magnetic Model. For example, if you want to download a coefficient file not yet listed in the WMM coefficients list.

Dependencies

To enable this parameter, select Custom for the WMM coefficients parameter.

Programmatic Use

Block Parameter: customFile
Type: character vector
Values: 'WMM2020.COF' | any coefficient file name
Default: 'WMM2020.COF'

Input and output units:

UnitsHeightMagnetic FieldHorizontal IntensityTotal Intensity
Metric (MKS)MetersNanoteslaNanoteslaNanotesla
EnglishFeetNanogaussNanogaussNanogauss

Programmatic Use

Block Parameter: units
Type: character vector
Values: 'Metric (MKS)' | 'English'
Default: 'Metric (MKS)'
  • To specify the decimal year with an input port for the World Magnetic Model 2015 block, select this check box

  • To specify the decimal year using the values of Month, Day, and Year, clear this check box.

Programmatic Use

Block Parameter: time_in
Type: character vector
Values: 'on' | 'off'
Default: 'on'

Month to calculate decimal year.

Dependencies

To enable this parameter, select Input decimal year.

Programmatic Use

Block Parameter: month
Type: character vector
Values: 'January' | 'February' | 'March' | 'April' | 'May' | 'June' | 'July' | 'August' | 'September' | 'October' | 'November' | 'December'
Default: 'January'

Day to calculate decimal year.

Dependencies

To enable this parameter, select Input decimal year.

Programmatic Use

Block Parameter: day
Type: character vector
Values: '1' to '31'
Default: '1'

Year to calculate decimal year.

Dependencies

To enable this parameter, select Input decimal year.

Programmatic Use

Block Parameter: year
Type: character vector
Values: any year
Default: '2020'

Out-of-range block behavior, specified as follows.

ActionDescription

None

No action.

Warning

Warning in the MATLAB® Command Window, model simulation continues.

Error (default)

MATLAB returns an exception, model simulation stops.

If longitude or latitude is out of range, the block wraps it to be within the range when Action for out-of-range input is set to None or Warning. It does not wrap when Action for out-of-range is set to Error.

Programmatic Use

Block Parameter: action
Type: character vector
Values: 'Error' | 'Warning' | 'None'
Default: 'Error'

To output the horizontal intensity value, select this check box. Otherwise, clear this check box.

Dependencies

To enable the Horizontal Intensity output port, select this check box.

Programmatic Use

Block Parameter: h_out
Type: character vector
Values: 'on' | 'off'
Default: 'on'

To output the declination, the angle between true north and the magnetic field vector (positive eastwards), select this check box. Otherwise, clear this check box.

Dependencies

To enable the Declination output port, select this check box.

Programmatic Use

Block Parameter: dec_out
Type: character vector
Values: 'on' | 'off'
Default: 'on'

To output the inclination, the angle between the horizontal plane and the magnetic field vector (positive downwards), select this check box. Otherwise, clear this check box.

Dependencies

To enable the Inclination output port, select this check box.

Programmatic Use

Block Parameter: inc_out
Type: character vector
Values: 'on' | 'off'
Default: 'on'

To output the total intensity, select this check box. Otherwise, clear this check box.

Dependencies

To enable the Total Intensity output port, select this check box.

Programmatic Use

Block Parameter: ti_out
Type: character vector
Values: 'on' | 'off'
Default: 'on'

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Introduced in R2019b