Aller au contenu

Mathc complexes/04o

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-3
#define RCA          RC4 
/* ------------------------------------ */       
/* ------------------------------------ */
void fun(void)
{
double a[RCA*(RCA*C2)] ={   
 -680,   +0,  +249,   +0,   +71,   +0,  -582,   +0, 
 +940,   +0,  +359,   +0,   +62,   +0,  -333,   +0, 
 +659,   +0,  +461,   +0,  +500,   +0,   -86,   +0, 
 +634,   +0,   -41,   +0,  +310,   +0,  +218,   +0   };
 
double v[RCA*(RCA*C2)] ={  
/*	 This is the copy of V1 and V2 of the last files
            V1              V2  ... */	 
-0.086941675784,+0.137530775811, -0.086941675784,-0.137530775811, -0.503370390731,+0.000000000000, -0.341984712854,+0.000000000000,
+0.079982417904,+0.478215807143, +0.079982417904,-0.478215807143, +0.725879046248,+0.000000000000, +0.764895765405,+0.000000000000,
+0.690803310381,+0.311037125623, +0.690803310381,-0.311037125623, +0.037125716105,+0.000000000000, -0.101013435459,+0.000000000000,
+0.405568216447,+0.000000000000, +0.405568216447,-0.000000000000, +0.467268168354,+0.000000000000, +0.536448702203,+0.000000000000
};    

double eigsvalue[RCA*(RCA*C2)] ={
 +602.025962393876, +404.393554681167,    +0.000000000000,   +0.000000000000,    +0.000000000000,   +0.000000000000,    +0.000000000000,   +0.000000000000, 
   +0.000000000000,   +0.000000000000,  +602.025962393865, -404.393554681167,    +0.000000000000,   +0.000000000000,    +0.000000000000,   +0.000000000000, 
   +0.000000000000,   +0.000000000000,    +0.000000000000,   +0.000000000000,  -504.045539320427,   +0.000000000000,    +0.000000000000,   +0.000000000000, 
   +0.000000000000,   +0.000000000000,    +0.000000000000,   +0.000000000000,    +0.000000000000,   +0.000000000000,  -303.006385467296,   +0.000000000000  };
                       
double **A         =  ca_A_mZ(a,        i_mZ(RCA,RCA));
double **V         =  ca_A_mZ(v,        i_mZ(RCA,RCA));
double **invV      = invgj_mZ(V,        i_mZ(RCA,RCA));
double **T         =                    i_mZ(RCA,RCA);
double **EigsValue = ca_A_mZ(eigsvalue, i_mZ(RCA,RCA));

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

  printf(" V :");
  p_mZ(V, S8,P4, S6,P4, C4); 
  printf(" invV :");
  p_mZ(invV, S8,P4, S6,P4, C4);
  stop();

  clrscrn();   
  printf(" EigsValue : invV * A * V");
  mul_mZ(invV,A,T);
  mul_mZ(T,V,EigsValue); 
    p_mZ(clean_eyes_mZ(EigsValue), S8,P2, S6,P2, C4);
 
  printf(" A :");
  p_mZ(A, S8,P2, S6,P2, C4); 
  
  printf(" A = V * EigsValue * invV");
  mul_mZ(V,EigsValue,T);
  mul_mZ(T,invV,A); 
    p_mZ(A, S8,P2, S6,P2, C4); 
  stop();
          
  f_mZ(A);
  f_mZ(V);  
  f_mZ(invV);  
  f_mZ(T);  
  f_mZ(EigsValue);
}
/* ------------------------------------ */
int main(void)
{
  fun();

  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


Vérifions les calculs précédents.


Exemple de sortie écran : Trouvons les valeurs complexes
 A :
-680.0000+0.0000i +249.0000+0.0000i +71.0000+0.0000i -582.0000+0.0000i 
+940.0000+0.0000i +359.0000+0.0000i +62.0000+0.0000i -333.0000+0.0000i 
+659.0000+0.0000i +461.0000+0.0000i +500.0000+0.0000i -86.0000+0.0000i 
+634.0000+0.0000i -41.0000+0.0000i +310.0000+0.0000i +218.0000+0.0000i 

 V :
 -0.0869+0.1375i  -0.0869-0.1375i  -0.5034+0.0000i  -0.3420+0.0000i 
 +0.0800+0.4782i  +0.0800-0.4782i  +0.7259+0.0000i  +0.7649+0.0000i 
 +0.6908+0.3110i  +0.6908-0.3110i  +0.0371+0.0000i  -0.1010+0.0000i 
 +0.4056+0.0000i  +0.4056-0.0000i  +0.4673+0.0000i  +0.5364+0.0000i 

 invV :
 +0.1598-0.4183i  -0.3140-0.6932i  +0.4121-0.3567i  +0.6271+0.6546i 
 +0.1598+0.4183i  -0.3140+0.6932i  +0.4121+0.3567i  +0.6271-0.6546i 
 -4.0396+0.0000i  +0.4036-0.0000i  +1.1657-0.0000i  -2.9311+0.0000i 
 +3.2770-0.0000i  +0.1232+0.0000i  -1.6385+0.0000i  +3.4690-0.0000i 

 Press return to continue. 


 EigsValue : invV * A * V
 +602.03+404.39i    +0.00 +0.00i    +0.00 +0.00i    +0.00 +0.00i 
   +0.00 +0.00i  +602.03-404.39i    +0.00 +0.00i    +0.00 +0.00i 
   +0.00 +0.00i    +0.00 +0.00i  -504.05 +0.00i    +0.00 +0.00i 
   +0.00 +0.00i    +0.00 +0.00i    +0.00 +0.00i  -303.01 -0.00i 

 A :
 -680.00 +0.00i  +249.00 +0.00i   +71.00 +0.00i  -582.00 +0.00i 
 +940.00 +0.00i  +359.00 +0.00i   +62.00 +0.00i  -333.00 +0.00i 
 +659.00 +0.00i  +461.00 +0.00i  +500.00 +0.00i   -86.00 +0.00i 
 +634.00 +0.00i   -41.00 +0.00i  +310.00 +0.00i  +218.00 +0.00i 

 A = V * EigsValue * invV
 -680.00 +0.00i  +249.00 -0.00i   +71.00 -0.00i  -582.00 +0.00i 
 +940.00 -0.00i  +359.00 +0.00i   +62.00 +0.00i  -333.00 -0.00i 
 +659.00 -0.00i  +461.00 +0.00i  +500.00 -0.00i   -86.00 -0.00i 
 +634.00 -0.00i   -41.00 +0.00i  +310.00 +0.00i  +218.00 -0.00i 

 Press return to continue.