f is the nonlinear differential ecuation to be integrated, thats why the @ so that the ekf funtion can call it, an withing the ekf solve this ecuation to get the first estimation, the h is the measurement equation, also as handle function (@) so that it can be called by the ekf to calculate the kalman gain.
Lines 51 and 53 are given by:
Why is x1 = fstate(x) used as the input for calculating the jacobian of the measurement equation? It makes more sense if the jacobian of the measurement equation is also evaluated at the current state x. Am I interpreting that part incorrectly?
when i highlith error between variable and its estimate (by adding a new variable err=x-xestimate) i plot err. a cycle limit (oscillation )is in this figure.and a gap appear between variable and its estimate .
is it an explanation and solution to this.
i have more general question about the extended kalman filter usage. what is not clear to me why EKF uses non-linear functions f and h for state prediction and estimate, while in other places the Jacobian of these functions is used.
Why the following is never used?
first calculate the liniarized state and measurements models at previous estimate point using Jacobian. Use the liniearized state transition and measurements matrix everywhere instead of non-linear in this specific iteration.
I would really appreciate your help
Great submission, thanks!
One question though: in the parameter explanation you define inputs x and P as "a priori" state estimate and "a priori" estimated state covariance. In my understanding this is not right, as "a priori" values are only available right after the prediction step of the filter.
So, in my opinion x and P are the "a posteriori" values of the previous time step. The "a priori" values of x and P of the current time step are available after the prediction step of your filter (vals x1 and P in lines 51 and 52).
Do you agree?