File:VFPt charged-wires quadrupole potential+contour.svg

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

Captions

Captions

Add a one-line explanation of what this file represents

Summary

edit
Description
English: Electric field and potential around four infinitely long charged wires with alternating charges. This configuration may be used as a quadrupole 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_quadrupole_potential+contour',
    width=600, height=600, commons=True)
nw = 4
r = 2.0
a0 = pi/4
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 = 16
for i in range(nl):
    a = (i + 0.5) / nl
    if (i + ((2 * i) // nl)) % 2 == 1:
        offs = 0.0
    else:
        offs = 0.5
    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':[offs, 0.4, 0.4, 1.0-offs]})

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 (216 KB)Geek3 (talk | contribs)Uploaded own work with UploadWizard

The following page uses this file:

Metadata