-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRocketPy.py
79 lines (66 loc) · 1.9 KB
/
RocketPy.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
from rocketpy import Environment, Rocket, SolidMotor, Flight
import datetime
env = Environment(
latitude=32.990254,
longitude=-106.974998,
elevation=1400,
)
tomorrow = datetime.date.today() + datetime.timedelta(days=1)
env.set_date(
(tomorrow.year, tomorrow.month, tomorrow.day, 12), timezone="America/Denver"
) # Tomorrow's date in year, month, day, hour UTC format
env.set_atmospheric_model(type='Forecast', file='GFS')
Pro75M1670 = SolidMotor(
thrust_source=10500,
dry_mass=1.815,
dry_inertia=(0.125, 0.125, 0.002),
center_of_dry_mass_position=0.317,
grains_center_of_mass_position=0.397,
burn_time=3.9,
grain_number=5,
grain_separation=0.005,
grain_density=1815,
grain_outer_radius=0.033,
grain_initial_inner_radius=0.015,
grain_initial_height=0.12,
nozzle_radius=0.033,
throat_radius=0.011,
interpolation_method="linear",
nozzle_position=0,
coordinate_system_orientation="nozzle_to_combustion_chamber",
)
calisto = Rocket(
radius=0.155/2,
mass=15, # without motor
inertia=(6.321, 6.321, 0.034),
power_off_drag=.333,
power_on_drag=.333,
center_of_mass_without_motor=0,
coordinate_system_orientation="tail_to_nose",
)
buttons = calisto.set_rail_buttons(
upper_button_position=0.0818,
lower_button_position=-0.6182,
angular_position=45,
)
calisto.add_motor(Pro75M1670, position=-1.255)
nose = calisto.add_nose(
length=0.55829, kind="vonKarman", position=1.278
)
fins = calisto.add_trapezoidal_fins(
n=4,
root_chord=0.120,
tip_chord=0.040,
span=0.100,
sweep_length=None,
cant_angle=0,
position=-1.04956,
)
tail = calisto.add_tail(
top_radius=0.0635, bottom_radius=0.0435, length=0.060, position=-1.194656
)
test_flight = Flight(
rocket=calisto, environment=env, rail_length=5.2, inclination=85, heading=0
)
test_flight.info()
test_flight.export_data("out.csv", "z", "vz")