Перейти на страницу файла на Викискладе

Файл:VFPt horseshoe-magnet.svg

Материал из Википедии — свободной энциклопедии
Перейти к навигации Перейти к поиску

Исходный файл(SVG-файл, номинально 600 × 600 пкс, размер файла: 40 Кб)

Краткое описание

Описание
English: Drawing of a horseshoe magnet with precisely computed magnetic field lines. The horseshoe magnet is assumed as a curved cylindrical rod with constant magnetisation along the cylinder axis. North- and southpole of the magnet are marked in red and green, respectively. The shape of the magnetic field is computed as follows: H- and B-field are identical in free space, so we can choose the easier one, which is the H-field. The H-field has its sources and sinks where the lines of the magnetisation end and begin. Thus, the correct field is obtained by placing magnetic charges at the surfaces of the two magnetic poles. The field of a charge disc distribution is obtained by numerical integration. The shape of the field lines is traced with a Runge-Kutta algorithm. The density of field lines corresponds roughly to the field strength, however due to 3D variations of the field, this cannot exactly be fulfilled.
Note that in measured field distributions, e.g. using magnetised iron filings the field shape in the lower part of the image (where the magnet is bent) may somewhat differ. This is because the total field strength is very weak there. Therefore any inhomogeneity in the magnetisation can strongly alter the field direction.
Дата
Источник Собственная работа
Автор Geek3
SVG‑разработка
InfoField
 
Исходный код этого SVG-файла корректен.
 
Это plot было создано с помощью VectorFieldPlot
 
Этот файл использует встроенный текст.

العربية  جازايرية  беларуская  беларуская (тарашкевіца)  български  বাংলা  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  中文  中文(简体)  中文(繁體)  +/−

Исходный код
InfoField

Python code

# paste this code at the end of VectorFieldPlot 3.0
doc = FieldplotDocument('VFPt_horseshoe-magnet', commons=True,
    width=600, height=600)

x0, y0 = 0.0, -1.0
h = 2.0
R = 1.0
r = 0.3

# Note: The H-field of a magnet with constant profile and magnetization
# is exactly equal to the one created by magnetic surface charges
# at the ends of the magnet. In this case the ends are round discs.
field = Field([
    ['charged_disc', {'x0':x0-R-r, 'y0':y0+h, 'x1':x0-R+r, 'y1':y0+h, 'Q':-1}],
    ['charged_disc', {'x0':x0+R-r, 'y0':y0+h, 'x1':x0+R+r, 'y1':y0+h, 'Q':1}] ])

nlines = 24
def startp(t):
    return sc.array([x0 + R - R*cos(t*2*pi), y0 + h + R*sin(t*2*pi)])
startpoints = Startpath(field, startp).npoints(nlines)

for iline, p0 in enumerate(startpoints):
    line = FieldLine(field, p0, directions='both', maxr=1000)
    fe = {'start':True, 'leave_image':False, 'enter_image':False, 'end':True}
    if iline in [0, 1, 2, nlines-1, nlines-2, nlines-3]:
        fe['start'] = fe['end'] = False
    min_arrows = 1
    if iline == nlines - 7:
        min_arrows = 3
    doc.draw_line(line, arrows_style={
                  'dist':2.0, 'fixed_ends':fe, 'min_arrows':min_arrows})

# draw a horseshoe magnet with color gradients
g = doc.draw_object('g', {'id':'horseshoe',
    'transform':'translate({},{})'.format(x0, y0)})
defs = doc.draw_object('defs', {}, group=g)
grad_col = ['#000000', '#ffffff', '#ffffff', '#ffffff', '#000000']
grad_offs = sc.array([0, 0.07, 0.25, 0.6, 1])
grad_opa = sc.array([0.125, 0.125, 0.5, 0.2, 0.33])
grad1 = doc.draw_object('linearGradient', {'id':'grad1', 'x1':'0',
    'x2':'1', 'y1':'0', 'y2':'0', 'gradientUnits':'objectBoundingBox'},
    group=defs)
for col, of, opa in zip(grad_col, grad_offs, grad_opa):
    stop = doc.draw_object('stop', {'stop-color':col, 'offset':of,
        'stop-opacity':opa}, group=grad1)
