Mathc matrices/c11in
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* Save as : c00c.c */
/* ------------------------------------ */
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 = rsymmetric_mR(i_mR(RCA,RCA),999.);
double **sin2_A = i_mR(RCA,RCA);
double **sincos_A = i_mR(RCA,RCA);
double **EigsVector = i_mR(RCA,RCA);
double **T_EigsVector = i_mR(RCA,RCA);
double **EigsValue = i_mR(RCA,RCA);
double **sin2_EigsValue = i_mR(RCA,RCA);
double **sincos_EigsValue = i_mR(RCA,RCA);
double **T1 = i_mR(RCA,RCA);
 clrscrn();
 printf(" A :");
 p_mR(A,S10,P4,C6); 
 stop();
 clrscrn();
 eigs_V_uv_mR(A,EigsVector); 
 transpose_mR(EigsVector,T_EigsVector);
/* EigsValue : T_EigsVector * A * EigsVector */
 mul_mR(T_EigsVector,A,T1);
 mul_mR(T1,EigsVector,EigsValue); 
 f_eigs_uv_mR(f,EigsValue,sin2_EigsValue);
 f_eigs_uv_mR(g,EigsValue,sincos_EigsValue);
//A == EigsVector * EigsValue * T_EigsVector 
 mul_mR(EigsVector,sin2_EigsValue,T1);
 mul_mR(T1,T_EigsVector,sin2_A); 
 printf(" sin(2*A)");
 p_mR(sin2_A,S10,P4,C6); 
 //A == EigsVector * EigsValue * T_EigsVector 
 mul_mR(EigsVector,sincos_EigsValue,T1);
 mul_mR(T1,T_EigsVector,sincos_A); 
 printf(" 2*sin(A)*cos(A)");
 p_mR(sincos_A,S10,P4,C6); 
 f_mR(A);
 f_mR(sin2_A);
 f_mR(sincos_A);
 f_mR(EigsVector);
 f_mR(T_EigsVector);
 f_mR(EigsValue);
 f_mR(sincos_EigsValue); 
 f_mR(sin2_EigsValue); 
 f_mR(T1);
/* ------------------------------------ */
int main(void)
time_t t;
 srand(time(&t));
do
 fun();
} while(stop_w());
 return 0;
/* ------------------------------------ */
 sin(2*A) = 2*sin(A)*cos(A)
 Exemple de sortie écran :
 A :
 -837.0000 +508.0000 -635.0000 -761.0000 +184.0000 
 +508.0000 -908.0000 -152.0000 -462.0000 -482.0000 
 -635.0000 -152.0000 +915.0000 -486.0000 -54.0000 
 -761.0000 -462.0000 -486.0000 +592.0000 -891.0000 
 +184.0000 -482.0000 -54.0000 -891.0000 +382.0000 
 Press return to continue. 
 ------------------------------------ 
 sin(2*A)
 +0.2141 -0.7051 +0.2825 -0.1258 -0.1456 
 -0.7051 -0.0769 -0.1429 -0.2307 +0.0922 
 +0.2825 -0.1429 -0.6451 -0.2377 +0.0939 
 -0.1258 -0.2307 -0.2377 -0.0360 -0.4657 
 -0.1456 +0.0922 +0.0939 -0.4657 -0.2337 
 2*sin(A)*cos(A)
 +0.2141 -0.7051 +0.2825 -0.1258 -0.1456 
 -0.7051 -0.0769 -0.1429 -0.2307 +0.0922 
 +0.2825 -0.1429 -0.6451 -0.2377 +0.0939 
 -0.1258 -0.2307 -0.2377 -0.0360 -0.4657 
 -0.1456 +0.0922 +0.0939 -0.4657 -0.2337 
 Press return to continue
 Press X to stop

Wikigreen/l'electricite-verte
Précis d'épistémologie/Pourquoi l'entropie est-elle réelle ?

Mathc matrices/e09a
Étude du code
Nous allons étudier l'inversion d'une matrice en utilisant la fonction Gauss-Jordan. 
Petites études:

