This is a Quality image. Click here for more information.

File:VFPt ringmagnet2.svg

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

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

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

Description
English: Drawing of a cylindrical ringmagnet with precisely computed magnetic field lines. The magnet consists of a flat cylinder of R/L=2 with a cylindrical hole of radius r/R=1/2 and is homogeneously magnetized along the cylinder axis. The north-half of the magnet is painted red, whereas the south-half is green. The precise field distribution is obtained by numerical integration. The shape of the field lines is traced with a Runge-Kutta algorithm. The density of field lines corresponds roughly to the field strength, however due to 3D variations of the field, this cannot exactly be fulfilled.
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.
This image has been assessed using the Quality image guidelines and is considered a Quality image.

العربية  جازايرية  беларуская  беларуская (тарашкевіца)  български  বাংলা  català  čeština  Cymraeg  Deutsch  Schweizer Hochdeutsch  Zazaki  Ελληνικά  English  Esperanto  español  eesti  euskara  فارسی  suomi  français  galego  עברית  हिन्दी  hrvatski  magyar  հայերեն  Bahasa Indonesia  italiano  日本語  Jawa  ქართული  한국어  kurdî  Lëtzebuergesch  lietuvių  македонски  മലയാളം  मराठी  Bahasa Melayu  Nederlands  Norfuk / Pitkern  polski  português  português do Brasil  rumantsch  română  русский  sicilianu  slovenčina  slovenščina  shqip  српски / srpski  svenska  தமிழ்  తెలుగు  ไทย  Tagalog  Türkçe  toki pona  українська  vèneto  Tiếng Việt  中文  中文(简体)  中文(繁體)  +/−

Source code
InfoField

Python code

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

r0 = 1.0
r1 = 2.0
h = 0.5
field = Field([ ['coil', {'x':0, 'y':0, 'phi':pi/2, 'R':r1, 'Lhalf':h, 'I':1}],
         ['coil', {'x':0, 'y':0, 'phi':pi/2, 'R':r0, 'Lhalf':h, 'I':-1}] ])
n_out = 24
for i in range(n_out):
    s = (i + 0.5) / n_out * 2. - 1.
    line = FieldLine(field, [copysign(r1 + h * (1. / s**2 - 1.), s), 0.],
        directions='both', maxr=1e3)
    doc.draw_line(line, linewidth=2.4, arrows_style={'scale':1.1,
        'potential':lambda xy: xy[1] * (1-fabs(xy[0]/2.5)**2.5-fabs(xy[1]/2)**2.5),
        'at_potentials':[0], 'condition_func':lambda xy: fabs(xy[1]) > 0.7 or
            (fabs(xy[0]) > r1 and fabs(xy[1]) < 1e-4)})

n_in = 12
for i in range(n_in):
    a = (i + 0.5) / n_in * 2. - 1.
    line = FieldLine(field, [r0 * (1.2*a - 0.2*a**3), 0.],
        directions='both')
    doc.draw_line(line, linewidth=2.4, arrows_style={'scale':1.1,
        'potential':lambda xy: xy[1], 'at_potentials':[0],
        'condition_func':lambda xy: fabs(xy[0]) < r0})

# draw the magnet manually
colors = ['#00cc00', '#ff0000']
defs = doc.draw_object('defs', {})
grad = doc.draw_object('linearGradient', {'id':'grad',
    'x1':str(r0), 'x2':str(-r0), 'y1':'0', 'y2':'0',
    'gradientUnits':'userSpaceOnUse'}, group=defs)
for col, of, opa in [['#000000', '0', '0.125'],
    ['#ffffff', '0.07', '0.125'], ['#ffffff', '0.25', '0.5'],
    ['#ffffff', '0.6', '0.2'], ['#000000', '1', '0.33']]:
    stop = doc.draw_object('stop', {'stop-color':col, 'offset':of,
        'stop-opacity':opa}, group=grad)
mag = doc.draw_object('g', {'id':'magnet'}, bg=True)
for i in [0, 1]:
    rect = doc.draw_object('rect', group=mag)
    for attr, val in [['x', -r0], ['y', [-h, 0][i]],
        ['width', 2*r0], ['height', [2*h, h][i]],
        ['style', 'fill:{0}; stroke:none'.format(colors[i])]]:
        rect.set(attr, str(val))
rect = doc.draw_object('rect', group=mag)
for attr, val in [['x', -r0], ['y', -h],
    ['width', 2 * r0], ['height', 2 * h],
    ['style', 'fill:url(#grad); stroke-width:0.04; stroke-linejoin:miter; stroke:#000000']]:
    rect.set(attr, str(val))

for x0 in [-r1, r0]:
    mag = doc.draw_object('g')
    for i in [0, 1]:
        rect = doc.draw_object('rect', group=mag)
        for attr, val in [['x', x0], ['y', [-h, 0][i]],
            ['width', r1 - r0], ['height', [2*h, h][i]],
            ['style', 'fill:{0}; stroke:none'.format(
            ['#49da49', '#ff4949'][i])]]:
            rect.set(attr, str(val))
    rect = doc.draw_object('rect', group=mag)
    for attr, val in [['x', x0], ['y', -h],
        ['width', r1 - r0], ['height', 2 * h],
        ['style', 'fill:none; stroke-width:0.04; stroke-linejoin:miter; stroke:#000000']]:
        rect.set(attr, str(val))

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
current13:33, 15 December 2018Thumbnail for version as of 13:33, 15 December 2018600 × 600 (72 KB)Geek3 (talk | contribs)User created page with UploadWizard

File usage on other wikis

The following other wikis use this file:

Metadata