File:Mplwp earth-magnetic-field.svg

Original file (SVG file, nominally 600 × 400 pixels, file size: 39 KB)

Summary

Description
English: Plot of the earth's magnetic field components, in the approximation of an ideal dipole field. The three plot lines show the total field strength (blue), radial (vertical) field component (magenta) and the horizontal (south to north) field component (yellow). Field strengths are given in microteslas and the geographic latitude is given in degrees. The field strength reaches up to around 60 microteslas at the poles. At the equator, the field is purely horizontal. At the poles the field is purely vertical with twice the modulus than at the equator. The absolute value of the two orthogonal components is:
Date
Source Own work
Author Geek3
SVG development
InfoField
 
The SVG code is valid.
 
This plot was created with mplwp, the Matplotlib extension for Wikipedia plots.
Source code
InfoField

mplwp source code

The plot was generated with mplwp 1.8
#!/usr/bin/python
# -*- coding: utf8 -*-

import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
from math import *

code_website = 'https://commons.wikimedia.org/wiki/User:Geek3/mplwp'
try:
    import mplwp
except ImportError, er:
    print 'ImportError:', er
    print 'You need to download mplwp.py from', code_website
    exit(1)


name = 'mplwp_earth-magnetic-field.svg'
fig = mplwp.fig_standard(mpl)

xlim = -90, 90; fig.gca().set_xlim(xlim)
ylim = -65, 65; fig.gca().set_ylim(ylim)
fig.gca().xaxis.set_major_locator(mpl.ticker.MultipleLocator(30))
mplwp.mark_axeszero(fig.gca())

# add degrees to xaxis labels
def flabel(x, i):
    return u'{}\u00B0'.format(int(x)).replace('-', u'\u2212')
fig.gca().xaxis.set_major_formatter(mpl.ticker.FuncFormatter(flabel))

m = 7.746e22 # earth's magnetic moment
R = 6.368e6 # earth's radius
mu0 = 4 * pi * 1e-7

def Br(lat):
    return mu0 / (4*pi) * m / R**3 * 2 * -np.sin(lat)

def Bphi(lat):
    return mu0 / (4*pi) * m / R**3 * np.cos(lat)

def Babs(lat):
    return mu0 / (4*pi) * m / R**3 * np.sqrt(1. + 3. * np.sin(lat)**2)

latitudes = np.linspace(-pi/2, pi/2, 5001)
Br_array = Br(latitudes)
Bphi_array = Bphi(latitudes)
Babs_array = Babs(latitudes)

plt.plot(np.degrees(latitudes), 1e6 * Babs_array, label=r'$\vert B\vert$', zorder=-1)
plt.plot(np.degrees(latitudes), 1e6 * Br_array, label=r'$B_r$', zorder=-2)
plt.plot(np.degrees(latitudes), 1e6 * Bphi_array, label=r'$B_\varphi$', zorder=-3)

mplwp.set_bordersize(fig, 70.5, 18.5, 18.5, 48.5)
plt.xlabel(r'$latitude$')
plt.ylabel(r'$B\ [\mathrm{\mu T}]$')
plt.legend(loc='lower left')
plt.savefig(name)
mplwp.postprocess(name)

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

Captions

Plot of vertical and north component and absolute value of the earth's magnetic field

Items portrayed in this file

depicts

28 January 2019

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current13:51, 28 January 2019Thumbnail for version as of 13:51, 28 January 2019600 × 400 (39 KB)Geek3User created page with UploadWizard

The following page uses this file:

Global file usage

The following other wikis use this file:

Metadata