File:VFPt hexapol wires Babs+contour.svg

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

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

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

Description
English: Magnetic field of six infinite wires perpendicular to the image plane in hexapole configuration, conducting current into and out of the image plane. The absolute magnetic field strength is shown as background contour plot.
Date
Source Own work
Author Geek3
Other versions VFPt hexapol wires.svg
SVG development
InfoField
 
The SVG code is valid.
 
This plot was created with VectorFieldPlot.
Source code
InfoField

Python code

# paste this code at the end of VectorFieldPlot 3.2
# https://commons.wikimedia.org/wiki/User:Geek3/VectorFieldPlot
doc = FieldplotDocument('VFPt_hexapol_wires_Babs+contour', width=600, height=600, commons=True)
nw = 6
r = 1.8
wires = []
for i in range(nw):
    wires.append(['wire', {'x':r * cos(2*pi*i/nw),
                  'y':r * sin(2*pi*i/nw),
                  'I':2 * (i % 2) - 1}])
field = Field(wires)

def Babs(xy):
    return sc.linalg.norm(field.F(xy))
B0 = Babs((r - 0.15, 0))
doc.draw_scalar_field(func=Babs, cmap=doc.cmap_WtGnBu, vmin=0., vmax=B0)
doc.draw_contours(func=Babs, linewidth=1, linecolor='#111111',
    levels=sc.linspace(0, B0, 12)[1:-1], attributes={'opacity':'0.5'})

doc.draw_currents(field)
startpath = Startpath(field, lambda t: array((t * r * 0.9, 0)))
nlines = 7
for iline in range(nlines):
    p0 = startpath.startpos((iline + 0.5) / (nlines - 0.5))
    if iline == 2 or iline == 5:
        offs = 0.0
    else:
        offs = 0.5
    for m in range(nw):
    	line = FieldLine(field, rot(p0, 2*pi*m/nw), directions='both')
    	doc.draw_line(line, linewidth=2.4, arrows_style={'dist':1.8,
    	    'offsets':{'start':offs, 'end':1-offs} })
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:44, 12 November 2020Thumbnail for version as of 11:44, 12 November 2020600 × 600 (233 KB)Geek3 (talk | contribs)Uploaded own work with UploadWizard

There are no pages that use this file.

Metadata