Aller au contenu

Mathc complexes/a108

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-2      
#define RCA           RC4  
/* ------------------------------------ */       
/* ------------------------------------ */
double f(
double x)
{  
        return((x)*(x)*(x)*(x));
}
char  feq[] =  "(x)**4";
/* ------------------------------------ */
/* ------------------------------------ */
void fun(void)
{
double **A             = rcsymmetric_mRZ(i_mZ(RCA,RCA),99.);
double **A_p4          =                 i_mZ(RCA,RCA);

double **EigsVector    =                 i_mZ(RCA,RCA);
double **T_EigsVector  =                 i_mZ(RCA,RCA);

double **EigsValue     =                 i_mZ(RCA,RCA);
double **f_EigsValue   =                 i_mZ(RCA,RCA);

double **T1            =                 i_mZ(RCA,RCA);
  
  clrscrn();
  printf(" A ");   
  p_mRZ(A, S8,P0, C6);   

  eigs_V_mZ(A,EigsVector,FACTOR_E); 
  transpose_mZ(EigsVector,T_EigsVector);
      
/* EigsValue : T_EigsVector * A * EigsVector */
  mul_mZ(T_EigsVector,A,T1);
  mul_mZ(T1,EigsVector,EigsValue);     
  
  f_eigs_mZ(f,EigsValue,f_EigsValue);
 
//A == EigsVector * EigsValue * T_EigsVector       
  mul_mZ(EigsVector,f_EigsValue,T1);
  mul_mZ(T1,T_EigsVector,A_p4);
  
  printf(" A**4 : EigsVector * EigsValue**4 * T_EigsVector");  
  pE_mRZ(A_p4,S12,P4,C6);     
  
  printf(" A**4");   
  pE_mRZ(pow_mZ(4,A,T1),S12,P4,C6);   
   
  f_mZ(A);
  f_mZ(A_p4);
    
  f_mZ(EigsVector);
  f_mZ(T_EigsVector);
  
  f_mZ(EigsValue);
  f_mZ(f_EigsValue);    
     
  f_mZ(T1);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));

do
{
  fun();

} while(stop_w());

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


              A**4== V * EValue**4 * T_V


Exemple de sortie écran :
 ------------------------------------
 A 
   +7044    +6440    +1894    +6788 
   +6440   +14485   +12220    +5986 
   +1894   +12220   +18273    -1622 
   +6788    +5986    -1622   +19996 

 A**4 : EigsVector * EigsValue**4 * T_EigsVector
 +1.2213e+17  +2.1386e+17  +1.5965e+17  +1.8631e+17 
 +2.1386e+17  +4.4674e+17  +4.0186e+17  +2.6604e+17 
 +1.5965e+17  +4.0186e+17  +4.1575e+17  +1.4140e+17 
 +1.8631e+17  +2.6604e+17  +1.4140e+17  +3.3621e+17 

 A**4
 +1.2213e+17  +2.1386e+17  +1.5965e+17  +1.8631e+17 
 +2.1386e+17  +4.4674e+17  +4.0186e+17  +2.6604e+17 
 +1.5965e+17  +4.0186e+17  +4.1575e+17  +1.4140e+17 
 +1.8631e+17  +2.6604e+17  +1.4140e+17  +3.3621e+17 


 Press return to continue
 Press X      to stop