Aller au contenu

Mathc complexes/02r

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-1
         
#define RCA          RC6 
#define EV           RC6  
/* ------------------------------------ */       
/* ------------------------------------ */
void fun(void)
{                          
double a[RCA*(RCA*C2)] ={   
+2.547682339,+0.000000000, -0.152948221,-0.240121509, -0.155610012,-0.195690152, -0.298057299,-0.136017286, +0.269130276,-0.188132110, -0.030470880,+0.242003023, 
-0.152948221,+0.240121509, +2.509208904,-0.000000000, -0.155129068,+0.324099386, +0.216564361,-0.033484580, -0.042828351,-0.496677449, +0.294488953,+0.063493335, 
-0.155610012,+0.195690152, -0.155129068,-0.324099386, +2.260239854,-0.000000000, -0.143493743,+0.368327431, +0.532444321,-0.134971208, +0.126713301,-0.110092820, 
-0.298057299,+0.136017286, +0.216564361,+0.033484580, -0.143493743,-0.368327431, +2.122680989,+0.000000000, +0.151516032,+0.128430424, -0.310946484,-0.029309153, 
+0.269130276,+0.188132110, -0.042828351,+0.496677449, +0.532444321,+0.134971208, +0.151516032,-0.128430424, +2.282218238,-0.000000000, +0.206791187,+0.000458645, 
-0.030470880,-0.242003023, +0.294488953,-0.063493335, +0.126713301,+0.110092820, -0.310946484,+0.029309153, +0.206791187,-0.000458645, +2.277969677,+0.000000000  
};    
                   
double **A         = ca_A_mZ(a, i_mZ(RCA,RCA));
double **EigsValue = eigs_mZ(A, i_mZ(RCA,C1));

  clrscrn();
  printf(" Copy/Past into the octave windows \n\n");
  p_Octave_mZ(A,"a",P9,P9);  
  printf(" format short e\n"
         " E  = eigs (a,%d)\n\n", RCA);
  stop();

  clrscrn();
  printf(" EigsValue :");
  p_mZ(EigsValue, S10,P4, S10,P4, C4);
  stop();

  f_mZ(A); 
  f_mZ(EigsValue);
}
/* ------------------------------------ */
int main(void)
{
    fun();
    
  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


Vérifier les valeurs propres : ici deux et trois valeurs propres identiques


Exemple de sortie écran :
 Copy/Past into the octave windows 

 a=[
+2.547682339+0.000000000*i,-0.152948221-0.240121509*i,-0.155610012-0.195690152*i,-0.298057299-0.136017286*i,+0.269130276-0.188132110*i,-0.030470880+0.242003023*i;
-0.152948221+0.240121509*i,+2.509208904-0.000000000*i,-0.155129068+0.324099386*i,+0.216564361-0.033484580*i,-0.042828351-0.496677449*i,+0.294488953+0.063493335*i;
-0.155610012+0.195690152*i,-0.155129068-0.324099386*i,+2.260239854-0.000000000*i,-0.143493743+0.368327431*i,+0.532444321-0.134971208*i,+0.126713301-0.110092820*i;
-0.298057299+0.136017286*i,+0.216564361+0.033484580*i,-0.143493743-0.368327431*i,+2.122680989+0.000000000*i,+0.151516032+0.128430424*i,-0.310946484-0.029309153*i;
+0.269130276+0.188132110*i,-0.042828351+0.496677449*i,+0.532444321+0.134971208*i,+0.151516032-0.128430424*i,+2.282218238-0.000000000*i,+0.206791187+0.000458645*i;
-0.030470880-0.242003023*i,+0.294488953-0.063493335*i,+0.126713301+0.110092820*i,-0.310946484+0.029309153*i,+0.206791187-0.000458645*i,+2.277969677+0.000000000*i]

 format short e
 E  = eigs (a,6)

 Press return to continue. 


 EigsValue :
   +3.0000   -0.0000i 
   +3.0000   +0.0000i 
   +3.0000   -0.0000i 
   +2.0000   -0.0000i 
   +2.0000   -0.0000i 
   +1.0000   +0.0000i 

 Press return to continue.