题目
如图所示,均匀的细圆环半径为$R$,质量为$M$,在中心轴上距环中心$d$处有一质量为$m$的天体,则:
(1).物体$m$受圆环的万有引力$F$如何?
(2).若$R>>d$时,则$F$为多大?若细圆环固定,将物体$m$从某一位置释放会如何运动?
程序演示
程序源码
G= 2000;M = 1.0;m = 1.0;R = 10;dt = 0.0001;t = 0;balllist=[];r=[]
scene = canvas(width=300, height=300,
background=vector(0.9,0.9,0.9),center=vector(0,2,0))
ball = sphere(pos=vector(0,1,0),
radius = 0.9, color=color.green,make_trail=0.01)
ball.v = vector(0,0,0)
def Fn(r):
return-(G*M*m*(r)/mag(r)**3)
for N in range(0,360,1):
balllist.append(sphere(pos=vector(R*cos(N*pi/180),0,R*sin(N*pi/180)),
radius = 0.1, color=color.blue))
r.append(arrow(pos=balllist[N].pos,shaftwidth=0.0001))
figure=graph(title="v-t图像",width=200, height=200,
xtitle="t/(s)",ytitle="速度/(m/s)")
vyt=gcurve(graph=figure,color=color.red)
while t<1.5:
t += dt
rate (1000)
a=[]
for b in range(0,360,1):
r[b].axis = ball.pos-r[b].pos
for q in range(0,360,1):
a.append(Fn(r[q].axis)/m)
a_sum = vector(0,0,0)
for c in range(0,360,1):
a_sum += a[c]
ball.v += a_sum*dt
ball.pos = ball.pos + ball.v*dt
vyt.plot(t,ball.v.y)
评论 (0)