File:VFPt superconductor cylinder B-field.svg
Summary
{{Information
|description=
|date=2019-10-13 |source=Own work |author=Geek3 |permission= |other versions=VFPt superconductor ball B-field.svg, VFPt superconductor cylinder B-field potential+contour.svg |other fields={{Igen|VectorFieldPlot|+|c1=
- paste this code at the end of VectorFieldPlot 2.4
doc = FieldplotDocument('VFPt_superconductor_cylinder_B-field',
width=600, height=600, commons=True)
field_direction = [0.0, -1.0] r = 1.2 field = Field([['homogeneous', {'Fx':field_direction[0], 'Fy':field_direction[1]}],
['dipole2d', {'x':0, 'y':0, 'px':-2*pi*r**2*field_direction[0], 'py':-2*pi*r**2*field_direction[1]}]])
- draw the superconducting cylinder
cylinder = doc.draw_object('g', {'id':'metal_cylinder'})
def triangle_path(phi1, phi2, r):
x1, y1 = r * cos(radians(phi1)), r * sin(radians(phi1)) x2, y2 = r * cos(radians(phi2)), r * sin(radians(phi2)) d = 'M {:.4f},{:.4f}'.format(x1, y1) d += ' A {:.4f},{:.4f} 0 0 1 {:.4f},{:.4f}'.format(r, r, x2, y2) d += ' L {:.4f},{:.4f}'.format(-x2, -y2) d += ' A {:.4f},{:.4f} 0 0 0 {:.4f},{:.4f}'.format(r, r, -x1, -y1) d += ' L {:.4f},{:.4f} Z'.format(x1, y1) return d
def grey(bright):
return '#' + 3 * ('%02x' % int(256. * bright - 0.5))
doc.draw_object('circle', {'cx':0, 'cy':0, 'r':'{:.4f}'.format(r),
'style':'fill:' + grey(0.75) + '; stroke:none'}, group=cylinder)
for phi0 in [0]:
ncolors = 25 for a in sc.linspace(.5 / ncolors, 1 - .5 / ncolors, ncolors): bright = 0.75 + 0.15 * a phi1 = phi0 - 60 * (acos(2. * a - 1) / pi)**1.5 phi2 = phi0 + 60 * (acos(2. * a - 1) / pi)**1.5 d = triangle_path(phi1, phi2, r) doc.draw_object('path', {'d':d, 'style':'fill:' + grey(bright) + '; stroke:none'}, group=cylinder)
doc.draw_object('circle', {'cx':0, 'cy':0, 'r':str(r),
'style':'fill:none; stroke:black; stroke-width:0.02'}, group=cylinder)
nlines = 20 for i in range(nlines):
a = -3 + 6 * (0.5 + i) / nlines line = FieldLine(field, [a, 8], maxr=16, pass_dipoles=1) doc.draw_line(line, arrows_style={'dist':4, 'offsets':{'leave_image':0.3, 'enter_image':0.3}, 'fixed_ends':{'leave_image':True, 'enter_image':True} })
doc.write() }} }}
Licensing
- 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.