Aller au contenu

Mathc complexes/02m

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          RC4 
#define EV           RC4  
/* ------------------------------------ */       
/* ------------------------------------ */
void fun(void)
{                          
double a[RCA*(RCA*C2)] ={   
+1.329842932,+0.000000000, -0.125654450,-0.209424084, -0.041884817,-0.376963351, -0.041884817,+0.125654450, 
-0.125654450,+0.209424084, +1.910994764,+0.000000000, -0.125654450,-0.057591623, +0.031413613,+0.036649215, 
-0.041884817,+0.376963351, -0.125654450,+0.057591623, +1.785340314,+0.000000000, +0.068062827,+0.031413613, 
-0.041884817,-0.125654450, +0.031413613,-0.036649215, +0.068062827,-0.031413613, +1.973821990,+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);

  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 trois valeurs propres identiques


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

 a=[
+1.329842932+0.000000000*i,-0.125654450-0.209424084*i,-0.041884817-0.376963351*i,-0.041884817+0.125654450*i;
-0.125654450+0.209424084*i,+1.910994764+0.000000000*i,-0.125654450-0.057591623*i,+0.031413613+0.036649215*i;
-0.041884817+0.376963351*i,-0.125654450+0.057591623*i,+1.785340314+0.000000000*i,+0.068062827+0.031413613*i;
-0.041884817-0.125654450*i,+0.031413613-0.036649215*i,+0.068062827-0.031413613*i,+1.973821990+0.000000000*i]

 format short e
 E  = eigs (a,4)

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

 Press return to continue.