File:VFPt capacitor-infinite-plate uniform.svg

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

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

Captions

Captions

Add a one-line explanation of what this file represents

Summary

[edit]
Description
English: Electric field of simple parallel plate capacitor. The capacitor consists of two parallel rectangular plates perpendicular the the image plane and expanding to infinity. The field is accurately computed for a uniform potential at each plate. The charge density increases towards the edges.
Date
Source Own work
Author Geek3
Other versions VFPt capacitor-infinite-plate.svg, VFPt capacitor-infinite-plate uniform-potential+contour.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 2.4
doc = FieldplotDocument('VFPt_capacitor-infinite-plate_uniform',
    width=800, height=600, commons=True)
# capacitor dimensions
l = 4.5
d = 1.5

# To model the real, non-uniform charge distribution on the capacitor plate,
# we we cut the plate into several finite segments and equalize their potential.
nsheets = 10 # caution, increases computing effort a lot.
q_list = sc.ones(nsheets)
# higher segment density towards the edges, where charge density varies more
r_list = l/2. * (1.0 - sc.linspace(1, 0, nsheets + 1)[1:]**2)

for i_iter in range(50):
    plates = []
    for isheet in range(nsheets):
        r = r_list[isheet]
        Q = 2. * r * (q_list[isheet])
        if isheet < nsheets - 1:
            Q -= 2. * r * q_list[isheet + 1]
        plates.append({'x0':-r, 'y0':d/2., 'x1':r, 'y1':d/2., 'q':Q})
        plates.append({'x0':-r, 'y0':-d/2., 'x1':r, 'y1':-d/2., 'q':-Q})
    field = Field([ ['charged_plane', p] for p in plates])
    
    V_list = [field.V([(r_list[0]) / 2., d/2.])]
    for i in range(1, nsheets):
        V_list.append(field.V([(r_list[i-1] + r_list[i]) / 2., d/2.]))
    
    # We want the potential to be 1 everywhere on the plate,
    # so iteratively adapt the charges
    q_list = q_list / V_list

print 'segment charge densities', q_list
print 'segment potentials', V_list

Q_list = [q_list[0] * r_list[0]] + [q_list[i] * (r_list[i] - r_list[i-1]) for i in range(1, nsheets)]
charge_sums = sc.cumsum([0.] + Q_list[::-1] + Q_list)
relative_charge_position = ip.interp1d(charge_sums / charge_sums[-1],
    list(-r_list[::-1]) + [0.] + list(r_list))

def startpath(t):
    # take an oval with stright lines and half-cirles around one plate
    tt = (t%1) * (2 * l + pi * d)
    if tt <= l*0.5:
        return sc.array([tt, d])
    elif tt <= l*0.5 + pi/2.*d:
        phi = (tt - l*0.5) / (d/2.)
        return sc.array([l*0.5 + d*0.5*sin(phi), d*0.5 + d*0.5*cos(phi)])
    elif tt <= l*1.5 + pi/2.*d:
        return sc.array([l - (tt - pi/2.*d), 0.])
    elif tt <= l*1.5 + pi*d:
        phi = (tt - l*1.5) / (d/2.)
        return sc.array([-l*0.5 + d*0.5*sin(phi), d*0.5 + d*0.5*cos(phi)])
    else:
        return sc.array([tt - (l*2. + pi*d), d])

nlines = 22
startpoints = Startpath(field, startpath).npoints(nlines)

# plot field lines
for p0 in startpoints:
    line = FieldLine(field, p0, directions='both')
    doc.draw_line(line, linewidth=2.4, arrows_style={'dist':2, 'min_arrows':1})

# plot capacitor plate
D = 0.055
lw = 0.01
nsign = nlines
plus = 'M 0,-0.02 v 0.04 M -0.02,0 h 0.04'
minus = 'M -0.02,0 h 0.04'
for iplate in range(2):
    yplate = d / 2. * {0:-1., 1:1.}[iplate]
    M = sc.array([0., yplate])
    R = sc.array([l/2., 0.])
    a = atan2(R[1], R[0])
    if iplate == 1:
        col = '#e22'
        sign = plus
    else:
        col = '#45e'
        sign = minus
    transform = 'translate({:.6g},{:.6g})'.format(M[0], M[1])
    transform += ' rotate({:.6g})'.format(degrees(a))
    doc.draw_object('rect', {'x':-vabs(R)-D/2., 'width':2*vabs(R)+D,
        'y':-D, 'height':2*D,
        'style':'fill:{:s}; stroke:#000; stroke-width:{:.6g}'.format(col, lw),
        'transform':transform})
    for i in range(nsign):
        pos = [relative_charge_position((i + 0.5) / nsign), yplate]
        doc.draw_object('path', {'d':sign,
        'transform':'translate({:.6g},{:.6g})'.format(*pos),
        'style':'fill:none; stroke:#000; stroke-width:{:.6g}; '.format(2*lw) +
        'stroke-linecap:square'})

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
current09:19, 3 October 2019Thumbnail for version as of 09:19, 3 October 2019800 × 600 (27 KB)Geek3 (talk | contribs)User created page with UploadWizard

The following page uses this file:

Metadata