50 likes | 169 Views
EKF Matlab Equations. , then. Let:. Problem Setup. ,. State Update. A(:,:,i)=linearize(qk_km1(:,i));. =. F(:,i)=[qk_km1(2,i) (-2*qk_km1(4,i)*qk_km1(3,i)*qk_km1(2,i)-(qk_km1(1,i)*qk_km1(3,i)^2)+ARF(i)) 0 0]';. qk_km1(:,i) = M(:,:,i)*F(:,i)*intdt + qk_km1(:,i);.
E N D
, then Let: Problem Setup ,
State Update A(:,:,i)=linearize(qk_km1(:,i)); = F(:,i)=[qk_km1(2,i) (-2*qk_km1(4,i)*qk_km1(3,i)*qk_km1(2,i)-(qk_km1(1,i)*qk_km1(3,i)^2)+ARF(i)) 0 0]';
qk_km1(:,i) = M(:,:,i)*F(:,i)*intdt + qk_km1(:,i); P_dot = A(:,:,i)*Pk_k(:,:,i) + Pk_k(:,:,i)*A(:,:,i)' + Q; Pk_k(:,:,i) = Pk_k(:,:,i) + (intdt)*M(:,:,i)*P_dot*M(:,:,i)'; State Update, cont. Taylor-Heun Approximation: (Mazzoni 2007, courtesy of Muhel & Vivek) M(:,:,i) = inv(eye(4) - A(:,:,i)*intdt/(2));
K(:,i) = Pk_k(:,:,i)*H'*(1/(Pk_k(1,1,i)+R)); qk_k(:,i) = qk_km1(:,i) + K(:,i)*(ytrue(i)-qk_km1(1,i)); Pk_k(:,:,i) = (eye(4) - K(:,i)*H)*Pk_k(:,:,i); Measurement Update