Aller au contenu

Mathc complexes/04n

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 
#define EVALUE       RC1  
/* ------------------------------------ */       
/* ------------------------------------ */
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 eigsvalue[RCA*C2] ={
   +602.025962393876,   +404.393554681167, 
   +602.025962393865,   -404.393554681167, 
   -504.045539320427,   +0.0, 
   -303.006385467296,   +0.0 };

double **A        = ca_A_mZ(a,                i_mZ(RCA,RCA));
double **sA       = smul_mZ(FACTOR_E,      A, i_mZ(RCA,RCA));

double **EValue   = ca_A_mZ(       eigsvalue, i_mZ(RCA,C1));
double **sEValue  = smul_mZ(FACTOR_E, EValue, i_mZ(RCA,C1));
double **D        =                           i_mZ(RCA,RCA);

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

double **Ide      =  eye_mZ(                  i_mZ(RCA,RCA));
double **zIde     =                           i_mZ(RCA,RCA);
double **sAmnszIde =                          i_mZ(RCA,RCA);

double **Ab       =            i_Abr_Ac_bc_mZ(RCA,RCA,C1);
double **b        =                      i_mZ(    RCA,C1);
double **Ab_free  =            i_Abr_Ac_bc_mZ(RCA,RCA,C2);
double  **b_free  =                      i_mZ(    RCA,C2);

  clrscrn(); 
  printf(" A :");
  p_mZ(A, S8,P0, S6,P0, C4);  
  
         zmul_mZ(i_Z(sEValue[EVALUE][C1],sEValue[EVALUE][C2]),Ide,zIde);  
          sub_mZ(sA,zIde,sAmnszIde);
      
     c_A_b_Ab_mZ(sAmnszIde,b,Ab); 

  GJ_PP_FreeV_mZ(Ab,Ab_free,b_free);
    
          c_c_mZ(b_free,C2,V,EVALUE); 

    Normalize_mZ(V);
  
  printf(" V%d :",EVALUE);
  P_mZ(V, S9,P12, S8,P12, C2); 
  printf(" Copy these values into the next file.\n\n");  
  stop();
  
  if(EVALUE==RC1) 
    { 
     clrscrn();
     printf(" Copy the Eign Values into the next file.\n\n");   
     c_U_D_mZ(EValue,D); 
     printf(" EValue : "); 
     P_mZ(D, 18,P12, 18,P12, RCA);
     stop();}  
          
  f_mZ(A);
  f_mZ(V);  
  f_mZ(EValue);
  f_mZ(sEValue);
  f_mZ(D);  
    
  f_mZ(Ide);
  f_mZ(zIde);
  f_mZ(sAmnszIde);
  
  f_mZ(sA);
  
  f_mZ(Ab);
  f_mZ(b);
  
  f_mZ(Ab_free);
  f_mZ(b_free);    
}
/* ------------------------------------ */
int main(void)
{
    fun();
    
  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


Calculer les vecteurs propres.


Exemple de sortie écran : Trouvons les valeurs complexes
 A :
    -680    +0i     +249    +0i      +71    +0i     -582    +0i 
    +940    +0i     +359    +0i      +62    +0i     -333    +0i 
    +659    +0i     +461    +0i     +500    +0i      -86    +0i 
    +634    +0i      -41    +0i     +310    +0i     +218    +0i 

 V1 :
-0.086941675784,+0.137530775811,      -nan,    -nan, 
+0.079982417904,+0.478215807143,      -nan,    -nan, 
+0.690803310381,+0.311037125623,      -nan,    -nan, 
+0.405568216447,+0.000000000000,      -nan,    -nan  

     -nan,    -nan,      -nan,    -nan, 
     -nan,    -nan,      -nan,    -nan, 
     -nan,    -nan,      -nan,    -nan, 
     -nan,    -nan,      -nan,    -nan  

 Copy these values into the next file.

 Press return to continue.