DynamicalModel

class sbpy.dynamics.models.DynamicalModel(**kwargs)[source] [edit on github]

Bases: ABC

Super-class for dynamical models.

Parameters:
**kwargsdict

Arguments passed on to solve_ivp. Units are seconds, km, and km/s, e.g., max_step is a float value in units of seconds. For relative and absolute tolerance keywords, rtol and atol, 6-element arrays may be used, where the first three elements are for position, and the last three are for velocity.

Methods Summary

df_drv(t, rv, *args)

Jacobian matrix, \(df/drv\).

dx_dt(t, rv, *args)

Derivative of position and velocity.

solve(initial, t_final, *args)

Solve the equations of motion for a single particle.

Methods Documentation

abstractmethod classmethod df_drv(t: float, rv: ndarray, *args) ndarray[source] [edit on github]

Jacobian matrix, \(df/drv\).

Parameters:
tfloat

Time, s. Not used.

rvndarray

First three elements are the position vector at time t, km. The next three elements are the velocity vector at time t, km/s.

*args

Additional parameters.

Returns:
df_drvnumpy.ndarray

First three elements for \(df/dr\), next three for \(df/dv\).

abstractmethod classmethod dx_dt(t: float, rv: ndarray, *args) ndarray[source] [edit on github]

Derivative of position and velocity.

Parameters:
tfloat

Time, s. Not used.

rvndarray

First three elements are the position vector at time t, km. The next three elements are the velocity vector at time t, km/s.

*args

Additional parameters.

Returns:
dx_dtnumpy.ndarray

First three elements for \(dr/dt\), next three for \(dv/dt\).

solve(initial: State, t_final: Time, *args) State[source] [edit on github]

Solve the equations of motion for a single particle.

The solution is calculated with scipy.integrate.solve_ivp.

Parameters:
initialState

Initial state (position and velocity at time) of the particle.

t_finalTime or Quantity

Time at which the solution is desired. Use of Time versus Quantity must match how time is defined in the initial state.

*args

Additional arguments passed to dx_dt and df_drv.

Returns:
finalState