File:VFPt bar-magnet-forces.svg
Original file (SVG file, nominally 572 × 660 pixels, file size: 92 KB)
Captions
Summary[edit]
DescriptionVFPt bar-magnet-forces.svg |
English: Top: Exactly computed field lines of magnetic field B of a cylindrical bar magnet with several euqipotential lines of the magnetic scalar potential. The B-field is proportional to the force exerted on external magnetic north-poles. Bottom: Exactly computed field lines of grad(abs(B)) of a cylindrical bar magnet with several euqipotential lines of abs(B). This field is proportional to the force exerted on small magnetizable particles, such as iron filings. |
Date | |
Source | Own work |
Author | Geek3 |
SVG development InfoField | This plot was created with VectorFieldPlot. |
Source code InfoField | Python code# paste this code at the end of VectorFieldPlot 3.2
# https://commons.wikimedia.org/wiki/User:Geek3/VectorFieldPlot
docB = FieldplotDocument('VFPt_bar-magnet-forces',
commons=True, width=400, height=300)
R = 0.3
L2 = 1.
m = 1.
def bounds_func(xy):
out_magnet = min(L2 - fabs(xy[0]), R - fabs(xy[1]))
out_image = max(fabs(xy[0]) - 2.0, fabs(xy[1]) - 1.5)
return max(out_magnet, out_image)
Hfield = Field([ ['charged_disc', {'x0':-L2, 'y0':-R, 'x1':-L2, 'y1':R, 'Q':-m*.5/L2}],
['charged_disc', {'x0':L2, 'y0':-R, 'x1':L2, 'y1':R, 'Q':m*.5/L2}] ])
Bfield = Field([ ['coil', {'x':0, 'y':0, 'phi':0, 'R':R, 'Lhalf':L2, 'I':m/(R**2*pi)}] ])
phi0 = Hfield.V((L2, R/2))
rstart = 0.35
startpath = Startpath(Bfield, lambda t: array((L2-rstart*cos(t), (R+rstart)*sin(t))),
t0=asin(R/(R+rstart)), t1=2*pi-asin(R/(R+rstart)))
nlines = 16
for iline in range(nlines):
p0 = startpath.startpos((iline + 0.1) / (nlines - 0.8))
line = FieldLine(Bfield, p0, directions='both', maxr=20, bounds_func=bounds_func)
docB.draw_line(line, linewidth=2,arrows_style={'potential':Hfield.V,
'at_potentials':[Hfield.V((-1.4*L2, 2*R)), Hfield.V((1.4*L2, 2*R))]})
print('computing contours...')
#docB.draw_scalar_field(func=Hfield.V, cmap=docB.cmap_AqYlFs, vmin=-phi0, vmax=phi0)
docB.draw_contours(func=Hfield.V, linewidth=0.8, linecolor='#555555',
levels=sc.linspace(-phi0, phi0, 17))
docB.draw_object('rect', {'x':-2.005, 'y':-1.505, 'width':4.01, 'height':3.01,
'fill':'none', 'stroke':'#aaaaaa', 'stroke-width':0.03})
docB.draw_magnets(Bfield)
docB.write()
docGrad = FieldplotDocument('VFPt_bar-magnet-forces_grad',
commons=True, width=400, height=300)
def GradH(xy):
d = 1e-6
Hx0 = vabs(Hfield.F((xy[0] - d, xy[1])))
Hx1 = vabs(Hfield.F((xy[0] + d, xy[1])))
Hy0 = vabs(Hfield.F((xy[0], xy[1] - d)))
Hy1 = vabs(Hfield.F((xy[0], xy[1] + d)))
grad = array(((Hx1 - Hx0) / (2*d), (Hy1 - Hy0) / (2*d)))
return grad
Gradfield = Field([ ['custom', {'F':GradH, 'V':lambda xy: -vabs(Hfield.F(xy))}] ])
B0 = -Gradfield.V((L2, R/2))
startpath = Startpath(Gradfield, lambda t:
array((1.6*cos(2*pi*t), 0.9*sin(2*pi*t)+0.2*sin(6*pi*t))))
nlines = 32
for iline in range(nlines):
p0 = startpath.startpos((iline + 0.5) / nlines)
line = FieldLine(Gradfield, p0, directions='both', maxr=10, bounds_func=bounds_func)
docGrad.draw_line(line, linewidth=2, arrows_style={'potential':Gradfield.V,
'at_potentials':[Gradfield.V((1.4*L2, 2*R))]})
print('computing scalar field.')
#docGrad.draw_scalar_field(func=Gradfield.V, cmap=docGrad.cmap_AqYlFs, vmin=-B0, vmax=B0)
docGrad.draw_contours(func=Gradfield.V, linewidth=0.8, linecolor='#555555',
levels=B0*sc.arange(-8.5, 0)/9)
docGrad.draw_object('rect', {'x':-2.005, 'y':-1.505, 'width':4.01, 'height':3.01,
'fill':'none', 'stroke':'#aaaaaa', 'stroke-width':0.03})
docGrad.draw_magnets(Bfield)
docGrad.write()
|
Licensing[edit]
- 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/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 19:39, 28 June 2020 | 572 × 660 (92 KB) | Geek3 (talk | contribs) | Uploaded own work with UploadWizard |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
File usage on other wikis
The following other wikis use this file:
- Usage on en.wikipedia.org
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Short title | VFPt_bar-magnet-forces |
---|---|
Image title | VFPt_bar-magnet-forces
created with VectorFieldPlot 3.2 https://commons.wikimedia.org/wiki/User:Geek3/VectorFieldPlot about: https://commons.wikimedia.org/wiki/File:VFPt_bar-magnet-forces.svg rights: Creative Commons Attribution ShareAlike 4.0 |
Width | 572 |
Height | 660 |