파일:VFPt metal balls largesmall potential.svg

testwiki
둘러보기로 이동 검색으로 이동
    원본 파일 (SVG 파일, 실제 크기 800 × 600 픽셀, 파일 크기: 156 KB)

    이 파일은 위키미디어 공용에 있으며, 다른 프로젝트에서 사용하고 있을 가능성이 있습니다. 해당 파일에 대한 설명이 아래에 나와 있습니다.

    파일 설명

    설명
    English: Electric field around a large and a small conducting sphere at opposite electric potential. The shape of the field lines is computed exactly, using the method of image charges with an infinite series of charges inside the two spheres. Field lines are always orthogonal to the surface of each sphere. In reality, the field is created by a continuous charge distribution at the surface of each sphere, indicated by small plus and minus signs. The electric potential is depicted as background color with yellow at 0V.
    날짜
    출처 자작
    저자 Geek3
    다른 버전
    SVG 발전
    InfoField
     이 SVG 파일의 소스 코드를 VectorFieldPlot가지의 실수입니다.
     이 W3C-무효 벡터 그림은 Inkscape(으)로 제작되었습니다, or with something else.
     이 SVG 파일은 내장된 문자열을 사용하고 있습니다.
    이 그림은 고화질 그림 지침에 적합한 것으로 인정을 받아 선정된 고화질 그림입니다.

    العربية ∙ جازايرية ∙ беларуская ∙ беларуская (тарашкевіца) ∙ български ∙ বাংলা ∙ català ∙ čeština ∙ Cymraeg ∙ Deutsch ∙ Schweizer Hochdeutsch ∙ Zazaki ∙ Ελληνικά ∙ English ∙ Esperanto ∙ español ∙ eesti ∙ euskara ∙ فارسی ∙ suomi ∙ français ∙ galego ∙ עברית ∙ हिन्दी ∙ hrvatski ∙ magyar ∙ հայերեն ∙ Bahasa Indonesia ∙ italiano ∙ 日本語 ∙ Jawa ∙ ქართული ∙ Qaraqalpaqsha ∙ 한국어 ∙ kurdî ∙ кыргызча ∙ Latina ∙ 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 ∙ toki pona ∙ Türkçe ∙ українська ∙ oʻzbekcha / ўзбекча ∙ vèneto ∙ Tiếng Việt ∙ 中文 ∙ 中文(简体) ∙ 中文(繁體) ∙ +/−

    소스 코드
    InfoField

    SVG code

    # paste this code at the end of VectorFieldPlot 1.10
    # https://commons.wikimedia.org/wiki/User:Geek3/VectorFieldPlot
    u = 100.0
    doc = FieldplotDocument('VFPt_metal_balls_largesmall_potential',
        commons=True, width=800, height=600, center=[400, 300], unit=u)
    
    # define two spheres with position, radius and charge
    s1 = {'p':sc.array([-1.0, 0.]), 'r':1.5}
    s2 = {'p':sc.array([2.0, 0.]), 'r':0.5}
    
    # make charge proportional to capacitance, which is proportional to radius.
    s1['q'] = s1['r']
    s2['q'] = -s2['r']
    d = vabs(s2['p'] - s1['p'])
    v12 = (s2['p'] - s1['p']) / d
    
    # compute series of charges https://dx.doi.org/10.2174/1874183500902010032
    charges = [[s1['p'][0], s1['p'][1], s1['q']], [s2['p'][0], s2['p'][1], s2['q']]]
    r1 = r2 = 0.
    q1, q2 = s1['q'], s2['q']
    q0 = max(fabs(q1), fabs(q2))
    for i in range(10):
        q1, q2 = -s1['r'] * q2 / (d - r2), -s2['r'] * q1 / (d - r1), 
        r1, r2 = s1['r']**2 / (d - r2), s2['r']**2 / (d - r1)
        p1, p2 = s1['p'] + r1 * v12, s2['p'] - r2 * v12
        charges.append([p1[0], p1[1], q1])
        charges.append([p2[0], p2[1], q2])
        if max(fabs(q1), fabs(q2)) < 1e-3 * q0:
            break
    
    field = Field({'monopoles':charges})
    
    # draw potential in background
    p_array = sc.array([c[:2] for c in charges])
    q_array = sc.array([c[2] for c in charges])
    def potential(xy):
        return sc.dot(q_array, 1. / sc.linalg.norm(xy - p_array, axis=1))
    
    from matplotlib import colors
    # colormap from aqua through yellow to fuchsia
    cmap = colors.ListedColormap([sc.clip((2*x, 2*(1-x), 4*(x-0.5)**2), 0, 1)
        for x in sc.linspace(0., 1., 2048)])
    
    doc.draw_scalar_field(func=potential, cmap=cmap,
        vmin=potential(s2['p'] + s2['r'] * sc.array([1., 0.])),
        vmax=potential(s1['p'] + s1['r'] * sc.array([-1., 0.])))
    
    # draw symbols
    for c in charges:
        doc.draw_charges(Field({'monopoles':[c]}), scale=0.6*sqrt(fabs(c[2])))
    
    gradr = doc.draw_object('linearGradient', {'id':'rod_shade', 'x1':0, 'x2':0,
        'y1':0, 'y2':1, 'gradientUnits':'objectBoundingBox'}, group=doc.defs)
    for col, of in (('#666', 0), ('#ddd', 0.6), ('#fff', 0.7), ('#ccc', 0.75),
        ('#888', 1)):
        doc.draw_object('stop', {'offset':of, 'stop-color':col}, group=gradr)
    gradb = 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=doc.defs)
    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=gradb)
    
    ball_charges = []
    for ib in range(2):
        ball = doc.draw_object('g', {'id':'metal_ball{:}'.format(ib+1),
            'transform':'translate({:.3f},{:.3f})'.format(*([s1, s2][ib]['p'])),
            'style':'fill:none; stroke:#000;stroke-linecap:square', 'opacity':1})
        
        # draw rods
        if ib == 0:
            x1, x2 = -4.1 - s1['p'][0], -0.9 * s1['r']
        else:
            x1, x2 = 0.9 * s2['r'], 4.1 - s2['p'][0]
        doc.draw_object('rect', {'x':x1, 'width':x2-x1,
            'y':-0.1/1.2+0.01, 'height':0.2/1.2-0.02,
            'style':'fill:url(#rod_shade); stroke-width:0.02'}, group=ball)
        
        # draw metal balls
        doc.draw_object('circle', {'cx':0, 'cy':0, 'r':[s1, s2][ib]['r'],
            'style':'fill:url(#metal_spot); stroke-width:0.02'}, group=ball)
        ball_charges.append(doc.draw_object('g',
            {'style':'stroke-width:0.02'}, group=ball))
    
    # find well-distributed start positions of field lines
    def get_startpoint_function(startpath, field):
        '''
        Given a vector function startpath(t), this will return a new
        function such that the scalar parameter t in [0,1] progresses
        indirectly proportional to the orthogonal field strength.
        '''
        def dstartpath(t):
            return (startpath(t+1e-6) - startpath(t-1e-6)) / 2e-6
        def FieldSum(t0, t1):
            return ig.quad(lambda t: sc.absolute(sc.cross(
                field.F(startpath(t)), dstartpath(t))), t0, t1)[0]
        Ftotal = FieldSum(0, 1)
        def startpos(s):
            t = op.brentq(lambda t: FieldSum(0, t) / Ftotal - s, 0, 1)
            return startpath(t)
        return startpos
    
    startp = []
    def startpath1(t):
        phi = 2. * pi * t
        return (sc.array(s2['p']) + 1.5 * sc.array([cos(phi), sin(phi)]))
    start_func1 = get_startpoint_function(startpath1, field)
    nlines1 = 16
    for i in range(nlines1):
        startp.append(start_func1((0.5 + i) / nlines1))
    
    def startpath2(t):
        phi = 2. * pi * (0.195 + 0.61 * t)
        return (sc.array(s1['p']) + 1.5 * sc.array([cos(phi), -sin(phi)]))
    start_func2 = get_startpoint_function(startpath2, field)
    nlines2 = 14
    for i in range(nlines2):
        startp.append(start_func2((0.5 + i) / nlines2))
    
    # draw the field lines
    for p0 in startp:
        line = FieldLine(field, p0, directions='both', maxr=7.)
        
        # draw little charge signs near the surface
        path_minus = 'M {0:.5f},0 h {1:.5f}'.format(-2./u, 4./u)
        path_plus = 'M {0:.5f},0 h {1:.5f} M 0,{0:.5f} v {1:.5f}'.format(-2./u, 4./u)
        for si in range(2):
            sphere = [s1, s2][si]
            
            # check if fieldline ends inside the sphere
            for ci in range(2):
                if vabs(line.get_position(ci) - sphere['p']) < sphere['r']:
                    # find the point where the field line cuts the surface
                    t = op.brentq(lambda t: vabs(line.get_position(t)
                        - sphere['p']) - sphere['r'], 0., 1.)
                    pr = line.get_position(t) - sphere['p']
                    cpos = 0.9 * sphere['r'] * pr / vabs(pr)
                    doc.draw_object('path', {'stroke':'black', 'd':
                        [path_plus, path_minus][ci],
                        'transform':'translate({:.5f},{:.5f})'.format(
                            round(u*cpos[0])/u, round(u*cpos[1])/u)},
                            group=ball_charges[si])
        
        arrow_d = 2.0
        of = [0.5 + s1['r'] / arrow_d, 0.5, 0.5, 0.5 + s2['r'] / arrow_d]
        doc.draw_line(line, arrows_style={'dist':arrow_d, 'offsets':of})
    doc.write()
    

    라이선스

    나는 아래 작품의 저작권자로서, 이 저작물을 다음과 같은 라이선스로 배포합니다:
    w:ko:크리에이티브 커먼즈
    저작자표시 동일조건변경허락
    이용자는 다음의 권리를 갖습니다:
    • 공유 및 이용 – 저작물의 복제, 배포, 전시, 공연 및 공중송신
    • 개작 – 저작물의 개작, 수정, 2차적저작물 창작
    다음과 같은 조건을 따라야 합니다:
    • 저작자표시 – 적절한 저작자 표시를 제공하고, 라이선스에 대한 링크를 제공하고, 변경사항이 있는지를 표시해야 합니다. 당신은 합리적인 방식으로 표시할 수 있지만, 어떤 방식으로든 사용권 허가자가 당신 또는 당신의 사용을 지지하는 방식으로 표시할 수 없습니다.
    • 동일조건변경허락 – 만약 당신이 이 저작물을 개작 또는 변형하거나 이 저작물을 기반으로 제작하는 경우, 당신은 당신의 기여물을 원저작물과 동일하거나 호환 가능한 라이선스에 따라 배포하여야 합니다.

    설명

    이 파일이 나타내는 바에 대한 한 줄 설명을 추가합니다

    이 파일에 묘사된 항목

    다음을 묘사함

    image/svg+xml

    159,303 바이트

    18868526deda94646bb358d76b3c40030ff16194

    파일 역사

    날짜/시간 링크를 클릭하면 해당 시간의 파일을 볼 수 있습니다.

    날짜/시간섬네일크기사용자설명
    현재2018년 12월 30일 (일) 21:052018년 12월 30일 (일) 21:05 판의 섬네일800 × 600 (156 KB)wikimediacommons>Geek3User created page with UploadWizard

    이 파일을 사용하는 문서가 없습니다.