Aller au contenu

Mathc complexes/04q

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        RC2
#define FACTOR_I   200. 
/* ------------------------------------ */
/* ------------------------------------ */
int main(void)
{
double a[RCA*(RCA*C2)] ={   
 +171,   +0,  -514,   +0, 
 +630,   +0,   -12,   +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
 
    +79.499999999999   +761.647353772807i 
    +79.500000000000   -361.647353772810i 


*                                    200 = 0 ?   
*  (761.647353772807 + 361.647353772810)÷2 = 561,6473537728085 


Copy A and these values into the next file.
 
double eigsvalue[RCA*C2] ={
    +79.500000000000,  +561.6473537728085, 
    +79.500000000000,  -561.6473537728085 };
*/


Calculer les valeurs propres.


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

 a=[
+171,-514;
+630,-12]

 EigenValues  = eigs (a,2)


 EigsValue : FACTOR_I = 200.00
    +79.499999999999   +761.647353772807i 
    +79.500000000000   -361.647353772810i 

 Look at the end of the C file.


 Press return to continue.