Aller au contenu

Mathc complexes/092

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          RC3  
/* ------------------------------------ */       
/* ------------------------------------ */
int main(void)
{                          
double a[RCA*RCA] ={   
+0.554945054945, -0.049450549451, -0.494505494505, 
-0.049450549451, +0.994505494505, -0.054945054945, 
-0.494505494505, -0.054945054945, +0.450549450549                             
};

double v[RCA*RCA] ={
-0.049591604835, -0.050088156020, +0.667124384995, 
+0.997248963475, +0.997248736440, +0.074124931666, 
-0.055092445751, -0.054645533169, +0.741249316661       
};     
                       
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");
  p_mRZ(V, S9,P6, C4); 
   
  printf(" EValue1   EValue2   EValue3");
  p_mRZ(EValue, S9,P6, C4); 

  printf(" det(V)  = ");pE_Z(det_Z(V), S4,P5, S5,P5);   
  printf("\n det(V) != 0.00 V1,V2 and V3 are linearly independent\n\n");  
  stop();
  
  clrscrn();                    
  printf(" The matrix A projects the space in  the direction\n"
         " of the  eigenvector V3  on a plan determined\n"
         " by the eigenvector V1,V2 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 zero and \n\n"
         " If The vectors V1,V2,V3 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.554945 -0.049451 -0.494505 
-0.049451 +0.994505 -0.054945 
-0.494505 -0.054945 +0.450549 

 V :
-0.049592 -0.050088 +0.667124 
+0.997249 +0.997249 +0.074125 
-0.055092 -0.054646 +0.741249 

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

 Press return to continue. 


 A :
+0.554945 -0.049451 -0.494505 
-0.049451 +0.994505 -0.054945 
-0.494505 -0.054945 +0.450549 

 A = V EValue invV        (Just verify the computation)
+0.554945 -0.049451 -0.494505 
-0.049451 +0.994505 -0.054945 
-0.494505 -0.054945 +0.450549 

 Press return to continue. 


 V1        V2        V3
-0.049592 -0.050088 +0.667124 
+0.997249 +0.997249 +0.074125 
-0.055092 -0.054646 +0.741249 

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

 det(V)  = +6.68052e-04+0.00000e+00i 
 det(V) != 0.00 V1,V2 and V3 are linearly independent

 Press return to continue. 


 The matrix A projects the space in  the direction
 of the  eigenvector V3  on a plan determined
 by the eigenvector V1,V2 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 zero and 

 If The vectors V1,V2,V3 are linearly independent 

 Press return to continue.