Aller au contenu

Mathc complexes/08s

Un livre de Wikilivres.


Application

Installer et compiler ces fichiers dans votre répertoire de travail.

c00a.c
/* ------------------------------------ */
/*  Save as :   c00a.c                  */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */    
#define RCA          RC4  
/* ------------------------------------ */       
/* ------------------------------------ */
int main(void)
{                          
double a[RCA*RCA] ={   
+0.729876318493, +0.169778846788, -0.191923913761, -0.362625471673, 
+0.169778846788, +0.893290152659, +0.120628523081, +0.227918315245, 
-0.191923913761, +0.120628523081, +0.863637321734, -0.257646791146, 
-0.362625471673, +0.227918315245, -0.257646791146, +0.513196207114                            
};

double v[RCA*RCA] ={
+0.532141930309, -0.579194958348, -0.801954709350, +0.519734241230, 
+0.846655163574, +0.000000000000, +0.000000000000, -0.326664732319, 
+0.000000000000, +0.815189057964, +0.000000000000, +0.369273175665, 
+0.000000000000, +0.000000000000, +0.597384837564, +0.697713259790     
};     
                       
double **A      =  ca_A_mRZ(a, i_mZ(RCA,RCA));
double **V      =  ca_A_mRZ(v, i_mZ(RCA,RCA));
double **invV   =  invgj_mZ(V, i_mZ(RCA,RCA));
double **EValue =              i_mZ(RCA,RCA);

double **T      =              i_mZ(RCA,RCA);

  clrscrn(); 
  printf(" A :");
  p_mRZ(A, S8,P6, C4);     

  printf(" V :");
  p_mRZ(V, S9,P6, C4); 
 
  printf(" EValue = invV A V");
  mul_mZ(invV,A,T);
  mul_mZ(T,V,EValue);  
  p_mRZ(EValue, S9,P6, C4); 
  stop();
  
  clrscrn();
  printf(" A :");
  p_mRZ(A, S8,P6, C4);
             
  printf(" A = V EValue invV        (Just verify the computation)");
  mul_mZ(V,EValue,T);
  mul_mZ(T,invV,A);  
  p_mRZ(A, S8,P6, C4);
  stop();
  
  clrscrn();
  printf(" V1        V2        V3        V4 :");
  p_mRZ(V, S9,P6, C4); 
   
  printf(" EValue1   EValue2   EValue3   EValue4 ");
  p_mRZ(EValue, S9,P6, C4); 

  printf(" det(V)  = ");p_Z(det_Z(V), S4,P0, S5,P0);   
  printf("\n det(V) != 0.00 V1,V2,V3 and V4 are linearly independent\n\n");  
  stop();
  
  clrscrn();                    
  printf(" The matrix A projects the space in  the direction\n"
         " of the  eigenvector V4  on a hyperplan determined\n"
         " by the eigenvector V1,V2 and V3 if :\n\n"
         " The eigenvector V1 has its eigenvalue equal to  one and   \n"
         " The eigenvector V2 has its eigenvalue equal to  one and   \n"
         " The eigenvector V3 has its eigenvalue equal to  one and   \n"
         " The eigenvector V4 has its eigenvalue equal to zero and \n\n"
         " If The vectors V1,V2,V3 and V4 are linearly independent \n\n");                   
  stop();  
  
  f_mZ(A);
  f_mZ(V);  
  f_mZ(invV);  
  f_mZ(T);  
  f_mZ(EValue);

  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Dans cet exemple nous pouvons voir que nous n'utilisons que des matrices réelles. Les fonctions *_mRZ travail directement sur des valeurs réelles. ex : ca_A_mRZ(); qui copie un tableau de réelles dans une matrice complexes. p_mRZ(); qui affiche uniquement les valeurs réelles.  

Exemple de sortie écran :

 A :
+0.729876 +0.169779 -0.191924 -0.362625 
+0.169779 +0.893290 +0.120629 +0.227918 
-0.191924 +0.120629 +0.863637 -0.257647 
-0.362625 +0.227918 -0.257647 +0.513196 

 V :
+0.532142 -0.579195 -0.801955 +0.519734 
+0.846655 +0.000000 +0.000000 -0.326665 
+0.000000 +0.815189 +0.000000 +0.369273 
+0.000000 +0.000000 +0.597385 +0.697713 

 EValue = invV * A * V
+1.000000 +0.000000 +0.000000 +0.000000 
-0.000000 +1.000000 +0.000000 -0.000000 
+0.000000 +0.000000 +1.000000 +0.000000 
-0.000000 -0.000000 -0.000000 +0.000000 

 Press return to continue. 


 A :
+0.729876 +0.169779 -0.191924 -0.362625 
+0.169779 +0.893290 +0.120629 +0.227918 
-0.191924 +0.120629 +0.863637 -0.257647 
-0.362625 +0.227918 -0.257647 +0.513196 

 A = V * EValue * invV        (Just verify the computation)
+0.729876 +0.169779 -0.191924 -0.362625 
+0.169779 +0.893290 +0.120629 +0.227918 
-0.191924 +0.120629 +0.863637 -0.257647 
-0.362625 +0.227918 -0.257647 +0.513196 

 Press return to continue. 


 V1        V2        V3        V4 :
+0.532142 -0.579195 -0.801955 +0.519734 
+0.846655 +0.000000 +0.000000 -0.326665 
+0.000000 +0.815189 +0.000000 +0.369273 
+0.000000 +0.000000 +0.597385 +0.697713 

 EValue1   EValue2   EValue3   EValue4 
+1.000000 +0.000000 +0.000000 +0.000000 
-0.000000 +1.000000 +0.000000 -0.000000 
+0.000000 +0.000000 +1.000000 +0.000000 
-0.000000 -0.000000 -0.000000 +0.000000 

 det(V)  =   -1   -0i 
 det(V) != 0.00 V1,V2,V3 and V4 are linearly independent

 Press return to continue. 


 The matrix A projects the space in  the direction
 of the  eigenvector V4  on a hyperplan determined
 by the eigenvector V1,V2 and V3 if :

 The eigenvector V1 has its eigenvalue equal to  one and   
 The eigenvector V2 has its eigenvalue equal to  one and   
 The eigenvector V3 has its eigenvalue equal to  one and   
 The eigenvector V4 has its eigenvalue equal to zero and 

 If The vectors V1,V2,V3 and V4 are linearly independent 

 Press return to continue.