grad2 = doc.draw_object('radialGradient', {'id':'grad2', 'r':str(R+r),
    'cx':'0', 'cy':'0', 'fx':'0', 'fy':'0',
    'gradientUnits':'userSpaceOnUse'}, group=defs)
for col, of, opa in sorted(zip(grad_col, 1-grad_offs*2.*r/(R+r), grad_opa),
                           key=lambda x: x[1]):
    stop = doc.draw_object('stop', {'stop-color':col, 'offset':of,
        'stop-opacity':opa}, group=grad2)
grad3 = doc.draw_object('radialGradient', {'id':'grad3', 'r':str(R+r),
    'cx':'0', 'cy':'0', 'fx':'0', 'fy':'0',
    'gradientUnits':'userSpaceOnUse'}, group=defs)
for col, of, opa in zip(grad_col, (R-r)/(R+r)+grad_offs*2.*r/(R+r), grad_opa):
    stop = doc.draw_object('stop', {'stop-color':col, 'offset':of,
        'stop-opacity':opa}, group=grad3)
grad4 = doc.draw_object('linearGradient', {'id':'grad4', 'x1':str(-R-r),
    'x2':str(R+r), 'y1':'0', 'y2':'0', 'gradientUnits':'userSpaceOnUse'},
    group=defs)
for col, of, opa in [['#ffffff', '0', '1'], ['#ffffff', str(r/(R+r)), '1'],
        ['#ffffff', str(R/(R+r)), '0'], ['#ffffff', '1', '0']]:
    stop = doc.draw_object('stop', {'stop-color':col, 'offset':of,
        'stop-opacity':opa}, group=grad4)
mask4 = doc.draw_object('mask', {'id':'mask4', 'maskContentUnits':'userSpaceOnUse'}, group=defs)
doc.draw_object('rect', {'x':str(-R-r), 'y':str(-R-r), 'width':str(2*(R+r)),
    'height':str(R+r), 'style':'fill:url(#grad4); stroke:none;'}, group=mask4)
grad5 = doc.draw_object('linearGradient', {'id':'grad5', 'x1':str(-R-r),
    'x2':str(R+r), 'y1':'0', 'y2':'0', 'gradientUnits':'userSpaceOnUse'},
    group=defs)
for col, of, opa in [['#ffffff', '0', '0'], ['#ffffff', str(r/(R+r)), '0'],
        ['#ffffff', str(R/(R+r)), '1'], ['#ffffff', '1', '1']]:
    stop = doc.draw_object('stop', {'stop-color':col, 'offset':of,
        'stop-opacity':opa}, group=grad5)
mask5 = doc.draw_object('mask', {'id':'mask5', 'maskContentUnits':'userSpaceOnUse'}, group=defs)
doc.draw_object('rect', {'x':str(-R-r), 'y':str(-R-r), 'width':str(2*(R+r)),
    'height':str(R+r), 'style':'fill:url(#grad5); stroke:none;'}, group=mask5)

d = ('M {},{} L {},{} L {},{} A {},{} {} {} {} {},{} L {},{} L {},{} ' +
     'L {},{} A {},{} {} {} {} {},{} L {},{} Z').format(-R-r, h,
     -R+r, h, -R+r, 0, R-r, R-r, 0, 0, 1, R-r, 0, R-r, h, R+r, h, R+r, 0,
     R+r, R+r, 0, 0, 0, -R-r, 0, -R-r, h)
doc.draw_object('path', {'d':d, 'style':'fill:#ff0000; ' +
     'stroke:none;'}, group=g)
d = ('M {},{} L {},{} L {},{} A {},{} {} {} {} {},{} ' +
     'L {},{} A {},{} {} {} {} {},{} L {},{} Z').format(-R-r, h,
     -R+r, h, -R+r, 0, R-r, R-r, 0, 0, 1, 0, -R+r, 0, -R-r,
    R+r, R+r, 0, 0, 0, -R-r, 0, -R-r, h)
doc.draw_object('path', {'d':d, 'style':'fill:#00cc00;stroke:none;'},
    group=g)
d = ('M {},{} L {},{} L {},{} L {},{} L {},{} Z').format(-R-r, h,
     -R+r, h, -R+r, 0, -R-r, 0, -R-r, h)
doc.draw_object('path', {'d':d, 'style':'fill:url(#grad1);stroke:none;'},
    group=g)
