Aller au contenu

Mathc complexes/04b

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);
  
  eyeI_mZ(A,FACTOR_I);
         
  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=[
-984+0.0000*i,+18+0.0000*i,-134+0.0000*i,+86+0.0000*i,-369+0.0000*i;
+400+0.0000*i,+835+0.0000*i,-650+0.0000*i,+767+0.0000*i,+400+0.0000*i;
+442+0.0000*i,-251+0.0000*i,-641+0.0000*i,-275+0.0000*i,+261+0.0000*i;
+180+0.0000*i,-340+0.0000*i,+504+0.0000*i,-119+0.0000*i,-839+0.0000*i;
+14+0.0000*i,-632+0.0000*i,-932+0.0000*i,-571+0.0000*i,-558+0.0000*i]

 EigenValues  = eigs (a,5)


 EigsValue :
 -955.340592178 +617.984485030i 
 -955.338252673 -597.984485030i 
 +692.785565110  +10.000000000i 
 -452.380893265  +10.000000000i 
 +203.274173006  +10.000000000i 


 Press   return to continue
 Press X return to stop


Octave :
EigenValues  = eigs (a,4)
EigenValues =

  -955.34 + 607.96i
  -955.34 - 607.96i
   692.79 +      0i
  -452.38 +      0i
   203.27 +      0i