Mathc complexes/04e
Installer et compiler ces fichiers dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
#define RC RC5
#define FACTOR_I 10.
#define FACTOR_I0 0.
/* ------------------------------------ */
void fun(void)
{
double **A = r_mRZ(i_mZ(RC,RC),999.);
double **EigsValue = i_mZ(RC,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",RC);
printf(" EigsValue :");
eigs_mZ(A,EigsValue);
p_mZ(EigsValue, S15,P9, S15,P9, C5);
eyeI_mZ(A,FACTOR_I);
printf(" EigsValue : FACTOR_I = %.2f",FACTOR_I);
eigs_mZ(A,EigsValue);
p_mZ(EigsValue, S15,P9, S15,P9, C5);
stop();
clrscrn();
eyeI_mZ(A,FACTOR_I0);
printf(" A : FACTOR_I0 = %.2f",FACTOR_I0);
P_mZ(A, S5,P0, S5,P0, C10);
f_mZ(A);
f_mZ(EigsValue);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun();
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Exemple de sortie écran : Trouvons les valeurs complexes
Copy/Past into the octave windows
a=[
+163+0*i,+180+0*i,+72+0*i,-548+0*i,+169+0*i;
-957+0*i,-380+0*i,-23+0*i,+596+0*i,+204+0*i;
-103+0*i,-647+0*i,-530+0*i,+30+0*i,+778+0*i;
-198+0*i,+68+0*i,-583+0*i,+739+0*i,+190+0*i;
+113+0*i,+239+0*i,-325+0*i,+10+0*i,-650+0*i]
EigenValues = eigs (a,5)
EigsValue :
+1026.847923394 +0.000000000i
-291.061517028 +0.000000000i
-986.279642106 +0.000000000i
-49.167947584 +0.000000000i
-358.338816675 +0.000000000i
EigsValue : FACTOR_I = 10.00
+1026.847923394 +10.000000000i
-638.670467647 +544.192423634i
-638.670691487 -524.192423634i
-203.753382130 +454.260482093i
-203.753382130 -434.260482093i
Press return to continue.
A : FACTOR_I0 = 0.00
+163, +0, +180, +0, +72, +0, -548, +0, +169, +0,
-957, +0, -380, +0, -23, +0, +596, +0, +204, +0,
-103, +0, -647, +0, -530, +0, +30, +0, +778, +0,
-198, +0, +68, +0, -583, +0, +739, +0, +190, +0,
+113, +0, +239, +0, -325, +0, +10, +0, -650, +0
Press return to continue
Press X return to stop