program don`t running

22 views
Skip to first unread message

green

unread,
Dec 4, 2016, 12:04:00 AM12/4/16
to VPython-users
# -*- coding: cp949 -*-
#작은 전류 요소에 의한 자기장
#저자: 
#날짜: 2016-12-01

from visual import *
scene.height = scene.width = 800
L = 5.e-9
scene.range = L

#상수
m_const = 1.e-7 #자기 상수

#작은 전류 요소

source_current = 1.   #전류(암페어)
source_axis = vector(0, 0.01*L, 0) #dl 벡터
source_pos = vector(0,-10*L,0) #위치
curve(pos=[(0, -10.*L, 0),(0, 10.*L, 0)], color=color.green)#dl 방향 연장선


#관찰 위치
obs_radius = 0.4*L #관찰 위치 반지름
d_theta = pi/3.
length = 2*L #자기장을 그릴 전체 거리
obs_y = -10*L #최초 관찰 위치 y 좌표
dy = L/10. #관찰 위치 증가분
obs = [source_pos] #관찰 위치 리스트
obs1 = source_pos
while obs_y < 10*L:
    obs1.y += dy
    obs.append(obs1)

I made this source, but It doesn`t running. I think 'while' is problem, but I don`t know the reason. What is problem?
   

Kevin Karplus

unread,
Dec 4, 2016, 12:48:22 AM12/4/16
to vpytho...@googlegroups.com
I don't see a "rate" call within the while loop.

Kevin Karplus   kar...@soe.ucsc.edu    http://www.soe.ucsc.edu/~karplus
Professor of Biomolecular Engineering, University of California, Santa Cruz
Affiliations for identification only.

--
You received this message because you are subscribed to the Google Groups "VPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bruce Sherwood

unread,
Dec 4, 2016, 10:24:33 AM12/4/16
to VPython-users
Also, you continually add positions to the list named "obs" but you don't make any changes to the curve object.
Reply all
Reply to author
Forward
0 new messages