ostk.astrodynamics.solver.FiniteDifferenceSolver¶
- class FiniteDifferenceSolver(
- self: ostk.astrodynamics.solver.FiniteDifferenceSolver,
- type: ostk.astrodynamics.solver.FiniteDifferenceSolver.Type,
- step_percentage: ostk.core.type.Real,
- step_duration: ostk.physics.time.Duration,
- type: ostk.astrodynamics.solver.FiniteDifferenceSolver.Type,
Bases:
pybind11_object
A Finite Difference Solver to compute the gradient, state transition matrix, and jacobian of a function.
Construct a FiniteDifferenceSolver.
- Parameters:
type (FiniteDifferenceSolver.Type) -- Type of finite difference scheme.
step_percentage (float) -- The step percentage to use for computing the STM/Jacobian.
step_duration (Duration) -- The step duration to use for computing the gradient.
- Returns:
The FiniteDifferenceSolver.
- Return type:
Methods
Compute the gradient.
Compute the jacobian.
Overloaded function.
Get the default Finite Difference Solver.
Get the step duration used for computing the gradient.
Get the step percentage used for computing the STM.
Get the type.
Convert a type to string.
- class Type(
- self: ostk.astrodynamics.solver.FiniteDifferenceSolver.Type,
- value: int,
Bases:
pybind11_object
Type of finite difference scheme.
Members:
Forward : Forward difference scheme.
Backward : Backward difference scheme.
Central : Central difference scheme.
- property name¶
- compute_gradient(self: ostk.astrodynamics.solver.FiniteDifferenceSolver, state: ostk::astrodynamics::trajectory::State, generate_state_coordinates: Callable[[ostk::astrodynamics::trajectory::State, ostk.physics.time.Instant], numpy.ndarray[numpy.float64[m, 1]]]) numpy.ndarray[numpy.float64[m, 1]] ¶
Compute the gradient.
- Parameters:
state (State) -- The state.
generate_state_coordinates (function) -- The function to generate the state coordinates.
- Returns:
The gradient.
- Return type:
np.array
- compute_jacobian(self: ostk.astrodynamics.solver.FiniteDifferenceSolver, state: ostk::astrodynamics::trajectory::State, generate_state_coordinates: Callable[[ostk::astrodynamics::trajectory::State, ostk.physics.time.Instant], numpy.ndarray[numpy.float64[m, 1]]]) numpy.ndarray[numpy.float64[m, n]] ¶
Compute the jacobian.
- Parameters:
state (State) -- The state.
generate_state_coordinates (function) -- The function to generate the state coordinates.
- Returns:
The jacobian.
- Return type:
np.array
- compute_state_transition_matrix(*args, **kwargs)¶
Overloaded function.
compute_state_transition_matrix(self: ostk.astrodynamics.solver.FiniteDifferenceSolver, state: ostk::astrodynamics::trajectory::State, instants: list[ostk.physics.time.Instant], generate_states_coordinates: Callable[[ostk::astrodynamics::trajectory::State, list[ostk.physics.time.Instant]], numpy.ndarray[numpy.float64[m, n]]]) -> list[numpy.ndarray[numpy.float64[m, n]]]
Compute a list of state transition matrix (STM) at the provided instants.
- Args:
state (State): The state. instants (Array(Instant)): The instants at which to calculate the STM. generate_states_coordinates (callable): The function to get the states coordinates as a matrix. Each column is a set of state coordinates.
- Returns:
np.array: The list of state transition matrices.
compute_state_transition_matrix(self: ostk.astrodynamics.solver.FiniteDifferenceSolver, state: ostk::astrodynamics::trajectory::State, instant: ostk.physics.time.Instant, generate_state_coordinates: Callable[[ostk::astrodynamics::trajectory::State, ostk.physics.time.Instant], numpy.ndarray[numpy.float64[m, 1]]]) -> numpy.ndarray[numpy.float64[m, n]]
Compute the state transition matrix (STM).
- Args:
state (State): The state. instant (Instant): The instant at which to calculate the STM. generate_state_coordinates (callable): The function to get the state coordinates. Must be a column vector.
- Returns:
np.array: The state transition matrix.
- static default() ostk.astrodynamics.solver.FiniteDifferenceSolver ¶
Get the default Finite Difference Solver.
- Returns:
The default Finite Difference Solver.
- Return type:
- get_step_duration( ) ostk.physics.time.Duration ¶
Get the step duration used for computing the gradient.
- Returns:
The step duration.
- Return type:
Duration
- get_step_percentage( ) ostk.core.type.Real ¶
Get the step percentage used for computing the STM.
- Returns:
The step percentage.
- Return type:
- get_type( ) ostk.astrodynamics.solver.FiniteDifferenceSolver.Type ¶
Get the type.
- Returns:
The type.
- Return type:
- static string_from_type( ) ostk.core.type.String ¶
Convert a type to string.
- Parameters:
type (FiniteDifferenceSolver.Type) -- The type.
- Returns:
The string name of the type.
- Return type: