无标题文章

Created on Sat Nov 26 23:04:26 2016

@author: xiongyiheng

"""

import math

import matplotlib.pyplot as plt

GM=4*(math.pi**2)

perihelion=0.39*(1-0.206)

class Precession:

 def __init__(self,e=0.206,time=1,dt=0.0001,vcoefficient=1.1,beta=2.1,alpha=0.01):

 self.alpha=alpha

 self.beta=beta

 self.vcoefficient=vcoefficient

 self.e=e

 self.a=perihelion/(1-e)

 self.x0=self.a*(1+e)

 #self.x0=1

 self.y0=0

 self.vx0=0

 self.vy0=self.vcoefficient*math.sqrt((GM*(1-self.e))/(self.a*(1+self.e)))

 #self.vy0=2*math.pi

 self.X=[self.x0]

 self.Y=[self.y0]

 self.Vx=[self.vx0]

 self.Vy=[self.vy0]

 self.T=[0]

 self.dt=dt

 self.time=time

 self.ThetaPrecession=[]

 self.TimePrecession=[]

 def run(self):

 while self.T[-1]

你可能感兴趣的:(无标题文章)