Mathc complexes/a97
Installer et compiler ces fichiers dans votre répertoire de travail.
c00b.c |
---|
/* ------------------------------------ */
/* Save as : c00b.c */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
#define RCA RC5
#define FACTOR_E +1.E-2
/* ------------------------------------ */
/* ------------------------------------ */
double f(
double x)
{
return(cos(2*x));
}
char feq[] = "cos(2*x)";
/* ------------------------------------ */
double g(
double x)
{
return(2*cos(x)*cos(x)-1);
}
char geq[] = "2*cos(x)**2-1";
/* ------------------------------------ */
/* ------------------------------------ */
void fun(void)
{
double **A = rcsymmetric_mZ(i_mZ(RCA,RCA),99);
double **cos2_A = i_mZ(RCA,RCA);
double **coscosmns1_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 **cos2A_EigsValue = i_mZ(RCA,RCA);
double **coscosmns1_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,cos2A_EigsValue);
f_eigs_mZ(g,EigsValue,coscosmns1_EigsValue);
/*A == EigsVector * EigsValue * T_EigsVector */
mul_mZ(EigsVector,cos2A_EigsValue,T1);
mul_mZ(T1,T_EigsVector,cos2_A);
printf(" cos(2*A)");
p_mZ(cos2_A, S7,P3, S7,P3, C6);
//A == EigsVector * EigsValue * T_EigsVector
mul_mZ(EigsVector,coscosmns1_EigsValue,T1);
mul_mZ(T1,T_EigsVector,coscosmns1_A);
printf(" 2*cos(A)*cos(A)-1");
p_mZ(coscosmns1_A, S7,P3, S7,P3, C6);
f_mZ(A);
f_mZ(EigsVector);
f_mZ(T_EigsVector);
f_mZ(T1);
f_mZ(EigsValue);
f_mZ(cos2A_EigsValue);
f_mZ(coscosmns1_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 :
cos(2*A) = 2*cos(A)**2-1
Exemple de sortie écran :
------------------------------------
A :
+24470 +0i -788 -589i -20527 -6466i +4416 +18457i -9124 +4518i
-788 +589i +50751 +0i +16068 +10470i +1142 +3657i -24700 -14291i
-20527 +6466i +16068 -10470i +39657 +0i -16566 -28257i +3190 -12531i
+4416 -18457i +1142 -3657i -16566 +28257i +47113 +0i +3325 +21779i
-9124 -4518i -24700 +14291i +3190 +12531i +3325 -21779i +37792 +0i
Press return to continue.
------------------------------------
cos(2*A)
+0.561 +0.000i +0.210 -0.270i -0.227 -0.079i -0.101 -0.322i +0.187 +0.010i
+0.210 +0.270i -0.487 +0.000i +0.203 -0.003i -0.316 +0.144i +0.419 +0.194i
-0.227 +0.079i +0.203 +0.003i -0.442 -0.000i -0.231 -0.045i +0.368 -0.269i
-0.101 +0.322i -0.316 -0.144i -0.231 +0.045i +0.381 +0.000i +0.136 -0.320i
+0.187 -0.010i +0.419 -0.194i +0.368 +0.269i +0.136 +0.320i +0.405 +0.000i
2*cos(A)*cos(A)-1
+0.561 -0.000i +0.210 -0.270i -0.227 -0.079i -0.101 -0.322i +0.187 +0.010i
+0.210 +0.270i -0.487 +0.000i +0.203 -0.003i -0.316 +0.144i +0.419 +0.194i
-0.227 +0.079i +0.203 +0.003i -0.442 -0.000i -0.231 -0.045i +0.368 -0.269i
-0.101 +0.322i -0.316 -0.144i -0.231 +0.045i +0.381 -0.000i +0.136 -0.320i
+0.187 -0.010i +0.419 -0.194i +0.368 +0.269i +0.136 +0.320i +0.405 +0.000i
Press return to continue
Press X to stop