20 using VectorXs =
typename math_types<T>::VectorXs;
21 using VectorRef =
typename math_types<T>::VectorRef;
23 using MatrixRef =
typename math_types<T>::MatrixRef;
28 const std::optional<ConstVectorRef> &gap = std::nullopt,
29 const uint max_iters = 1000,
const T EPS = 1e-6) {
34 const ExpModel &model_cast =
static_cast<const ExpModel &
>(model);
35 ExpData &data_cast =
static_cast<ExpData &
>(data);
36 run(model_cast, x, u, data_cast, xout, gap);
44 model.evaluate(x, u, xnext, data);
50 model.computeJacobians(x, u, xnext, data);
53 x, xout, data.value_, dx0buf, data.Jy_, EPS, max_iters);
60 const std::optional<ConstVectorRef> &gap = std::nullopt) {
63 if (gap.has_value()) {
64 model.
space_next().integrate(xout, *gap, xout);
Dynamics model: describes system dynamics through an implicit relation .
virtual bool isExplicit() const
Check if this dynamics model is implicit or explicit.
const int ndx2
Next state space dimension.
const Manifold & space_next() const
State space for the output of this dynamics model.
Specific data struct for explicit dynamics ExplicitDynamicsModelTpl.
Explicit forward dynamics model .
virtual void forward(const ConstVectorRef &x, const ConstVectorRef &u, Data &data) const =0
Evaluate the forward discrete dynamics.
static bool run(const Manifold &space, Fun &&fun, JacFun &&jac_fun, const ConstVectorRef &xinit, VectorRef xout, VectorRef f0, VectorRef dx, MatrixRef Jf0, Scalar eps=1e-6, std::size_t max_iters=1000, Options options=Options{})
Evaluates the forward map for a discrete dynamics model, implicit or explicit.
typename math_types< T >::VectorRef VectorRef
static void run(const DynamicsModelTpl< T > &model, const ConstVectorRef &x, const ConstVectorRef &u, DynamicsDataTpl< T > &data, VectorRef xout, const std::optional< ConstVectorRef > &gap=std::nullopt, const uint max_iters=1000, const T EPS=1e-6)
static void run(const ExplicitDynamicsModelTpl< T > &model, const ConstVectorRef &x, const ConstVectorRef &u, ExplicitDynamicsDataTpl< T > &data, VectorRef xout, const std::optional< ConstVectorRef > &gap=std::nullopt)
typename math_types< T >::ConstVectorRef ConstVectorRef
typename math_types< T >::VectorXs VectorXs
typename math_types< T >::MatrixRef MatrixRef