In kalman filter, the elements of state transition matrix using fourth-order runge-kutta integration

14 views (last 30 days)
Hello all,
In a simple 1d object positioning state given accelerations, I would like to use fourth-order runge kutta method to transit state.
I know runge-kutta method is based on estimated rate/slope in the current, half step and a full step time, which calulates k1, k2, k3 and k4.
It is easy to calculate in vector form.
But how to represent it in matrix form?
I wonder how to get the elements in A which is required to calcuate the covariance in later step.
[pos(n+1);rate(n+1)] = A * [pos(n);rate(n)];
Since k2, k3, k4 are rates calculated based on k1 which is rate (n), how to get their coefficients in A?
Thank you in advance.
  1 Comment
John D'Errico
John D'Errico on 26 Mar 2023
Why are you writing your own ODE solver? Use ODE45, or one of the other codes provided. If you don't know enough about how to write a code yourself from scratch, why do you think you will do a better job than a professional with both expertise in MATLAB and in numerical analysis?

Sign in to comment.

Answers (1)

Paul
Paul on 26 Mar 2023
Hi Chong-You,
It sounds like the system is linear and time invariant. In continuous time, the state dynamics are:
xdot(t) = Ac * x(t)
Then the A matrix for the discrete time propagation is
x(k+1) = A*x(k)
where A = expm(Ac*T) and T is the discretization time step.
Why is a Runge-Kutta integration needed?
  1 Comment
Chong-You
Chong-You on 26 Mar 2023
Edited: Chong-You on 26 Mar 2023
Hello Paul,
Thanks for your reply.
Yes, I understand runge-kutta method is not necessary in this simple case.
I just try to use it in this simple case because I may use it in complicated cases.
I have coded runge-kuttu integration or used ode45 to solve the state.
But what i code and ode45 directly transit the state.
In order to calcuate covariance (AP(k)A' + Q), I think transition matrix A is needed. And A would be jacobian matrix.
I stuck at here because I do not know how to calculate jacobian from the runge-kutta integration.
Maybe my example is bad, purpose is meaningless and my understanding is wrong.
Thank you for your opinion again.

Sign in to comment.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!