File:VFPt dipole animation.gif

Summary

{{Information

|Description=

English: Dipole fieldlines animation. A transformation from a point-shaped dipol to a finite-size electric dipole and a finite-size magnetic dipole is shown.

|Source=Own work |Author=Geek3 |Date=2010-10 |other_versions=* VFPt dipole animation electric.gif

|Other fields={{Igen|VectorFieldPlot|n|+|c1=

mkdir anims
./vectorfieldplot.py
  1. paste this code at the end of VectorFieldPlot 1.2

frames = 100 d = 0.35 # animation amplitude r = 7.5 # charge radius

  1. iterate frames

for i in range(frames):

   doc = FieldplotDocument('VFPt_dipole_animation_{0:0>2}'.format(i),
       commons=True, width=220, height=220, unit=100)
   a = abs(sin(i*2*pi/frames) * 0.75 - 0.25 * sin(3.0 * i*2*pi/frames))
   
   if i == 0 or i == frames / 2:
       # pointlike dipole
       field = Field({'dipoles':0,0,1,0})
   elif i < frames / 2:
       # electric dipole
       field = Field({'monopoles':[[-d*a,0,-0.5/(d*a)], [d*a,0,0.5/(d*a)]]})
       doc.draw_charges(field, scale=r/14)
   else:
       # magnetic dipole
       field = Field({'ringcurrents':0,0,0,d*a,1})
       doc.draw_currents(field, scale=r/14)
   if d * a < r / doc.unit:
       # draw dipole symbol
       symb = doc.draw_object('g', {'id':'dipole_symbol', 
           'transform':'scale({0},{0})'.format(
           sqrt(1.0/doc.unit**2-(d*a/r)**2))})
       defs = doc.draw_object('defs', {}, group=symb)
       spot = doc.draw_object('radialGradient', {'id':'light_spot',
           'cx':'0.65', 'cy':'0.7', 'r':'0.75'}, group=defs)
       for col, of in [['#fff', '0'], ['#ddd', '0.15'],
                       ['#aaa', '0.7'], ['#444', '1']]:
           doc.draw_object('stop', {'stop-color':col, 'offset':of}, group=spot)
       doc.draw_object('circle', {'cx':'0', 'cy':'0', 'r':str(r),
           'style':'fill:url(#light_spot); stroke:#000000; stroke-width:1'}, group=symb)
       doc.draw_object('path', {'style':'fill:#000000; stroke:none',
           'd':'M -4,1 H 0 V 4 L 5,0 L 0,-4 V -1 H -4 V 1 Z'}, group=symb)
   
   n = 20
   # iterate fieldlines
   for j in range(n):
       t = -1.0 + 2.0 * (j + 0.5) / n
       y = 0.25 * ((t-1)**-2 - (t+1)**-2) - 0.3*t
       dy = 0.0
       sf = None
       if i > frames / 2:
           dy = (y / abs(y) * d * a) * (1.0 - t**2)
           sf = [lambda p:-p[0], lambda p:p[0]]
       line = FieldLine(field, [0, y + dy],
           directions='both', maxr=1e4, maxn=2e4,
           stop_funcs=sf)
       doc.draw_line(line, linewidth=1.0,
           arrows_style={'dist':1.25, 'scale':1.1, 'max_arrows':2})
   
   doc.write(filename='anims/' + doc.name)

}} }}

for i in anims/*.svg; do rsvg -w1760 -h1760 $i $(echo $i | sed s/svg/png/) && convert -scale 220x220 $(echo $i | sed s/svg/png/) $(echo $i | sed s/svg/gif/); done
gifsicle -d5 -l0 --colors 256 --comment "http://commons.wikimedia.org/wiki/File:VFPt_dipole_animation.gif" anims/*.gif > VFPt_dipole_animation.gif

Licensing

I, the copyright holder of this work, hereby publish it under the following licenses:
GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.
Category:License migration redundant#VFPt%20dipole%20animation.gifCategory:GFDL#VFPt%20dipole%20animation.gif
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported 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.
Category:CC-BY-SA-3.0#VFPt%20dipole%20animation.gif
You may select the license of your choice.
Category:Self-published work
Category:Dipoles Category:Animated field diagrams Category:Images with Python source code Category:Images with BASH source code Category:Animations of electromagnetic field Category:Photos by User:Geek3 Category:GIF animations assembled with gifsicle Category:Animated GIF files
Category:Animated GIF files Category:Animated field diagrams Category:Animations of electromagnetic field Category:CC-BY-SA-3.0 Category:Dipoles Category:GFDL Category:GIF animations assembled with gifsicle Category:Images with BASH source code Category:Images with Python source code Category:License migration redundant Category:PNG created with VectorFieldPlot code Category:Photos by User:Geek3 Category:Self-published work