Projet

Général

Profil

« Précédent | Suivant » 

Révision 354

Ajouté par ahkurklu il y a presque 4 ans

Ajout premier calcule filtre

Voir les différences:

sp4a3_kalman.c
B[1][0]=-A[1][0]/det;
B[1][1]=A[0][0]/det;
int i,j;
for (i=0;i<n;i++)
for (j=0;j<m;j++)
printf("B[%d][%d] = %f\n",i,j,B[i][j]);
}
......
}
}
......
{0, 0, 1, 0},
{0, 0, 0, 1}};
double FT[4][4];
Transpose_Mat(4,4,F,FT);
Transpose_Mat(4,4,F,FT);
double tmp[4][4] = {{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0}};
while(fscanf(fichier, "%lf %lf %lf", &t, &x, &y)>0){
printf("-------------%04d--------------\n",cpt);
......
{
t -= t0;x -= x0;y -= y0;
debug=0; ///Mettre à 1 pour afficher les matrices.
debug=1; ///Mettre à 1 pour afficher les matrices.
///Ajouter votre code ci-dessous///
// Kalman
// X = F*X
// X = F*X
Mul_Mat_Mat(4,4,F,4,1,X,X);
Plot_Mat(X," X(k+1|k) = ");
//P = F*P*F'+Q;
//P = F*P*F'+Q;
/*
Mul_Mat_Mat(4,4,F,4,4,P,tmp);
Mul_Mat_Mat(4,4,tmp,4,4,FT,tmp);
Add_Mat_Mat(4,4,tmp,4,4,Q,P);
Plot_Mat(P,"P(k+1|k) = F.P(k|k).FT + Q = ");
*/
// K = P*H' / ( H*P*H' + R);
/*
Mul_Mat_Mat(4,2,K,2,4,HT,K);
Mul_Mat_Mat(2,4,H,4,4,P,tmp);
Mul_Mat_Mat(2,4,tmp,4,2,HT,tmp);
Add_Mat_Mat(2,2,tmp,2,2,R,tmp);
Inverse_Mat_22(2,2,tmp,tmp);
Mul_Mat_Mat(4,2,K,2,2,tmp,K);
Plot_Mat(K,"K = ");
// K = P*H' / ( H*P*H' + R);
Plot_Mat(K,"K = ");
//X = X + K*([xb(i);yb(i)]-H*X);
//X = X + K*([xb(i);yb(i)]-H*X);
*/
//Plot_Mat(Delta,"DELTA = Obs - H.X(k+1|k)");
Plot_Mat(X," X(k+1|k+1) = X(k+1|k) + K.Delta = ");

Formats disponibles : Unified diff