Aller au contenu

Mathc complexes/04c

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 RC         RC5
#define FACTOR_I   10
/* ------------------------------------ */
/* ------------------------------------ */
void fun(void)
{
double **A          = r_mRZ(i_mZ(RC,RC),999.);
double **EigsValue  =       i_mZ(RC,C1);

  clrscrn();
  printf(" Copy/Past into the octave windows \n\n");
  p_Octave_mZ(A,"a",P0,P4);  
  printf(" EigenValues  = eigs (a,%d)\n\n\n",RC);
  stop(); 
  
  clrscrn(); 
  eyeI_mZ(A,FACTOR_I);
  
  p_Octave_mZ(A,"a",P0,P4);  
  printf(" EigenValues  = eigs (a,%d)\n\n\n",RC);
          
  printf(" EigsValue :");
  eigs_mZ(A,EigsValue);  
  p_mZ(EigsValue, S15,P9, S15,P9, C5); 
       
  f_mZ(A);
  f_mZ(EigsValue);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));

do
{
  fun();
  
} while(stop_w());

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


Exemple de sortie écran : Trouvons les valeurs complexes
 Copy/Past into the octave windows 

 a=[
-466+0.0000*i,+941+0.0000*i,+793+0.0000*i,+403+0.0000*i,-459+0.0000*i;
-449+0.0000*i,-505+0.0000*i,+670+0.0000*i,+177+0.0000*i,-621+0.0000*i;
-126+0.0000*i,-720+0.0000*i,+897+0.0000*i,+107+0.0000*i,-760+0.0000*i;
+360+0.0000*i,+48+0.0000*i,+630+0.0000*i,+640+0.0000*i,+623+0.0000*i;
+266+0.0000*i,+449+0.0000*i,-273+0.0000*i,-4+0.0000*i,-351+0.0000*i]

 EigenValues  = eigs (a,5)


 Press return to continue. 


 a=[
-466+10.0000*i,+941+0.0000*i,+793+0.0000*i,+403+0.0000*i,-459+0.0000*i;
-449+0.0000*i,-505+10.0000*i,+670+0.0000*i,+177+0.0000*i,-621+0.0000*i;
-126+0.0000*i,-720+0.0000*i,+897+10.0000*i,+107+0.0000*i,-760+0.0000*i;
+360+0.0000*i,+48+0.0000*i,+630+0.0000*i,+640+10.0000*i,+623+0.0000*i;
+266+0.0000*i,+449+0.0000*i,-273+0.0000*i,-4+0.0000*i,-351+10.0000*i]

 EigenValues  = eigs (a,5)


 EigsValue :
 -293.960912123 +914.360413662i 
 -293.960909503 -894.360413662i 
 +854.681645406  +10.000000000i 
 -564.919903704  +10.000000000i 
 +513.160079923  +10.000000000i 


 Press   return to continue
 Press X return to stop


Remarque : Ici il ne faut pas utiliser les signes. (Les valeurs sont conjuguées)

* (914.360413662 +894.360413662) / 2 = 904,360413662 


Octave :
EigenValues =

  -293.96 + 904.36i
  -293.96 - 904.36i
   854.68 +      0i
  -564.92 +      0i
   513.16 +      0i