This repository has been archived by the owner on Aug 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy paththrusters.go
159 lines (128 loc) · 4.04 KB
/
thrusters.go
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
package smd
// EPThruster defines a EPThruster interface.
type EPThruster interface {
// Returns the minimum power and voltage requirements for this EPThruster.
Min() (voltage, power uint)
// Returns the max power and voltage requirements for this EPThruster.
Max() (voltage, power uint)
// Returns the thrust in Newtons and isp consumed in seconds.
Thrust(voltage, power uint) (thrust, isp float64)
}
/* Available EPThrusters */
// PPS1350 is the Snecma EPThruster used on SMART-1.
type PPS1350 struct{}
// Min implements the EPThruster interface.
func (t *PPS1350) Min() (voltage, power uint) {
return t.Max()
}
// Max implements the EPThruster interface.
func (t *PPS1350) Max() (voltage, power uint) {
return 350, 2500
}
// Thrust implements the EPThruster interface.
func (t *PPS1350) Thrust(voltage, power uint) (thrust, isp float64) {
if voltage == 350 && power == 2500 {
return 89e-3, 1650
}
panic("unsupported voltage or power provided")
}
// PPS5000 is the latest Snecma EPThruster.
type PPS5000 struct{}
// Min implements the EPThruster interface.
func (t *PPS5000) Min() (voltage, power uint) {
return t.Max()
}
// Max implements the EPThruster interface.
func (t *PPS5000) Max() (voltage, power uint) {
return 350, 2500 // From 1350, not the actual values!
}
// Thrust implements the EPThruster interface.
func (t *PPS5000) Thrust(voltage, power uint) (thrust, isp float64) {
if voltage == 350 && power == 2500 {
return 310e-3, 1800
}
panic("unsupported voltage or power provided")
}
// BHT1500 is a Busek 1500 EPThruster.
// Below is the high thrust mode
type BHT1500 struct{}
// Min implements the EPThruster interface.
func (t *BHT1500) Min() (voltage, power uint) {
return t.Max()
}
// Max implements the EPThruster interface.
func (t *BHT1500) Max() (voltage, power uint) {
return 1, 2700 // Didn't find the voltage
}
// Thrust implements the EPThruster interface.
func (t *BHT1500) Thrust(voltage, power uint) (thrust, isp float64) {
return 179e-3, 1865
}
// BHT8000 is a Busek 1500 EPThruster.
// Below is the high thrust mode
type BHT8000 struct{}
// Min implements the EPThruster interface.
func (t *BHT8000) Min() (voltage, power uint) {
return t.Max()
}
// Max implements the EPThruster interface.
func (t *BHT8000) Max() (voltage, power uint) {
return 400, 8e3 // From datasheet
}
// Thrust implements the EPThruster interface.
func (t *BHT8000) Thrust(voltage, power uint) (thrust, isp float64) {
return 449e-3, 2210
}
// VX200 is a VASIMR 200 kW EPThruster.
// Data from http://www.adastrarocket.com/Jared_IEPC11-154.pdf
type VX200 struct{}
// Min implements the EPThruster interface.
func (t *VX200) Min() (voltage, power uint) {
return t.Max()
}
// Max implements the EPThruster interface.
func (t *VX200) Max() (voltage, power uint) {
return 1, 200e3 // Incorrect voltage
}
// Thrust implements the EPThruster interface.
func (t *VX200) Thrust(voltage, power uint) (thrust, isp float64) {
return 5.8, 4900
}
// HERMeS is based on the NASA & Rocketdyne 12.5kW demo
type HERMeS struct{}
// Min implements the EPThruster interface.
func (t *HERMeS) Min() (voltage, power uint) {
return t.Max()
}
// Max implements the EPThruster interface.
func (t *HERMeS) Max() (voltage, power uint) {
return 800, 12500
}
// Thrust implements the EPThruster interface.
func (t *HERMeS) Thrust(voltage, power uint) (thrust, isp float64) {
if voltage == 800 && power == 12500 {
return 0.680, 2960
}
panic("unsupported voltage or power provided")
}
// GenericEP is a generic EP EPThruster.
type GenericEP struct {
thrust float64
isp float64
}
// Min implements the EPThruster interface.
func (t *GenericEP) Min() (voltage, power uint) {
return 0, 0
}
// Max implements the EPThruster interface.
func (t *GenericEP) Max() (voltage, power uint) {
return 0, 0
}
// Thrust implements the EPThruster interface.
func (t *GenericEP) Thrust(voltage, power uint) (thrust, isp float64) {
return t.thrust, t.isp
}
// NewGenericEP returns a generic electric prop EPThruster.
func NewGenericEP(thrust, isp float64) *GenericEP {
return &GenericEP{thrust, isp}
}