Aller au contenu

Mathc complexes/04m

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 RCA        RC4
#define FACTOR_I   200. 
/* ------------------------------------ */
/* ------------------------------------ */
int main(void)
{
double a[RCA*(RCA*C2)] ={   
 -680,   +0,  +249,   +0,   +71,   +0,  -582,   +0, 
 +940,   +0,  +359,   +0,   +62,   +0,  -333,   +0, 
 +659,   +0,  +461,   +0,  +500,   +0,   -86,   +0, 
 +634,   +0,   -41,   +0,  +310,   +0,  +218,   +0   };
                       
double **A          = ca_A_mZ(a, i_mZ(RCA,RCA)); 		
double **EigsValue  =            i_mZ(RCA,C1);

  clrscrn();
  printf(" Copy/Past into the octave windows \n\n");
  p_Octave_mRZ(A,"a",P0);  
/*  printf("format short e;\n"); */ 
  printf(" EigenValues  = eigs (a,%d)\n\n\n",RCA);

  eyeI_mZ(A,FACTOR_I); 
           
  printf(" EigsValue : FACTOR_I = %.2f",FACTOR_I);
  eigs_mZ(A,EigsValue);  
  p_mZ(EigsValue, 20,P12, 20,P12, C5); 
  
  printf(" Look at the end of the C file.\n\n\n");
  stop();
         
  f_mZ(A);
  f_mZ(EigsValue);

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

 EigsValue : FACTOR_I = 200.00
 
   +602.025962393876,   +604.393554681169, 
   +602.025962393865,   -204.393554681165, 
   -504.045539320427,   +0.0, 
   -303.006385467296,   +0.0   


*                                    200 = 0 ?   
*  (604.393554681169+204.393554681165)÷2 = 404,393554681167 


Copy A and these values into the next file.
 
double eigsvalue[RCA*C2] ={
   +602.025962393876,   +404.393554681167, 
   +602.025962393865,   -404.393554681167, 
   -504.045539320427,   +0.0, 
   -303.006385467296,   +0.0 };
*/


Calculer les valeurs propres.


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

 a=[
-680,+249,+71,-582;
+940,+359,+62,-333;
+659,+461,+500,-86;
+634,-41,+310,+218]

 EigenValues  = eigs (a,4)


 EigsValue : FACTOR_I = 200.00
   +602.025962393876   +604.393554681169i 
   +602.025962393865   -204.393554681165i 
   -504.045539320427   +199.999999999928i 
   -303.006385467296   +200.000000000057i 

 Look at the end of the C file.


 Press return to continue.