Mathc complexes/04i
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 RC3
#define EVALUE RC1
/* ------------------------------------ */
/* ------------------------------------ */
void fun(void)
{
double a[RCA*(RCA*C2)] ={
+799, +0, +211, +0, +972, +0,
-791, +0, -775, +0, +886, +0,
+258, +0, -748, +0, +845, +0 };
double eigsvalue[RCA*C2] ={
-258.452490846828,+793.405003240218,
-258.452490846828,-793.405003240218,
+1385.904981693673,+0};
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 :
+799 +0i +211 +0i +972 +0i
-791 +0i -775 +0i +886 +0i
+258 +0i -748 +0i +845 +0i
V1 :
-0.392876479763,-0.184665385219, -nan, -nan,
+0.543372780837,-0.551826033775, -nan, -nan,
+0.460196497862,-0.000000000000, -nan, -nan
-nan, -nan,
-nan, -nan,
-nan, -nan
Copy these values into the next file.
Press return to continue.
Copy the eignvalue into the next file.
EValue :
-258.452490846828, +793.405003240218, +0.000000000000, +0.000000000000, +0.000000000000, +0.000000000000,
+0.000000000000, +0.000000000000, -258.452490846828, -793.405003240218, +0.000000000000, +0.000000000000,
+0.000000000000, +0.000000000000, +0.000000000000, +0.000000000000, +1385.904981693673, +0.000000000000
Press return to continue.