-
Notifications
You must be signed in to change notification settings - Fork 0
/
model.py
101 lines (80 loc) · 2.13 KB
/
model.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# This file defines constants and parameters
# constants are fetched from https://nssdc.gsfc.nasa.gov/planetary/planetfact.html
import numpy as np
#
# elements:
# numpy.array:
# 0 - Semi-Major Axis (a)
# 1 - Eccentricity (e)
# 2 - Inclination (i)
# 3 - Right Ascension Point (ap)
# 4 - Perigee (omega)
# 5 - Mean Anomaly (M)
#
#
# constant parameters of the prediction
#
# Coefficient of the Gravity
G = 6.67384E-11
AU = 1.496E+11
### Satellite Parameters:
# mass of the satellite
mass = 685.2 # kg
# drag coefficient: used in calculation of atmosphere drag force
cd = 2.2
# net sectional area: used in calculations of atmosphere drag and solar radiation pressure. Considered 1/4 of the total surface area.
sd = 3.63 # m^2
# reflective coefficient of the satellite, used in solar radiation pressure, usually between 1.0 ~ 1.44
cr = 1.44
### Earth Parameters:
# mass of the earth
Mass = 5.9723E+24 # kg
GM = 0.3986004415E+15
# mean radius of the earth
R = 0.6378136300E+07 # m
# J2 coefficient of the earth
J2 = 1.0826361E-3
# rotate angular speed of the earth
rotate = 7.2921159E-5 # rad/s
# atmosphere parameter:
A = 1.3 # kg/m3
H = 8E+3 # m
### Sun Parameters:
# mass of the Sun
ms = 1.9885E+30 # kg
Gms = 1.32712E+20
# coefficient of Sun shine
sr = 4.560e-6
### Moon Parameters:
# mass of the Moon
mm = 7.346E+22 # kg
Gmm = 4.9E+12
#
# temperary variables
# updated in predict.change()
class var:
# position vector of the satellite
r = np.zeros(3) # m
# velocity vector of teh satellite
v = np.zeros(3) # m/s
# Semi-latus Rectum
p = 0.0 # m
# Laplace Vector
e = np.zeros(3)
# h Vector
h = np.zeros(3)
# True Anomaly
f = 0.0 # rad
# Change rate of Mean Anomaly
nc = 0.0 # rad/s
# Eccentrical Anomaly
Ec = 0.0 # rad
def __init__(self, r, v, p, e, h, f, nc, Ec):
self.r = r
self.v = v
self.p = p
self.e = e
self.h = h
self.f = f
self.nc = nc
self.Ec = Ec