Mathc matrices/a79
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c00c.c |
---|
/* ------------------------------------ */
/* Save as : c00c.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
#define RCA RC6
/* ------------------------------------ */
void fun(void)
{
double **A = rE_mR(i_mR(RCA,RCA),999,+1.E-3);
double **ExpA = i_mR(RCA,RCA);
clrscrn();
printf(" Copy/Past into the octave window. \n");
p_Octave_mR(A, "A", P4);
printf(" expm (A)\n\n");
Exp_mR(A, ExpA);
printf(" ExpA :");
p_mR(ExpA,S8,P6,C6);
f_mR(A);
f_mR(ExpA);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun();
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
ExpA = Ide + A + (1/2) A**2 + (1/6) A**3 + ... + 1/(n-1)! A**(n-1) Dans cet exemple je vous propose la fonction Exp_mR(A, ExpA); qui calcul directement la forme exponentielle de A. Exemple de sortie écran :
Copy/Past into the octave window.
A=[
+0.3230,+0.4220,+0.4330,+0.4660;
+0.4080,+0.9810,-0.8480,+0.7700;
+0.9930,+0.1970,-0.7240,-0.4430;
-0.2110,-0.7220,-0.8730,-0.7070]
expm (A)
ExpA :
+1.534408 +0.620268 +0.022490 +0.571371
-0.019000 +2.058830 -1.292284 +1.109739
+0.997799 +0.608442 +0.508767 +0.105784
-0.577654 -1.040181 -0.126381 +0.171784
Press return to continue
Press X to stop