mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 03:23:33 +08:00
Changed rk4 to use generic matrix interface.
This commit is contained in:
@@ -6,12 +6,12 @@ namespace matrix {
|
|||||||
|
|
||||||
template<typename Type, size_t M, size_t N>
|
template<typename Type, size_t M, size_t N>
|
||||||
int integrate_rk4(
|
int integrate_rk4(
|
||||||
Vector<Type, M> (*f)(Type, const Vector<Type, M> &x, const Vector<Type, N> & u),
|
Vector<Type, M> (*f)(Type, const Matrix<Type, M, 1> &x, const Matrix<Type, N, 1> & u),
|
||||||
const Vector<Type, M> & y0,
|
const Matrix<Type, M, 1> & y0,
|
||||||
const Vector<Type, N> & u,
|
const Matrix<Type, N, 1> & u,
|
||||||
Type t0,
|
Type t0,
|
||||||
Type h,
|
Type h,
|
||||||
Vector<Type, M> & y1
|
Matrix<Type, M, 1> & y1
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// https://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods
|
// https://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods
|
||||||
|
|||||||
Reference in New Issue
Block a user