Aller au contenu

Mathc complexes/08u

Un livre de Wikilivres.


Application

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

c00c.c
/* ------------------------------------ */
/*  Save as :   c00c.c                  */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */     
#define RCA          RC6  
/* ------------------------------------ */
/* ------------------------------------ */
int main(void)
{                          
double a[RCA*RCA] ={   
+0.567743563267, +0.304424089190, -0.059677700710, -0.203424101776, +0.267148131435, -0.190855616323, 
+0.304424089190, +0.785604057676, +0.042029055301, +0.143264950247, -0.188143702858, +0.134413376479, 
-0.059677700710, +0.042029055301, +0.991760844584, -0.028084908937, +0.036882704058, -0.026349692872, 
-0.203424101776, +0.143264950247, -0.028084908937, +0.904266630484, +0.125722520384, -0.089818517482, 
+0.267148131435, -0.188143702858, +0.036882704058, +0.125722520384, +0.834894016457, +0.117954799378, 
-0.190855616323, +0.134413376479, -0.026349692872, -0.089818517482, +0.117954799378, +0.915730887532 
};

double v[RCA*RCA] ={
+0.575801565025, -0.136763612579, -0.425812987594, +0.525729633538, -0.403913441448, +0.657462118097,
+0.817589479944, +0.000000000000, +0.000000000000, +0.000000000000, +0.000000000000, -0.463029094469, 
+0.000000000000, +0.990603712023, +0.000000000000, +0.000000000000, +0.000000000000, +0.090769793525,
+0.000000000000, +0.000000000000, +0.904811195552, +0.000000000000, +0.000000000000, +0.309408095427, 
+0.000000000000, +0.000000000000, +0.000000000000, +0.850651722164, +0.000000000000, -0.406332356012, 
+0.000000000000, +0.000000000000, +0.000000000000, +0.000000000000, +0.914797208029, +0.290291426791  
};      
                       
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, C6);     

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

  printf(" det(V)  = ");p_Z(det_Z(V), S4,P0, S5,P0);printf("\n");    
  printf(" det(V) != 0.00 V1,V2,V3,V4,V5 and V6 are linearly independent\n\n");  
  stop();
  
  clrscrn();                    
  printf(" The matrix A projects the space in  the direction\n"
         " of the  eigenvector V6  on a hyperplan determined\n"
         " by the eigenvector V1,V2,V3,V4 and V5 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  one and   \n"
         " The eigenvector V5 has its eigenvalue equal to  one and   \n"
         " The eigenvector V6 has its eigenvalue equal to zero and \n\n"
         " If The vectors V1,V2,V3,V4,V5 and V6 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.567744 +0.304424 -0.059678 -0.203424 +0.267148 -0.190856 
+0.304424 +0.785604 +0.042029 +0.143265 -0.188144 +0.134413 
-0.059678 +0.042029 +0.991761 -0.028085 +0.036883 -0.026350 
-0.203424 +0.143265 -0.028085 +0.904267 +0.125723 -0.089819 
+0.267148 -0.188144 +0.036883 +0.125723 +0.834894 +0.117955 
-0.190856 +0.134413 -0.026350 -0.089819 +0.117955 +0.915731 

 V :
+0.575802 -0.136764 -0.425813 +0.525730 -0.403913 +0.657462 
+0.817589 +0.000000 +0.000000 +0.000000 +0.000000 -0.463029 
+0.000000 +0.990604 +0.000000 +0.000000 +0.000000 +0.090770 
+0.000000 +0.000000 +0.904811 +0.000000 +0.000000 +0.309408 
+0.000000 +0.000000 +0.000000 +0.850652 +0.000000 -0.406332 
+0.000000 +0.000000 +0.000000 +0.000000 +0.914797 +0.290291 

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

 Press return to continue. 


 A :
+0.567744 +0.304424 -0.059678 -0.203424 +0.267148 -0.190856 
+0.304424 +0.785604 +0.042029 +0.143265 -0.188144 +0.134413 
-0.059678 +0.042029 +0.991761 -0.028085 +0.036883 -0.026350 
-0.203424 +0.143265 -0.028085 +0.904267 +0.125723 -0.089819 
+0.267148 -0.188144 +0.036883 +0.125723 +0.834894 +0.117955 
-0.190856 +0.134413 -0.026350 -0.089819 +0.117955 +0.915731 

 A = V * EValue * invV        (Just verify the computation)
+0.567744 +0.304424 -0.059678 -0.203424 +0.267148 -0.190856 
+0.304424 +0.785604 +0.042029 +0.143265 -0.188144 +0.134413 
-0.059678 +0.042029 +0.991761 -0.028085 +0.036883 -0.026350 
-0.203424 +0.143265 -0.028085 +0.904267 +0.125723 -0.089819 
+0.267148 -0.188144 +0.036883 +0.125723 +0.834894 +0.117955 
-0.190856 +0.134413 -0.026350 -0.089819 +0.117955 +0.915731 

 Press return to continue. 


 V1        V2        V3        V4        V5        V6 :
+0.575802 -0.136764 -0.425813 +0.525730 -0.403913 +0.657462 
+0.817589 +0.000000 +0.000000 +0.000000 +0.000000 -0.463029 
+0.000000 +0.990604 +0.000000 +0.000000 +0.000000 +0.090770 
+0.000000 +0.000000 +0.904811 +0.000000 +0.000000 +0.309408 
+0.000000 +0.000000 +0.000000 +0.850652 +0.000000 -0.406332 
+0.000000 +0.000000 +0.000000 +0.000000 +0.914797 +0.290291 

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

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

 Press return to continue. 


 The matrix A projects the space in  the direction
 of the  eigenvector V6  on a hyperplan determined
 by the eigenvector V1,V2,V3,V4 and V5 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  one and   
 The eigenvector V5 has its eigenvalue equal to  one and   
 The eigenvector V6 has its eigenvalue equal to zero and 

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

 Press return to continue.