@francisnoopy
2016-12-04T14:50:41.000000Z
字数 1832
阅读 86
Excercise 11
Chaotic tumbling of hyperion
摘要
在我们的太阳系中大部分行星都有卫星,一些大的行星比如土星和木星甚至有很多个卫星。大多数卫星的运动如地球的卫星月球一样与主星是同步的,轨道几乎是稳定的球形。但也有一个例外,它的运动是混沌的,这就是我们将要研究的————Hyperion,土卫七,据此解决4.19,4.20.
背景
Hyperion
Hyperion是土星一颗较小的卫星,它的质量与地球相比只相当于1%。它的形状十分特殊,事实上它是太阳系中最大的不规则天体。
“太空海綿”:卡西尼飛船拍攝的土衛七。這顆衛星直徑410公里*260公里。照片拍攝時卡西尼飛船距離土衛七約6.2萬公里。
正文
使用Eulur-Chormer方法
代码:
import matplotlib.pyplot as plt
import math
class hyperion:
def init(self,GM=4*math.pi**2,dt=0.0001,time=10):
self.x=[1]
self.y=[0]
self.vx=[0]
self.vy=[5]
self.dt=dt
self.time=time
self.r=[math.sqrt(self.x[0]**2+self.y[0]**2)]
self.t=[0]
self.w=[0]
self.theta=[0]
def calculate(self):
for i in range(int(self.time//self.dt)):
self.vx.append(self.vx[i]-self.GM*self.x[i]*self.dt/self.r[i]**3)
self.vy.append(self.vy[i]-self.GM*self.y[i]*self.dt/self.r[i]**3)
self.x.append(self.x[i]+self.vx[i+1]*self.dt)
self.y.append(self.y[i]+self.vy[i+1]*self.dt)
self.r.append(math.sqrt(self.x[i+1]**2+self.y[i+1]**2))
self.w.append(self.w[i]-3*self.GM/self.r[i]**5*(self.x[i]*math.sin(self.theta[i])-self.y[i]math.cos(self.theta[i]))(self.x[i]*math.cos(self.theta[i])+self.y[i]*math.sin(self.theta[i]))*self.dt)
self.theta.append(self.theta[i]+self.w[i+1]*self.dt)
self.t.append(self.t[i]+self.dt)
if self.theta[i+1]<-math.pi:
self.theta[i+1]=self.theta[i+1]+2*math.pi
if self.theta[i+1]>math.pi:
self.theta[i+1]=self.theta[i+1]-2*math.pi
def show_results(self,color):
ax1=plt.subplot(121)
ax2=plt.subplot(122)
plt.sca(ax1)
plt.plot(self.t,self.theta,'b')
plt.title(r' versus time',fontsize=14)
plt.xlabel(u't/yr',fontsize=14)
plt.ylabel(r'/radians',fontsize=14)
plt.sca(ax2)
plt.plot(self.t,self.w,'b')
plt.title(r' versus time',fontsize=14)
plt.xlabel(u't/yr',fontsize=14)
plt.ylabel(u'/radians/yr',fontsize=14)
plt.legend(fontsize=14,loc='best')
a=hyperion()
a.calculate()
a.show_results('b')
plt.show()
参考
计算物理 Nicholas J.Giordano, Hisao Nakanishi
Wikipedia