@@ -413,6 +413,37 @@ def test_max_values(flight_calisto_robust):
413413 assert pytest .approx (285.94948 , rel = rtol ) == test .max_speed
414414
415415
416+ @pytest .mark .parametrize (
417+ "flight_time_attr" ,
418+ ["t_initial" , "out_of_rail_time" , "apogee_time" , "t_final" ],
419+ )
420+ def test_axial_acceleration (flight_calisto_custom_wind , flight_time_attr ):
421+ """Tests the axial_acceleration property by manually calculating the
422+ dot product of the acceleration vector and the attitude vector at
423+ specific time steps.
424+
425+ Parameters
426+ ----------
427+ flight_calisto_custom_wind : rocketpy.Flight
428+ Flight object to be tested.
429+ flight_time_attr : str
430+ The name of the attribute of the flight object that contains the time
431+ of the point to be tested.
432+ """
433+ flight = flight_calisto_custom_wind
434+ t = getattr (flight , flight_time_attr )
435+
436+ calculated_axial_acc = flight .axial_acceleration (t )
437+
438+ expected_axial_acc = (
439+ flight .ax (t ) * flight .attitude_vector_x (t )
440+ + flight .ay (t ) * flight .attitude_vector_y (t )
441+ + flight .az (t ) * flight .attitude_vector_z (t )
442+ )
443+
444+ assert pytest .approx (expected_axial_acc , abs = 1e-9 ) == calculated_axial_acc
445+
446+
416447def test_effective_rail_length (flight_calisto_robust , flight_calisto_nose_to_tail ):
417448 """Tests the effective rail length of the flight simulation. The expected
418449 values are calculated by hand, and should be valid as long as the rail
0 commit comments