Mathc complexes/04s
Apparence
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-3
#define RCA RC2
/* ------------------------------------ */
/* ------------------------------------ */
void fun(void)
{
double a[RCA*(RCA*C2)] ={
+171, +0, -514, +0,
+630, +0, -12, +0
};
double v[RCA*(RCA*C2)] ={
/* This is the copy of V1 and V2 of the last files
V1 V2 ... */
+0.107779907643,+0.661577048279, +0.107779907643,-0.661577048279,
+0.742091167377,+0.000000000000, +0.742091167377,+0.000000000000
};
double eigsvalue[RCA*(RCA*C2)] ={
+79.500000000000, +561.647353772809, +0.000000000000, +0.000000000000,
+0.000000000000, +0.000000000000, +79.500000000000, -561.647353772809
};
double **A = ca_A_mZ(a, i_mZ(RCA,RCA));
double **V = ca_A_mZ(v, i_mZ(RCA,RCA));
double **invV = invgj_mZ(V, i_mZ(RCA,RCA));
double **T = i_mZ(RCA,RCA);
double **EigsValue = ca_A_mZ(eigsvalue, i_mZ(RCA,RCA));
clrscrn();
printf(" A :");
p_mZ(A, S8,P4, S6,P4, C4);
printf(" V :");
p_mZ(V, S8,P4, S6,P4, C4);
printf(" invV :");
p_mZ(invV, S8,P4, S6,P4, C4);
stop();
clrscrn();
printf(" EigsValue : invV * A * V");
mul_mZ(invV,A,T);
mul_mZ(T,V,EigsValue);
p_mZ(clean_eyes_mZ(EigsValue), S8,P2, S6,P2, C4);
printf(" A :");
p_mZ(A, S8,P4, S6,P4, C4);
printf(" A = V * EigsValue * invV");
mul_mZ(V,EigsValue,T);
mul_mZ(T,invV,A);
p_mZ(A, S8,P4, S6,P4, C4);
stop();
f_mZ(A);
f_mZ(V);
f_mZ(invV);
f_mZ(T);
f_mZ(EigsValue);
}
/* ------------------------------------ */
int main(void)
{
fun();
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Vérifions les calculs précédents.
Exemple de sortie écran : Trouvons les valeurs complexes
A :
+171.0000+0.0000i -514.0000+0.0000i
+630.0000+0.0000i -12.0000+0.0000i
V :
+0.1078+0.6616i +0.1078-0.6616i
+0.7421+0.0000i +0.7421+0.0000i
invV :
+0.0000-0.7558i +0.6738+0.1098i
+0.0000+0.7558i +0.6738-0.1098i
Press return to continue.
EigsValue : invV * A * V
+79.50+561.65i +0.00 +0.00i
+0.00 +0.00i +79.50-561.65i
A :
+171.0000+0.0000i -514.0000+0.0000i
+630.0000+0.0000i -12.0000+0.0000i
A = V * EigsValue * invV
+171.0000+0.0000i -514.0000+0.0000i
+630.0000-0.0000i -12.0000+0.0000i
Press return to continue.