Aller au contenu

Mathc complexes/000

Un livre de Wikilivres.


Valeurs propres


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          RC2  
/* ------------------------------------ */       
/* ------------------------------------ */
int main(void)
{                          
double a[RCA*(RCA*C2)] ={   
 +26191,   +0,   -3444,+9191, 
  -3444,-9191,  +27183,   +0};
                       
double **A =     ca_A_mZ(a, i_mZ(RCA,RCA));
double **V =                i_mZ(RCA,RCA);
double **EigsValue  =       i_mZ(RCA,C1);

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

  eigs_V_mZ(A,V,FACTOR_E);
  printf(" V :");
  pE_mZ(V, S12,P4, S12,P4, C3); 

  eigs_mZ(A,EigsValue);
  printf(" EigsValue :");
  pE_mZ(erase_i_mZ(EigsValue), S12,P4, S12,P4, C4);
  stop();
    
  f_mZ(A);
  f_mZ(V);    
  f_mZ(EigsValue);

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


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

 a=[
+26191+0*i,-3444+9191*i;
-3444-9191*i,+27183+0*i]

 format short e
 [V, E]  = eigs (a,2)

 V :
 -2.4177e-01 +6.4522e-01i  +2.5430e-01 -6.7865e-01i 
 +7.2473e-01 +0.0000e+00i  +6.8903e-01 +0.0000e+00i 

 EigsValue :
 +36514.5955     -0.0000i 
 +16859.4045     +0.0000i 

 Press return to continue.