Mathc matrices/c09a00
Étude du code
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : inv00.c */
void fun(int r)
double **A = r_mR( i_mR(r,r), 9999.);
double **Inv = i_mR(r,r);
double **AInv = i_mR(r,r);
 clrscrn();
 printf(" Copy/Past into the octave window.\n\n");
 printf("format short e\n");
 p_Octave_mR(A,"A",P0);
 printf(" inv(A)");
 invgj_mR(A,Inv);
 pE_mR(Inv,S12,P4,C6);
 printf(" A * inv(A)");
 mul_mR(A,Inv,AInv);
 p_mR(AInv,S12,P4,C6);
 f_mR(AInv); 
 f_mR(Inv);
 f_mR(A);
/* ------------------------------------ */
int main(void)
time_t t;
 srand(time(&t));
do
 fun(rp_I(C2)+C2);
} while(stop_w());
 return 0;
/* ------------------------------------ */
C'est le fichier de base de travail.

Exemple de sortie écran :
 Copy/Past into the octave window.
format short e
 A=[
-7343,-8617,-813,-5133;
-7209,-8235,-6775,+5820;
-551,-8923,+6312,-9167;
-5693,-5883,-2301,-6689]
 inv(A)
 -4.6279e-04 +1.3133e-04 +1.6836e-04 +2.3867e-04 
 +1.7786e-04 -1.2113e-04 -1.3023e-04 -6.3410e-05 
 +3.7069e-04 -1.1162e-04 -3.5165e-05 -3.3339e-04 
 +1.0994e-04 +3.3161e-05 -1.6659e-05 -1.8218e-04 
 A * inv(A)
 +1.0000 +0.0000 +0.0000 -0.0000 
 +0.0000 +1.0000 -0.0000 -0.0000 
 +0.0000 +0.0000 +1.0000 +0.0000 
 -0.0000 +0.0000 +0.0000 +1.0000 
 Press return to continue
 Press X to stop

Mathc matrices/c09a01
Étude du code
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : inv01.c */
/* ------------------------------------ */
double **XX_invgj_mR(
double **A,
double **invA
double **ID = i_RC_mR(A[R_SIZE][C0],A[C_SIZE][C0]);
double **AID;
int r = A[R_SIZE][C0];
 r--;
 AID = i_Abr_Ac_bc_mR(r,r,r);
 eye_mR(ID);
 c_A_b_Ab_mR(A,ID,AID);
 invgj_pivot_mR(AID);
 sort_c_mR(AID);
 sort_r_mR(AID);
 c_Inv_A_mR(AID,invA);
 f_mR(AID);
 f_mR(ID);
return(invA);
/* ------------------------------------ */
void fun(int r)
double **A = r_mR( i_mR(r,r), 99.);
double **Inv = i_mR(r,r);
double **AInv = i_mR(r,r);
 clrscrn();
 printf(" Copy/Past into the octave window.\n\n");
 printf("format short e\n");
 p_Octave_mR(A,"A",P0);
 printf(" inv(A)");
 XX_invgj_mR(A,Inv);
 pE_mR(Inv,S12,P4,C6);
 printf(" A * inv(A)");
 mul_mR(A,Inv,AInv);
 p_mR(AInv,S12,P4,C6);
 f_mR(AInv); 
 f_mR(Inv);
 f_mR(A);
/* ------------------------------------ */
int main(void)
time_t t;
 srand(time(&t));
do
 fun(rp_I(C2)+C2);
} while(stop_w());
 return 0;
/* ------------------------------------ */
 Nous avons introduit la fonction invgj_mR(); que nous allons étudier. Comme cette fonction est dans la bibliothèque, nous allons l'appeler XX_invgj_mR();
 Éssayer de lire le contenu de la fonction :

Exemple de sortie écran :
 Copy/Past into the octave window.
format short e
 A=[
-59,+78,+44,-49;
+18,+32,-73,-69;
-65,+62,-73,-11;
-89,+94,-47,-27]
 inv(A)
 -1.1886e-01 +2.2621e-02 -2.6560e-01 +2.6611e-01 
 -1.3967e-01 +2.1247e-02 -3.1675e-01 +3.2822e-01 
 +1.9604e-03 -2.7208e-03 -1.6243e-02 +1.0013e-02 
 -9.7855e-02 +4.1405e-03 -1.9900e-01 +2.1104e-01 
 A * inv(A)
 +1.0000 -0.0000 +0.0000 +0.0000 
 -0.0000 +1.0000 -0.0000 +0.0000 
 -0.0000 +0.0000 +1.0000 +0.0000 
 +0.0000 -0.0000 +0.0000 +1.0000 
 Press return to continue
 Press X to stop