Aller au contenu

Mathc complexes/03c

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          RC3  
/* ------------------------------------ */       
/* ------------------------------------ */
void fun(void)
{                          
double a[RCA*(RCA*C2)] ={   
+0.294964029,+0.000000000, +0.007194245,+0.359712230, +0.244604317,+0.136690647, 
+0.007194245,-0.359712230, +0.438848921,+0.000000000, +0.172661871,-0.294964029, 
+0.244604317,-0.136690647, +0.172661871,+0.294964029, +0.266187050,+0.000000000, 
};
                       
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",P9,P9);  
  printf(" format short e\n"
         " [V, E]  = eigs (a,%d)\n\n", RCA);

  eigs_V_mZ(A,V,FACTOR_E);
  printf(" V :");
  p_mZ(V, S10,P4, S8,P4, C4);  

  eigs_mZ(A,EigsValue);
  printf(" EigsValue :");
  p_mZ(EigsValue, S10,P4, S8,P4, C4); 
  stop();
    
  f_mZ(A);
  f_mZ(V);    
  f_mZ(EigsValue);
}
/* ------------------------------------ */
int main(void)
{
    fun();

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


Vérifier les valeurs propres : ici deux valeurs propres identiques nulles


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

 a=[
+0.294964029+0.000000000*i,+0.007194245+0.359712230*i,+0.244604317+0.136690647*i;
+0.007194245-0.359712230*i,+0.438848921+0.000000000*i,+0.172661871-0.294964029*i;
+0.244604317-0.136690647*i,+0.172661871+0.294964029*i,+0.266187050+0.000000000*i]

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

 V :
   +0.4741 +0.2649i    -0.0155 -0.7732i    -0.0155 -0.7732i 
   +0.3347 -0.5717i    +0.6340 +0.0000i    +0.6340 +0.0000i 
   +0.5159 -0.0000i    +0.0000 +0.0000i    +0.0000 +0.0000i 

 EigsValue :
   +1.0000 -0.0000i 
   +0.0000 +0.0000i 
   -0.0000 -0.0000i 

 Press return to continue.