Mathc complexes/a99
Installer et compiler ces fichiers dans votre répertoire de travail.
c00c.c |
---|
/* ------------------------------------ */
/* Save as : c00c.c */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
#define RCA RC4
#define FACTOR_E +1.E-2
/* ------------------------------------ */
/* ------------------------------------ */
double f(
double x)
{
return(sin(2*x));
}
char feq[] = "sin(2*x)";
/* ------------------------------------ */
double g(
double x)
{
return(2*sin(x)*cos(x));
}
char geq[] = "2*sin(x)*cos(x)";
/* ------------------------------------ */
/* ------------------------------------ */
void fun(void)
{
double **A = rcsymmetric_mZ(i_mZ(RCA,RCA),99);
double **sin2_A = i_mZ(RCA,RCA);
double **sincos_A = i_mZ(RCA,RCA);
double **EigsVector = i_mZ(RCA,RCA);
double **T_EigsVector = i_mZ(RCA,RCA);
double **EigsValue = i_mZ(RCA,RCA);
double **sin2_EigsValue = i_mZ(RCA,RCA);
double **sincos_EigsValue = i_mZ(RCA,RCA);
double **T1 = i_mZ(RCA,RCA);
clrscrn();
printf(" A :");
p_mZ(A, S7,P0, S7,P0, C6);
stop();
clrscrn();
eigs_V_mZ(A,EigsVector,FACTOR_E);
ctranspose_mZ(EigsVector,T_EigsVector);
/* EigsValue = cV_T * A * V */
mul_mZ(T_EigsVector,A,T1);
mul_mZ(T1,EigsVector,EigsValue);
f_eigs_mZ(f,EigsValue,sin2_EigsValue);
f_eigs_mZ(g,EigsValue,sincos_EigsValue);
/*A == EigsVector * EigsValue * T_EigsVector */
mul_mZ(EigsVector,sin2_EigsValue,T1);
mul_mZ(T1,T_EigsVector,sin2_A);
printf(" sin(2*A)");
p_mZ(sin2_A, S7,P3, S7,P3, C6);
//A == EigsVector * EigsValue * T_EigsVector
mul_mZ(EigsVector,sincos_EigsValue,T1);
mul_mZ(T1,T_EigsVector,sincos_A);
printf(" 2*sin(A)*cos(A)");
p_mZ(sincos_A, S7,P3, S7,P3, C6);
f_mZ(A);
f_mZ(sin2_A);
f_mZ(sincos_A);
f_mZ(EigsVector);
f_mZ(T_EigsVector);
f_mZ(EigsValue);
f_mZ(sincos_EigsValue);
f_mZ(sin2_EigsValue);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun();
} while(stop_w());
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(2*A) == 2*sin(A)*cos(A)
Exemple de sortie écran :
------------------------------------
A :
+20461 +0i +13047 -733i +1824 +5759i -1221 +6788i
+13047 +733i +44131 +0i -2879 -1889i +5638 +17338i
+1824 -5759i -2879 +1889i +18759 +0i +3418 -1814i
-1221 -6788i +5638 -17338i +3418 +1814i +14530 +0i
Press return to continue.
------------------------------------
sin(2*A)
+0.214 -0.000i -0.263 +0.092i +0.012 +0.134i +0.178 -0.017i
-0.263 -0.092i -0.061 +0.000i -0.004 -0.013i -0.168 -0.344i
+0.012 -0.134i -0.004 +0.013i +0.449 -0.000i -0.161 +0.146i
+0.178 +0.017i -0.168 +0.344i -0.161 -0.146i +0.439 +0.000i
2*sin(A)*cos(A)
+0.214 +0.000i -0.263 +0.092i +0.012 +0.134i +0.178 -0.017i
-0.263 -0.092i -0.061 +0.000i -0.004 -0.013i -0.168 -0.344i
+0.012 -0.134i -0.004 +0.013i +0.449 +0.000i -0.161 +0.146i
+0.178 +0.017i -0.168 +0.344i -0.161 -0.146i +0.439 +0.000i
Press return to continue
Press X to stop