Skip to content

Commit a8e7f7d

Browse files
authored
Merge branch 'develop' into mnt/ecmwf-ensemble
2 parents 6d10f1a + fdc547a commit a8e7f7d

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ Attention: The newest changes should be on top -->
4545

4646
### Fixed
4747

48+
- BUG: Fix no time initialization when passing initial_solution as array to Flight object [#844](https://github.com/RocketPy-Team/RocketPy/pull/844)
49+
4850

4951
## [v1.10.0] - 2025-05-16
5052

rocketpy/simulation/flight.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class Flight:
143143
Flight.heading : int, float
144144
Launch heading angle relative to north given in degrees.
145145
Flight.initial_solution : list
146-
List defines initial condition - [tInit, x_init,
146+
List defines initial condition - [t_initial, x_init,
147147
y_init, z_init, vx_init, vy_init, vz_init, e0_init, e1_init,
148148
e2_init, e3_init, w1_init, w2_init, w3_init]
149149
Flight.t_initial : int, float
@@ -155,10 +155,6 @@ class Flight:
155155
Current integration time.
156156
Flight.y : list
157157
Current integration state vector u.
158-
Flight.initial_solution : list
159-
List defines initial condition - [tInit, x_init,
160-
y_init, z_init, vx_init, vy_init, vz_init, e0_init, e1_init,
161-
e2_init, e3_init, w1_init, w2_init, w3_init]
162158
Flight.out_of_rail_time : int, float
163159
Time, in seconds, in which the rocket completely leaves the
164160
rail.
@@ -544,7 +540,7 @@ def __init__( # pylint: disable=too-many-arguments,too-many-statements
544540
rtol : float, array, optional
545541
Maximum relative error tolerance to be tolerated in the
546542
integration scheme. Can be given as array for each
547-
state space variable. Default is 1e-3.
543+
state space variable. Default is 1e-6.
548544
atol : float, optional
549545
Maximum absolute error tolerance to be tolerated in the
550546
integration scheme. Can be given as array for each
@@ -1168,6 +1164,7 @@ def __init_flight_state(self):
11681164
self.out_of_rail_state = self.initial_solution[1:]
11691165
self.out_of_rail_time = self.initial_solution[0]
11701166
self.out_of_rail_time_index = 0
1167+
self.t_initial = self.initial_solution[0]
11711168
self.initial_derivative = self.u_dot_generalized
11721169
if self._controllers or self.sensors:
11731170
# Handle post process during simulation, get initial accel/forces
@@ -2080,7 +2077,7 @@ def x(self):
20802077

20812078
@funcify_method("Time (s)", "Y (m)", "spline", "constant")
20822079
def y(self):
2083-
"""Rocket y position relative to the lauch pad as a Function of
2080+
"""Rocket y position relative to the launch pad as a Function of
20842081
time."""
20852082
return self.solution_array[:, [0, 2]]
20862083

@@ -2976,7 +2973,7 @@ def max_rail_button2_shear_force(self):
29762973
"Time (s)", "Horizontal Distance to Launch Point (m)", "spline", "constant"
29772974
)
29782975
def drift(self):
2979-
"""Rocket horizontal distance to tha launch point, in meters, as a
2976+
"""Rocket horizontal distance to the launch point, in meters, as a
29802977
Function of time."""
29812978
return np.column_stack(
29822979
(self.time, (self.x[:, 1] ** 2 + self.y[:, 1] ** 2) ** 0.5)

0 commit comments

Comments
 (0)