d = ('M {},{} L {},{} L {},{} L {},{} L {},{} Z').format(R-r, h,
     R+r, h, R+r, 0, R-r, 0, R-r, h)
doc.draw_object('path', {'d':d, 'style':'fill:url(#grad1);stroke:none;'},
    group=g)
d = ('M {},{} L {},{} A {},{} {} {} {} {},{} ' +
     'L {},{} A {},{} {} {} {} {},{} Z').format(-R-r, 0, -R+r, 0,
    R-r, R-r, 0, 0, 1, R-r, 0, R+r, 0, R+r, R+r, 0, 0, 0, -R-r, 0)
doc.draw_object('path', {'d':d, 'style':'fill:url(#grad2);stroke:none;',
    'mask':'url(#mask4)'}, group=g)
d = ('M {},{} L {},{} A {},{} {} {} {} {},{} ' +
    'L {},{} A {},{} {} {} {} {},{} Z').format(-R-r, 0, -R+r, 0,
    R-r, R-r, 0, 0, 1, R-r, 0, R+r, 0, R+r, R+r, 0, 0, 0, -R-r, 0)
doc.draw_object('path', {'d':d, 'style':'fill:url(#grad3);stroke:none;',
    'mask':'url(#mask5)'}, group=g)
d = ('M {},{} L {},{} L {},{} A {},{} {} {} {} {},{} L {},{} L {},{} ' +
    'L {},{} A {},{} {} {} {} {},{} L {},{} Z').format(-R-r, h,
    -R+r, h, -R+r, 0, R-r, R-r, 0, 0, 1, R-r, 0, R-r, h, R+r, h, R+r, 0,
    R+r, R+r, 0, 0, 0, -R-r, 0, -R-r, h)
doc.draw_object('path', {'d':d, 'style':'fill:none; ' +
     'stroke:#000000; stroke-width:0.04;'}, group=g)

text_N = doc.draw_object('text', {'text-anchor':'middle', 'x':'0', 'y':'0',
    'transform':'translate({},{}) scale({},{})'.format(R, h-0.6, 0.04, -0.04),
    'style':'fill:#000000; stroke:none; ' +
    'font-size:12px; font-family:Bitstream Vera Sans;'}, group=g)
text_N.text = 'N'
text_S = doc.draw_object('text', {'text-anchor':'middle', 'x':'0', 'y':'0',
    'transform':'translate({},{}) scale({},{})'.format(-R, h-0.6, 0.04, -0.04),
    'style':'fill:#000000; stroke:none; ' +
    'font-size:12px; font-family:Bitstream Vera Sans;'}, group=g)
text_S.text = 'S'

doc.write()

Лицензирование

Я, владелец авторских прав на это произведение, добровольно публикую его на условиях следующей лицензии:
w:ru:Creative Commons
атрибуция распространение на тех же условиях
Этот файл доступен по лицензии Creative Commons Attribution-Share Alike 4.0 International
Вы можете свободно:
  • делиться произведением – копировать, распространять и передавать данное произведение
  • создавать производные – переделывать данное произведение
При соблюдении следующих условий:
  • атрибуция – Вы должны указать авторство, предоставить ссылку на лицензию и указать, внёс ли автор какие-либо изменения. Это можно сделать любым разумным способом, но не создавая впечатление, что лицензиат поддерживает вас или использование вами данного произведения.
  • распространение на тех же условиях – Если вы изменяете, преобразуете или создаёте иное произведение на основе данного, то обязаны использовать лицензию исходного произведения или лицензию, совместимую с исходной.

Краткие подписи

Добавьте однострочное описание того, что собой представляет этот файл

Элементы, изображённые на этом файле

изображённый объект

horseshoe magnet английский

У этого свойства есть некоторое значение без элемента в

image/svg+xml

История файла

Нажмите на дату/время, чтобы посмотреть файл, который был загружен в тот момент.

Дата/времяМиниатюраРазмерыУчастникПримечание
текущий18:03, 7 июля 2018Миниатюра для версии от 18:03, 7 июля 2018600 × 600 (40 Кб)Geek3User created page with UploadWizard

Следующая страница использует этот файл:

Глобальное использование файла

Данный файл используется в следующих вики:

Метаданные