You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
essentially finding the optimal control $u$ over a prediction horizon $T$ discretized into $N$ segments.
Diffrax seems like a good fit for solving the IVP $\dot{x}(t) = f(x(t), u(t)),\ x(0) = x_{init}$ over the prediction horizon to compute $x_{0,\ldots,N}$. In this case...
I would evaluate $f$ at fixed time points so I don't want to pay any overhead of error estimation. (It appears as low-order as Heun already has an embedded error estimator)
The control terms $u_{0, \ldots, N}$, being my optimized variables, are known beforehand at the discretization points; I don't want pay the overhead of interpolation per interpolate_us in the KF example
My $f$ is nonlinear in $u$ and I'm unsure if ControlTerm is useful here
Is diffrax the right tool for this job? Is yes, what is the best approach; Are there any idioms?
The text was updated successfully, but these errors were encountered:
Yup, this sounds exactly like what Diffrax is for. You might also find this example a useful reference for how to insert the control input u.
Touching on your other points:
If you don't want to pay the computational cost of using an error estimator, then feel free to use any solver + a fixed step size. Their built-in error estimators will actually be compiled out if they're not used.
The overhead of interpolation is probably best handled by writing your own function
defu(t):
# lookup values of `u_i` here given `t`. Implement arbitrary behaviour for those `t` that aren't in the discretisation points.
You don't want ControlTerm; this is used for SDEs etc. (The word "control" here is in the sense of a "controlled differential equation", e.g. the SDE-like objects dy(t) = f(y(t)) dx(t).) You just want an ODE like in the example above.
Diffrax docs' Kalman Filter Example encouraged me to apply diffrax to other linear-quadratic control problems, such as the following
essentially finding the optimal control$u$ over a prediction horizon $T$ discretized into $N$ segments.
Diffrax seems like a good fit for solving the IVP$\dot{x}(t) = f(x(t), u(t)),\ x(0) = x_{init}$ over the prediction horizon to compute $x_{0,\ldots,N}$ . In this case...
Heun
already has an embedded error estimator)interpolate_us
in the KF exampleControlTerm
is useful hereIs diffrax the right tool for this job? Is yes, what is the best approach; Are there any idioms?
The text was updated successfully, but these errors were encountered: