lamberthub.utils.assertions
#
A collection of checkers for raising custom exceptions if required
Module Contents#
Functions#
|
Checks if solver input parameters are safe. |
Checks if the gravitational parameter is positive. |
|
Checks if position vector has proper dimensions and is not the null one. |
|
Checks if position vectors are safe in dimension and values. |
|
Checks if time of flight is positive. |
|
Checks if the number of revolutions is zero or positive, that is, it does |
|
|
Checks if the transfer angle is the null value. If so, raises an exception. |
|
Checks if the transfer angle is pi radians or 180 degrees. If so, raises an |
- lamberthub.utils.assertions.assert_parameters_are_valid(mu, r1, r2, tof, M)#
Checks if solver input parameters are safe.
- lamberthub.utils.assertions.assert_gravitational_parameter_is_positive(mu)#
Checks if the gravitational parameter is positive.
- Parameters:
mu (float) – Gravitational parameter
- lamberthub.utils.assertions.assert_position_vector_is_valid(r)#
Checks if position vector has proper dimensions and is not the null one.
- Parameters:
r (np.array) – Initial position vector.
- lamberthub.utils.assertions.assert_position_vectors_are_valid(r1, r2)#
Checks if position vectors are safe in dimension and values.
- Parameters:
r1 (np.array) – Initial position vector.
r2 (np.array) – Final position vector.
- lamberthub.utils.assertions.assert_time_of_flight_is_positive(tof)#
Checks if time of flight is positive.
- Parameters:
tof (float) – Time of flight.
- lamberthub.utils.assertions.assert_number_of_revolutions_not_negative(M)#
Checks if the number of revolutions is zero or positive, that is, it does not have a negative value.
- Parameters:
M (int) – Number of revolutions
- lamberthub.utils.assertions.assert_transfer_angle_not_zero(dtheta)#
Checks if the transfer angle is the null value. If so, raises an exception.
- Parameters:
dtheta (float) – Transfer angle value.
- lamberthub.utils.assertions.assert_transfer_angle_not_pi(dtheta)#
Checks if the transfer angle is pi radians or 180 degrees. If so, raises an exception.
- Parameters:
dtheta (float) – Transfer angle value.