Actually solved the problem. For the EKF linearizing is only important to estimate the current covariance. The mean of the gaussian distribution is actually compiled with the non linear function itself. Therefore computing the new mean estimate with the updated linearized function will not give me a better result.(But i still dont understand why it gives me worse results, shouldn´t it be the same[ atleast with a really small step size]) Computing the updated Jacobians is only necessary for the covariance of the system because their we want to get an approximation how the system behaves "around" the system. For the mean it´s irrelevant. Atleast that´s what i think now. If somebody has a better idea, please let me know.
Constant Linearization of differential equations
10 views (last 30 days)
Show older comments
I currently try to build an extended kalman filter. For this i need to linearize the non linear equations around an updated working point so i can use it for the filter. I thought this should give me better results. However, the simulations show that only one linearization at one working point give me better results than the one where i constantly linearize the system. Im 99% sure the equations are correct. I substitute the values in the matrices every time step with the last estimated values to linearize at the current working point.
Picture 1 linearization with each time step [blue is the ideal graph, green is mine]

Picture 2 One linearization

variables_vehicle = [v b psiS sigma Fuv Fuh cv ch m lv lh J p_Luft A_surface cW i_S];
x_vehicle = x(t_start,:)';
for k=tf;
%__________________________________________________________________________
%Constant Linearization
disp(k)
variables_values_vehicle = [x_vehicle(1,1) x_vehicle(2,1) x_vehicle(3,1) u_vehicle(k,1) u_vehicle(k,2) u_vehicle(k,3) 28650 28650 258 0.765 0.765 100 1.2 1.4 1.2 4.1]; %Einsetzen der aktuellen Werte
A_vehicle=subs(A_v, variables_vehicle, variables_values_vehicle);
B_vehicle=subs(B_v, variables_vehicle, variables_values_vehicle);
C_vehicle=subs(C_v, variables_vehicle, variables_values_vehicle);
D_vehicle=subs(D_v, variables_vehicle, variables_values_vehicle);
ss_vehicle = ss(double(A_vehicle),double(B_vehicle),double(C_vehicle),double(D_vehicle));
ss_d_vehicle = c2d (ss_vehicle,Ts);
[A_d_vehicle,B_d_vehicle,C_d_vehicle,D_d_vehicle] = ssdata(ss_d_vehicle);
x_vehicle = A_d_vehicle*x_vehicle+B_d_vehicle*u_vehicle(k,:)' ;
end
0 Comments
Answers (1)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!