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

File:VFPt superconductor ball E-field potential.svg

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

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

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

Description
English: Deformation of a previously homogeneous electric field around a perfect conducting ball (e.g. iron or a superconductor). The electric field lines are accurately computed. The electric potential is drawn as a background color field.
Date
Source Own work
Author Geek3
Other versions
SVG development
InfoField
 
The source code of this SVG is invalid due to VectorFieldPlot errors.
 
This W3C-invalid vector image was created with Inkscape, or with something else.
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

SVG code

# paste this code at the end of VectorFieldPlot 2.0
doc = FieldplotDocument('VFPt_superconductor_ball_E-field_potential',
    width=600, height=600, commons=True)
unit = 100.
field_direction = [0.0, -1.0]
sphere = {'p':sc.array([0., 0.]), 'r':1.2}
field = Field([['homogeneous', {'Fx':field_direction[0], 'Fy':field_direction[1]}],
    ['dipole', {'x':sphere['p'][0], 'y':sphere['p'][1],
     'px':4*pi*sphere['r']**3*field_direction[0],
     'py':4*pi*sphere['r']**3*field_direction[1]}]])

def pot(xy):
    if vabs(xy) <= sphere['r']:
        return 0. # zero potential inside metal sphere
    return field.V(xy)
U0 = pot([3, 3])
doc.draw_scalar_field(func=pot, cmap=doc.cmap_AqYlFs, vmin=-U0, vmax=U0)

# draw the superconducting ball
ball = doc.draw_object('g', {'id':'metal_ball'})
grad = doc.draw_object('radialGradient', {'id':'metal_spot', 'cx':'0.53', 'cy':'0.54',
    'r':'0.55', 'fx':'0.65', 'fy':'0.7', 'gradientUnits':'objectBoundingBox'}, group=ball)
for col, of in (('#fff', 0), ('#e7e7e7', 0.15), ('#ddd', 0.25), ('#aaa', 0.7), ('#888', 0.9), ('#666', 1)):
    doc.draw_object('stop', {'offset':of, 'stop-color':col}, group=grad)
doc.draw_object('circle', {'cx':sphere['p'][0], 'cy':sphere['p'][1], 'r':str(sphere['r']),
    'style':'fill:url(#metal_spot); stroke:#000; stroke-width:0.02'}, group=ball)
ball_charges = doc.draw_object('g', {'style':'stroke-width:0.02; stroke-linecap:square'}, group=ball)

n_lines = 20
for i in range(n_lines):
    a = -3 + 6 * (0.5 + i) / n_lines
    line = FieldLine(field, [a, 6], maxr=12, pass_dipoles=1)
    if abs((n_lines - 1.) / 2. - i) > 7:
        off = {'start':0.5, 'leave_image':0.5, 'enter_image':0.5}
    else:
        off = {'start':0.25, 'leave_image':0.25, 'enter_image':0.25, 'end':0.25}
    doc.draw_line(line, arrows_style={'min_arrows':2, 'max_arrows':2, 'offsets':off})
    
    # draw little charge signs near the surface
    path_minus = 'M {0:.5f},0 h {1:.5f}'.format(-2./unit, 4./unit)
    path_plus = 'M {0:.5f},0 h {1:.5f} M 0,{0:.5f} v {1:.5f}'.format(-2./unit, 4./unit)
    
    # check if fieldline crosses sphere surface
    tlist = sc.linspace(0., 1., 101)
    for i in range(1, len(tlist)):
        in0 = vabs(line.get_position(tlist[i-1]) - sphere['p']) <= sphere['r']
        in1 = vabs(line.get_position(tlist[i]) - sphere['p']) <= sphere['r']
        if in0 != in1:
            # find the point where the field line cuts the surface
            t = op.brentq(lambda t: vabs(line.get_position(t)
                - sphere['p']) - sphere['r'], tlist[i-1], tlist[i])
            pr = line.get_position(t) - sphere['p']
            cpos = 0.92 * sphere['r'] * pr / vabs(pr)
            if in1:
                path_d = path_minus
            else:
                path_d = path_plus
            doc.draw_object('path', {'stroke':'black', 'd':path_d,
                'transform':'translate({:.5f},{:.5f})'.format(
                    round(unit*cpos[0])/unit, round(unit*cpos[1])/unit)},
                    group=ball_charges)
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
current22:19, 7 September 2019Thumbnail for version as of 22:19, 7 September 2019600 × 600 (99 KB)Geek3 (talk | contribs)User created page with UploadWizard

Metadata