File:VFPt flat magnets gap absB.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(SVG file, nominally 800 × 800 pixels, file size: 132 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

Description
English: Drawing of two homogeneously magnetized flat cylindrical magnets with exactly computed magnetic field lines. The two magnets are aligned on top of each other along the cylinder axis and with a narrow gap in-between. This configuration is often used as a dipole magnet to create a strong and roughly uniform magnetic field in the gap, for instance in cyclotrons. The heatmap in the background shows the absolute field strength |B|, where blue indicates the strongest field.
Date
Source Own work
Author Geek3
Other versions
SVG development
InfoField
 
The SVG code is valid.
 
This plot was created with VectorFieldPlot.
 
This file uses embedded text.
Source code
InfoField

Python code

# paste this code at the end of VectorFieldPlot 3.3
# https://commons.wikimedia.org/wiki/User:Geek3/VectorFieldPlot
doc = FieldplotDocument('VFPt_flat_magnets_gap_absB', commons=True,
    width=800, height=800)

m = 1.
R = 2.
L = 1.
Bfield = Field([ ['coil', {'x':0, 'y':1, 'phi':pi/2, 'R':R, 'Lhalf':L/2 ,'I':m/(R**2*pi)}],
    ['coil', {'x':0, 'y':-1, 'phi':pi/2, 'R':R, 'Lhalf':L/2, 'I':m/(R**2*pi)}] ])
Hfield = Field([
    ['charged_disc', {'x0':-R, 'y0':-1-L/2, 'x1':R, 'y1':-1-L/2, 'Q':-m/L}],
    ['charged_disc', {'x0':-R, 'y0':-1+L/2, 'x1':R, 'y1':-1+L/2, 'Q':m/L}],
    ['charged_disc', {'x0':-R, 'y0':1-L/2, 'x1':R, 'y1':1-L/2, 'Q':-m/L}],
    ['charged_disc', {'x0':-R, 'y0':1+L/2, 'x1':R, 'y1':1+L/2, 'Q':m/L}] ])

doc.draw_magnets(Bfield)
B0 = sc.linalg.norm(Bfield.F([0, 0]))
doc.draw_scalar_field(func=lambda xy: sc.linalg.norm(Bfield.F(xy)),
    vmin=0., vmax=B0 / 0.6, cmap=doc.cmap_WtGnBu)

nlines = 22
R0 = optimize.brentq(lambda x: Bfield.F([x, 0.])[1], 0, 3)
Sp = Startpath(Bfield, lambda t: sc.array([-R0 + 2. * R0 * t, 0.]))
xstart = [Sp.startpos((0.2+i) / (nlines-0.6))[0] for i in range(nlines)]

cond = lambda xy: fabs(xy[1]) < 1e-2 or fabs(xy[1]) > 1.4

U0 = Hfield.V([0., 1.5])
for iline, x in enumerate(xstart):
    line = FieldLine(Bfield, [x, 0.], directions='both', maxr=12)
    doc.draw_line(line, arrows_style={'scale':1.3, 'potential':Hfield.V,
        'at_potentials':[-0.3*U0, 0., 0.3*U0], 'condition_func':cond})

for x0, y0 in ((-1, -1), (-1, 1), (1, -1), (1, 1)):
    line = FieldLine(Bfield, [2.3 * x0, 1. * y0], directions='both', maxr=5)
    doc.draw_line(line, arrows_style={'scale':1.3, 'dist':2,
        'offsets':{'start':1, 'end':0} })

doc.write()

Licensing[edit]

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.

File history

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

Date/TimeThumbnailDimensionsUserComment
current11:29, 13 January 2021Thumbnail for version as of 11:29, 13 January 2021800 × 800 (132 KB)Geek3 (talk | contribs)distribution of arrows
17:25, 16 December 2018Thumbnail for version as of 17:25, 16 December 2018800 × 800 (131 KB)Geek3 (talk | contribs)User created page with UploadWizard

Metadata