File:VFPt charged-wires hexapole potential+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: 294 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

Description
English: Electric field and potential around six infinitely long charged wires with alternating charges. This configuration may be used as a hexapole guide for low-field seeking particles.
Date
Source Own work
Author Geek3
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.1
# https://commons.wikimedia.org/wiki/User:Geek3/VectorFieldPlot
doc = FieldplotDocument('VFPt_charged-wires_hexapole_potential+contour',
    width=600, height=600, commons=True)
nw = 6
r = 2.0
a0 = 0.
rods = [{'x':r * cos(2*pi*i/nw + a0), 'y':r * sin(2*pi*i/nw + a0),
         'q':1 - 2 * (i % 2)} for i in range(nw)]
field = Field([ ['charged_wire', rod] for rod in rods])
doc.draw_charged_wires(field, scale=2)

spath = Startpath(field, lambda t: sc.array([
    r * cos(a0) + r * sin(pi/nw) * cos(2*pi*t + a0),
    r * sin(a0) + r * sin(pi/nw) * sin(2*pi*t + a0)]), t0=0.0, t1=1)

nl = 20
for i in range(nl):
    a = (i + 0.5) / nl
    for m in range(0, nw, 2):
        line = FieldLine(field, rot(spath.startpos(a), 2*pi*m/nw),
            directions='both')
        doc.draw_line(line, linewidth=2.4, arrows_style={'dist':1.7, 'scale':1.2,
            'offsets':[0.6, 0.5, 0.5, 0.6]})

U0 = field.V([(r + 0.3) * cos(a0), (r + 0.3) * sin(a0)])
U1 = field.V([(r + 0.295) * cos(a0), (r + 0.295) * sin(a0)])
doc.draw_scalar_field(func=field.V, cmap=doc.cmap_AqYlFs,
    vmin=-U0, vmax=U0)
doc.draw_contours(func=field.V, linewidth=1, linecolor='#111111',
    levels=sc.linspace(-U1, U1, 17)[1:-1], attributes={'opacity':'0.7'})

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
current17:46, 4 June 2020Thumbnail for version as of 17:46, 4 June 2020600 × 600 (294 KB)Geek3 (talk | contribs)Uploaded own work with UploadWizard

The following page uses this file:

Metadata