Mathc complexes/04r
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
#define EVALUE RC1
/* ------------------------------------ */
/* ------------------------------------ */
void fun(void)
{
double a[RCA*(RCA*C2)] ={
+171, +0, -514, +0,
+630, +0, -12, +0
};
double eigsvalue[RCA*C2] ={
+79.500000000000, +561.6473537728085,
+79.500000000000, -561.6473537728085 };
double **A = ca_A_mZ(a, i_mZ(RCA,RCA));
double **sA = smul_mZ(FACTOR_E, A, i_mZ(RCA,RCA));
double **EValue = ca_A_mZ( eigsvalue, i_mZ(RCA,C1));
double **sEValue = smul_mZ(FACTOR_E, EValue, i_mZ(RCA,C1));
double **D = i_mZ(RCA,RCA);
double **V = i_mZ(RCA,RCA);
double **Ide = eye_mZ( i_mZ(RCA,RCA));
double **zIde = i_mZ(RCA,RCA);
double **sAmnszIde = i_mZ(RCA,RCA);
double **Ab = i_Abr_Ac_bc_mZ(RCA,RCA,C1);
double **b = i_mZ( RCA,C1);
double **Ab_free = i_Abr_Ac_bc_mZ(RCA,RCA,C2);
double **b_free = i_mZ( RCA,C2);
clrscrn();
printf(" A :");
p_mZ(A, S8,P0, S6,P0, C4);
zmul_mZ(i_Z(sEValue[EVALUE][C1],sEValue[EVALUE][C2]),Ide,zIde);
sub_mZ(sA,zIde,sAmnszIde);
c_A_b_Ab_mZ(sAmnszIde,b,Ab);
GJ_PP_FreeV_mZ(Ab,Ab_free,b_free);
c_c_mZ(b_free,C2,V,EVALUE);
Normalize_mZ(V);
printf(" V%d :",EVALUE);
P_mZ(V, S9,P12, S8,P12, C2);
printf(" Copy these values into the next file.\n\n");
stop();
if(EVALUE==RC1)
{
clrscrn();
printf(" Copy the Eign Values into the next file.\n\n");
c_U_D_mZ(EValue,D);
printf(" EValue : ");
P_mZ(D, 18,P12, 18,P12, RCA);
stop();}
f_mZ(A);
f_mZ(V);
f_mZ(EValue);
f_mZ(sEValue);
f_mZ(D);
f_mZ(Ide);
f_mZ(zIde);
f_mZ(sAmnszIde);
f_mZ(sA);
f_mZ(Ab);
f_mZ(b);
f_mZ(Ab_free);
f_mZ(b_free);
}
/* ------------------------------------ */
int main(void)
{
fun();
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Calculer les vecteurs propres.
Exemple de sortie écran : Trouvons les valeurs complexes
A :
+171 +0i -514 +0i
+630 +0i -12 +0i
V1 :
+0.107779907643,+0.661577048279, -nan, -nan,
+0.742091167377,+0.000000000000, -nan, -nan
Copy these values into the next file.
Press return to continue.
Copy the Eign Values into the next file.
EValue :
+79.500000000000, +561.647353772809, +0.000000000000, +0.000000000000,
+0.000000000000, +0.000000000000, +79.500000000000, -561.647353772809
Press return to continue.