File:Cylindrical-magnet-force-diagram-approx.svg
From Wikimedia Commons, the free media repository
Jump to navigation
Jump to search
Size of this PNG preview of this SVG file: 720 × 540 pixels. Other resolutions: 320 × 240 pixels | 640 × 480 pixels | 1,024 × 768 pixels | 1,280 × 960 pixels | 2,560 × 1,920 pixels.
Original file (SVG file, nominally 720 × 540 pixels, file size: 67 KB)
File information
Structured data
Captions
Summary
[edit]DescriptionCylindrical-magnet-force-diagram-approx.svg |
English: Exactly computed force between two axially aligned identical cylindrical bar-magnets vs. distance between the magnets. Various graphs are shown for different lengths L of the magnets. The force is given in units of where M is the magnetization and R the radius. The force decreases sharply at small distances z. Additionally approximations are shown where each magnet is approximated as two point-like magnetic poles. This approximation is good for , but it diverges for small z. |
Date | |
Source | Own work |
Author | Geek3 |
Other versions | Cylindrical-magnet-force-diagram.svg version without approximations |
SVG development InfoField | This plot was created with Matplotlib. |
Source code InfoField | Python code#!/usr/bin/python
# -*- coding: utf8 -*-
import numpy as np
import scipy.special as sp
import matplotlib.pyplot as plt
import matplotlib as mpl
from math import *
mpl.style.use("classic")
# fix elliptic integrals for negative argument in case of old scipy version
if sp.ellipe(-1) > 0:
E = sp.ellipe
K = sp.ellipk
else:
def E(m):
if m >= 0.:
return sp.ellipe(m)
else:
return sp.ellipe(-m / (1. - m)) * sqrt(1. - m)
def K(m):
if m >= 0.:
return sp.ellipk(m)
else:
return sp.ellipk(-m / (1. - m)) / sqrt(1. - m)
def force_between_disks(z):
'''
Exact formula for the force between two homogeneously charged round disks
aligned on their axis of symmetry.
z is the distance relative to the disk radius.
The force is returned in units of Q^2 / (4pi epsilon_0 R^2)
in case of an electric charge Q on each disk.
The solution requires elliptical integrals
'''
if z == 0.:
return 2.
return 2 + 2/pi * (z**2 * E(-4./z**2) - (4+z**2) * K(-4./z**2))
def force_between_magnets(z, R, L):
'''
Exact formula for the force between two axially aligned identical
cylindrical magnets, as long as they are homogeneously magnetized.
'''
zR = z / R
F = force_between_disks(zR)
F -= 2 * force_between_disks(zR + L / R)
F += force_between_disks(zR + 2*L / R)
return F
def force_between_magnets_approx(z, L):
'''
Asymptotic formula for the force between two axially aligned identical
cylindrical magnets for the case z >> R, assuming magnetic point charges
'''
F = 1. / z**2
F -= 2. / (z + L)**2
F += 1. / (z + 2*L)**2
return F
mpl.rcParams['font.sans-serif'] = 'DejaVu Sans'
mpl.rc('mathtext', default='regular')
mpl.rc('lines', linewidth=2.4)
colors = ['#0000ff', '#00aa00', '#ff0000', '#ee9900', '#cccc00']
L = [(r'$\infty$', float('inf')), ('4R', 4.), ('2R', 2.), ('R', 1.), ('R/2', 0.5)]
plt.figure()
zmax = 4
zspace = np.linspace(0., zmax**0.5, 5001)**2
for i in range(len(L)):
if L[i][1] == float('inf'):
f = lambda z: force_between_disks(z)
f2 = lambda z: 1. / z**2
else:
f = lambda z: force_between_magnets(z, 1., L[i][1])
f2 = lambda z: force_between_magnets_approx(z, L[i][1])
plt.plot(zspace, [f(z) for z in zspace], '-',
color=colors[i], label=r'L = ' + L[i][0], zorder=-i-len(L))
plt.plot(0, f(0), 'o', color=colors[i], mew=1.2, zorder=-i)
plt.plot(zspace[1:], [f2(z) for z in zspace[1:]], '--', dashes=[2.4, 4.8],
color=colors[i], zorder=-i-2*len(L))
plt.plot([], [], '--', dashes=[2.4, 4.8], color='gray', label='two-pole\napproximation')
plt.xlabel('z / R')
plt.ylabel(r'$F\ [\pi/4\;\mu_0M^2R^4]$')
plt.title('Force between two cylindrical magnets with magnetization M,\nlength L, radius R and axial end-to-end distance z')
plt.legend(loc='upper right')
plt.xlim(-0.05, zmax)
plt.ylim(0, 2.1)
plt.grid(True)
plt.tight_layout()
plt.savefig('Cylindrical-magnet-force-diagram-approx.svg')
plt.figure()
zmax = 20
zspace = np.linspace(0., zmax**0.5, 5001)**2
for i in range(len(L)):
if L[i][1] == float('inf'):
f = lambda z: force_between_disks(z)
f2 = lambda z: 1. / z**2
else:
f = lambda z: force_between_magnets(z, 1., L[i][1])
f2 = lambda z: force_between_magnets_approx(z, L[i][1])
plt.plot(zspace, [f(z) for z in zspace], '-',
color=colors[i], label=r'L = ' + L[i][0], zorder=-i-len(L))
plt.plot(0, f(0), 'o', color=colors[i], mew=1.2, zorder=-i)
plt.plot(zspace[1:], [f2(z) for z in zspace[1:]], '--', dashes=[2.4, 4.8],
color=colors[i], zorder=-i-2*len(L))
plt.plot([], [], '--', dashes=[2.4, 4.8], color='gray', label='two-pole\napproximation')
plt.xlabel('z / R')
plt.ylabel(r'$F\ [\pi/4\;\mu_0M^2R^2]$')
plt.title('Force between two cylindrical magnets with\nmagnetization M, length L, radius R and axial distance z')
plt.gca().set_yscale('log')
plt.legend(loc='upper right')
plt.xlim(-0.5, zmax)
plt.ylim(1e-5, 2.5)
plt.grid(True)
plt.tight_layout()
plt.savefig('Cylindrical-magnet-force-diagram-approx_logscale.svg')
|
Licensing
[edit]I, the copyright holder of this work, hereby publish it under the following license:
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.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 14:58, 23 March 2021 | 720 × 540 (67 KB) | Geek3 (talk | contribs) | unit must contain R^2 | |
21:17, 1 April 2019 | 720 × 540 (68 KB) | Geek3 (talk | contribs) | title more specific | ||
21:45, 11 October 2017 | 720 × 540 (67 KB) | Geek3 (talk | contribs) | User created page with UploadWizard |
You cannot overwrite this file.
File usage on Commons
The following page uses this file:
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Width | 576pt |
---|---|
Height | 432pt |