Mathc complexes/a93
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-2
#define RCA RC4
/* ------------------------------------ */
/* ------------------------------------ */
double f(
double x)
{
return(sin(x)*sin(x));
}
char feq[] = "sin(x)*sin(x)";
/* ------------------------------------ */
double g(
double x)
{
return(cos(x)*cos(x));
}
char geq[] = "cos(x)*cos(x)";
/* ------------------------------------ */
void fun(void)
{
double a[RC4*(RC4*C2)] ={
+25072, +0, +21293, -4811, +5386, -6531, +11975, -5847,
+21293, +4811, +30848, +0, -1526, -1774, +13478, -6658,
+5386, +6531, -1526, +1774, +20007, +0, +7542, -1322,
+11975, +5847, +13478, +6658, +7542, +1322, +21250, +0 };
double **A = ca_A_mZ(a, i_mZ(RCA,RCA));
double **V = i_mZ(RCA,RCA);
double **cV_T = i_mZ(RCA,RCA);
double **T = i_mZ(RCA,RCA);
double **EigsValue = i_mZ(RCA,RCA);
double **sin_EValue = i_mZ(RCA,RCA);
double **cos_EValue = i_mZ(RCA,RCA);
double **sin_A = i_mZ(RCA,RCA);
double **cos_A = i_mZ(RCA,RCA);
clrscrn();
printf(" A :");
p_mZ(A, S7,P0, S7,P0, C6);
stop();
clrscrn();
eigs_V_mZ(A,V,FACTOR_E);
ctranspose_mZ(V,cV_T);
/* EigsValue = cV_T * A * V */
mul_mZ(cV_T,A,T);
mul_mZ(T,V,EigsValue);
f_eigs_mZ(f,EigsValue,sin_EValue);
f_eigs_mZ(g,EigsValue,cos_EValue);
/* sin**2 = V * sin_EValue * cV_T*/
mul_mZ(V,sin_EValue,T);
mul_mZ(T,cV_T,sin_A);
printf(" sin(A)**2");
p_mZ(sin_A, S7,P3, S7,P3, C6);
/* cos**2 = V * cos_EValue * cV_T*/
mul_mZ(V,cos_EValue,T);
mul_mZ(T,cV_T,cos_A);
printf(" cos(A)**2");
p_mZ(cos_A, S7,P3, S7,P3, C6);
add_mZ(sin_A,cos_A,A);
printf(" sin(A)**2 + cos(A)**2 = 1");
p_mZ(A, S7,P3, S7,P3, C6);
stop();
f_mZ(A);
f_mZ(V);
f_mZ(cV_T);
f_mZ(T);
f_mZ(EigsValue);
f_mZ(sin_EValue);
f_mZ(cos_EValue);
f_mZ(sin_A);
f_mZ(cos_A);
}
/* ------------------------------------ */
int main(void)
{
fun();
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Avec les matrices réelles nous avons calculer les vecteurs et valeurs propres des matrices symétriques. Avec les matrices complexes nous allons calculer les vecteurs et valeurs propres des matrices symétriques conjuguées.
Contrôle du facteur :
- FACTOR_E ..... +1.E-1 ......... -9 < x < 9
- FACTOR_E ..... +1.E-2 ....... -99 < x < 99
- FACTOR_E ..... +1.E-3 ..... -999 < x < 999
Nous allons étudier une des propriétés des valeurs propres et des vecteurs propres :
sin(A)**2 + cos(A)**2 = 1
Exemple de sortie écran :
------------------------------------
A :
+25072 +0i +21293 -4811i +5386 -6531i +11975 -5847i
+21293 +4811i +30848 +0i -1526 -1774i +13478 -6658i
+5386 +6531i -1526 +1774i +20007 +0i +7542 -1322i
+11975 +5847i +13478 +6658i +7542 +1322i +21250 +0i
Press return to continue.
------------------------------------
sin(A)**2
+0.693 -0.000i +0.125 -0.108i +0.055 -0.098i -0.014 +0.162i
+0.125 +0.108i +0.535 +0.000i +0.167 -0.042i +0.057 -0.180i
+0.055 +0.098i +0.167 +0.042i +0.203 +0.000i -0.119 +0.046i
-0.014 -0.162i +0.057 +0.180i -0.119 -0.046i +0.802 +0.000i
cos(A)**2
+0.307 -0.000i -0.125 +0.108i -0.055 +0.098i +0.014 -0.162i
-0.125 -0.108i +0.465 +0.000i -0.167 +0.042i -0.057 +0.180i
-0.055 -0.098i -0.167 -0.042i +0.797 -0.000i +0.119 -0.046i
+0.014 +0.162i -0.057 -0.180i +0.119 +0.046i +0.198 -0.000i
sin(A)**2 + cos(A)**2 = 1
+1.000 -0.000i +0.000 -0.000i -0.000 +0.000i -0.000 +0.000i
+0.000 +0.000i +1.000 +0.000i +0.000 +0.000i +0.000 -0.000i
-0.000 -0.000i +0.000 -0.000i +1.000 -0.000i -0.000 +0.000i
-0.000 -0.000i +0.000 +0.000i -0.000 -0.000i +1.000 -0.000i
Press return to continue.