Aller au contenu

Mathc complexes/028

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 FACTOR_E    +1.E-5         
#define RCA          RC4  
/* ------------------------------------ */       
/* ------------------------------------ */
void fun(void)
{                          
double a[RCA*(RCA*C2)] ={   
  +25072,   +0,   +21293,-4811,    +5386,-6531,   +11975,-5847, 
  +21293,+4811,   +30848,   +0,    -1526,-1774,   +13478,-6658, 
   +5386,+6531,    -1526,+1774,   +20007,   +0,    +7542,-1322, 
  +11975,+5847,   +13478,+6658,    +7542,+1322,   +21250,   +0  };
                       
double **A      =   ca_A_mZ(a, i_mZ(RCA,RCA));
double **V      = eigs_V_mZ(A, i_mZ(RCA,RCA),FACTOR_E);
double **invV   =    inv_mZ(V, i_mZ(RCA,RCA));
double **EValue =   eigs_mZ(A, i_mZ(RCA, RCA));

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

  clrscrn(); 
  printf(" A :");
  p_mZ(A, S8,P0, S6,P0, C4);     

  printf(" V :");
  p_mZ(V, S9,P3, S8,P3, C4); 

  printf(" EValue = invV * A * V");
  mul_mZ(invV,A,T);
  mul_mZ(T,V,EValue);
  p_mZ(clean_eyes_mZ(EValue), S9,P2, S8,P2, C4);  
         
  printf(" A = V * EValue * invV");
  mul_mZ(V,EValue,T);
  mul_mZ(T,invV,A); 
  p_mZ(A, S8,P0, S6,P0, C4);
  stop();
              
  f_mZ(A);
  f_mZ(V);  
  f_mZ(invV);  
  f_mZ(T);  
  f_mZ(EValue);
}
/* ------------------------------------ */
int main(void)
{
    fun();
    
  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


Exemple de référence :  Il permet de vérifier les calculs.


Exemple de sortie écran :
 A :
  +25072    +0i   +21293 -4811i    +5386 -6531i   +11975 -5847i 
  +21293 +4811i   +30848    +0i    -1526 -1774i   +13478 -6658i 
   +5386 +6531i    -1526 +1774i   +20007    +0i    +7542 -1322i 
  +11975 +5847i   +13478 +6658i    +7542 +1322i   +21250    +0i 

 V :
   +0.490  -0.325i    +0.012  -0.031i    -0.236  +0.479i    -0.133  -0.593i 
   +0.581  -0.260i    -0.255  +0.358i    -0.168  -0.215i    -0.199  +0.536i 
   +0.187  +0.054i    +0.699  -0.497i    -0.220  -0.006i    -0.284  +0.312i 
   +0.460  -0.000i    +0.264  -0.000i    +0.770  +0.000i    +0.355  +0.000i 

 EValue = invV * A * V
+61819.15   -0.00i     +0.00   +0.00i     +0.00   +0.00i     +0.00   +0.00i 
    +0.00   +0.00i +22896.22   -0.00i     +0.00   +0.00i     +0.00   +0.00i 
    +0.00   +0.00i     +0.00   +0.00i +10720.54   -0.00i     +0.00   +0.00i 
    +0.00   +0.00i     +0.00   +0.00i     +0.00   +0.00i  +1741.10   +0.00i 

 A = V * EValue * invV
  +25072    -0i   +21293 -4811i    +5386 -6531i   +11975 -5847i 
  +21293 +4811i   +30848    -0i    -1526 -1774i   +13478 -6658i 
   +5386 +6531i    -1526 +1774i   +20007    -0i    +7542 -1322i 
  +11975 +5847i   +13478 +6658i    +7542 +1322i   +21250    -0i 

 Press return to continue.