template<typename T>
class maliput::drake::systems::ScalarInitialValueProblem< T >
A thin wrapper of the InitialValueProblem class to provide a simple interface when solving scalar initial value problems i.e.
when evaluating the x(t; ๐ค) solution function to the given ODE dx/dt = f(t, x; ๐ค), where f : t โจฏ x โ โ , t โ โ, x โ โ, ๐ค โ โแต, along with an initial condition x(tโ; ๐ค) = xโ. The parameter vector ๐ค allows for generic IVP definitions, which can later be solved for any instance of said vector.
Note the distinction from general initial value problems where f : t โจฏ ๐ฑ โ โโฟ and ๐ฑ โ โโฟ, addressed by the class being wrapped. While every scalar initial value problem could be written in vector form, this wrapper keeps both problem definition and solution in their scalar form with almost zero overhead, leading to clearer code if applicable. Moreover, this scalar form facilitates single-dimensional quadrature using methods for solving initial value problems.
See InitialValueProblem class documentation for information on caching support and dense output usage for improved efficiency in scalar IVP solving.
For further insight into its use, consider the following examples of scalar IVPs:
- The population growth of an hypothetical bacteria colony is described by dN/dt = r * N. The colony has Nโ subjects at time tโ. In this context, x โ N, xโ โ Nโ, ๐ค โ [r], dx/dt = f(t, x; ๐ค) = ๐คโ * x.
- The charge Q stored in the capacitor of a (potentially equivalent) series RC circuit driven by a time varying voltage source E(t) can be described by dQ/dt = (E(t) - Q / Cs) / Rs, where Rs refers to the resistor's resistance and Cs refers to the capacitor's capacitance. In this context, and assuming an initial stored charge Qโ at time tโ, x โ Q, ๐ค โ [Rs, Cs], xโ โ Qโ, dx/dt = f(t, x; ๐ค) = (E(t) - x / ๐คโ) / ๐คโ.
@tparam_nonsymbolic_scalar
|
| DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN (ScalarInitialValueProblem) |
|
| ScalarInitialValueProblem (const ScalarOdeFunction &scalar_ode_function, const ScalarOdeContext &default_values) |
| Constructs an scalar IVP described by the given scalar_ode_function , using given default_values.t0 and default_values.x0 as initial conditions, and parameterized with default_values.k by default. More...
|
|
T | Solve (const T &tf, const ScalarOdeContext &values={}) const |
| Solves the IVP for time tf , using the initial time tโ, initial state xโ and parameter vector ๐ค present in values , falling back to the ones given on construction if not given. More...
|
|
std::unique_ptr< ScalarDenseOutput< T > > | DenseSolve (const T &tf, const ScalarOdeContext &values={}) const |
| Solves and yields an approximation of the IVP solution x(t; ๐ค) for the closed time interval between the initial time tโ and the given final time tf , using initial state xโ and parameter vector ๐ค present in values (falling back to the ones given on construction if not given). More...
|
|
template<typename Integrator , typename... Args> |
Integrator * | reset_integrator (Args &&... args) |
| Resets the internal integrator instance by in-place construction of the given integrator type. More...
|
|
const IntegratorBase< T > & | get_integrator () const |
| Gets a reference to the internal integrator instance. More...
|
|
IntegratorBase< T > & | get_mutable_integrator () |
| Gets a mutable reference to the internal integrator instance. More...
|
|