Skip to content

Commit 631f46e

Browse files
committed
ENH: add burn_start_time and burn_out_time to mcsolidmotor
1 parent 290b43d commit 631f46e

File tree

2 files changed

+23
-28
lines changed

2 files changed

+23
-28
lines changed

docs/notebooks/dispersion_analysis/dispersion_class_usage.ipynb

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,9 @@
1919
},
2020
{
2121
"cell_type": "code",
22-
"execution_count": 3,
22+
"execution_count": 1,
2323
"metadata": {},
24-
"outputs": [
25-
{
26-
"name": "stdout",
27-
"output_type": "stream",
28-
"text": [
29-
"The autoreload extension is already loaded. To reload it, use:\n",
30-
" %reload_ext autoreload\n"
31-
]
32-
}
33-
],
24+
"outputs": [],
3425
"source": [
3526
"%load_ext autoreload\n",
3627
"%autoreload 2"
@@ -46,7 +37,7 @@
4637
},
4738
{
4839
"cell_type": "code",
49-
"execution_count": 4,
40+
"execution_count": 2,
5041
"metadata": {},
5142
"outputs": [],
5243
"source": [
@@ -75,7 +66,7 @@
7566
},
7667
{
7768
"cell_type": "code",
78-
"execution_count": 5,
69+
"execution_count": 3,
7970
"metadata": {},
8071
"outputs": [],
8172
"source": [
@@ -116,7 +107,7 @@
116107
},
117108
{
118109
"cell_type": "code",
119-
"execution_count": 6,
110+
"execution_count": 4,
120111
"metadata": {},
121112
"outputs": [],
122113
"source": [
@@ -133,24 +124,25 @@
133124
},
134125
{
135126
"cell_type": "code",
136-
"execution_count": 7,
127+
"execution_count": 5,
137128
"metadata": {},
138129
"outputs": [
139130
{
140131
"data": {
141132
"text/plain": [
142-
"object: <rocketpy.environment.environment.Environment object at 0x00000242D3055D30>\n",
133+
"object: <rocketpy.environment.environment.Environment object at 0x0000021119D58200>\n",
143134
"elevation: [113]\n",
144135
"gravity: ['Function from R1 to R1 : (height (m)) → (gravity (m/s²))']\n",
145136
"latitude: [39.3897]\n",
146137
"longitude: [-8.288964]\n",
147138
"wind_velocity_x_factor: 1.00000 ± 0.33000 (numpy.random.normal)\n",
148139
"wind_velocity_y_factor: 1.00000 ± 0.33000 (numpy.random.normal)\n",
149-
"date: [(2023, 12, 10, 12)]\n",
140+
"datum: ['SIRGAS2000']\n",
141+
"timezone: ['UTC']\n",
150142
"ensemble_member: [0, 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]"
151143
]
152144
},
153-
"execution_count": 7,
145+
"execution_count": 5,
154146
"metadata": {},
155147
"output_type": "execute_result"
156148
}
@@ -168,14 +160,14 @@
168160
},
169161
{
170162
"cell_type": "code",
171-
"execution_count": 8,
163+
"execution_count": 6,
172164
"metadata": {},
173165
"outputs": [
174166
{
175167
"name": "stdout",
176168
"output_type": "stream",
177169
"text": [
178-
"[5.4868565741227835, 3.4970766908409914, 5.3253588908900245, 4.059176104591607, 4.215612011141973, 4.502052604362678, 4.74317323047254, 4.543846316731022, 4.215612011141973, 4.46569593156061]\n"
170+
"[6.945158633629927, 8.580629399795324, 6.090321529581044, 8.29507654713753, 8.164411035755625, 9.57486298213925, 7.747329947135309, 6.878299591656838, 7.149819236691613, 8.750910295481544]\n"
179171
]
180172
}
181173
],
@@ -207,7 +199,7 @@
207199
},
208200
{
209201
"cell_type": "code",
210-
"execution_count": 9,
202+
"execution_count": 7,
211203
"metadata": {},
212204
"outputs": [
213205
{
@@ -216,7 +208,7 @@
216208
"6026.35"
217209
]
218210
},
219-
"execution_count": 9,
211+
"execution_count": 7,
220212
"metadata": {},
221213
"output_type": "execute_result"
222214
}
@@ -251,10 +243,11 @@
251243
{
252244
"data": {
253245
"text/plain": [
254-
"object: <rocketpy.motors.solid_motor.SolidMotor object at 0x00000242D3DA2330>\n",
246+
"object: <rocketpy.motors.solid_motor.SolidMotor object at 0x00000211196A1970>\n",
255247
"thrust_source: [[[0, 0], [0.055, 100.0], [0.092, 1500.0], [0.1, 2000.0], [0.15, 2200.0], [0.2, 1800.0], [0.5, 1950.0], [1.0, 2034.0], [1.5, 2000.0], [2.0, 1900.0], [2.5, 1760.0], [2.9, 1700.0], [3.0, 1650.0], [3.3, 530.0], [3.4, 350.0], [3.9, 0.0]]]\n",
256248
"total_impulse: 6500.00000 ± 1000.00000 (numpy.random.normal)\n",
257-
"burn_time: 5.27400 ± 1.00000 (numpy.random.normal)\n",
249+
"burn_start_time: [0]\n",
250+
"burn_out_time: [3.9]\n",
258251
"dry_mass: [1.815]\n",
259252
"dry_I_11: [0.125]\n",
260253
"dry_I_22: [0.125]\n",
@@ -283,7 +276,8 @@
283276
"source": [
284277
"mc_motor = McSolidMotor(\n",
285278
" solid_motor=motor,\n",
286-
" burn_time=(5.274, 1),\n",
279+
" burn_start_time=(0, 0.5),\n",
280+
" burn_out_time=(5.274, 1),\n",
287281
" grains_center_of_mass_position=0.001,\n",
288282
" grain_density=50,\n",
289283
" grain_separation=1 / 1000,\n",

rocketpy/monte_carlo/mc_solid_motor.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ def __init__(
1919
solid_motor,
2020
thrust_source=None,
2121
total_impulse=None,
22-
burn_time=None,
22+
burn_start_time=None,
23+
burn_out_time=None,
2324
dry_mass=None,
2425
dry_inertia_11=None,
2526
dry_inertia_22=None,
@@ -113,12 +114,12 @@ def __init__(
113114
Radius of the throat in the motor in meters. Follows the standard
114115
input format of Dispersion Models.
115116
"""
116-
117117
super().__init__(
118118
solid_motor,
119119
thrust_source=thrust_source,
120120
total_impulse=total_impulse,
121-
burn_time=burn_time,
121+
burn_start_time=burn_start_time,
122+
burn_out_time=burn_out_time,
122123
dry_mass=dry_mass,
123124
dry_I_11=dry_inertia_11,
124125
dry_I_22=dry_inertia_22,

0 commit comments

Comments
 (0)