Mathc complexes/a127
Bibliothèque
Installer ce fichier dans votre répertoire de travail.
/* Save as : wrm_com2.h */
double **Diag_sin_mZ(
double **A,
double **sinA)
int r;
int c;
int i=0;
 m0_mZ(sinA);
 for (r=R1; r<A[R_SIZE][C0]; r++,i++)
 for (c=C1; c<A[C_SIZE][C0]; c+=C2)
 if((r+i)==c) 
 sinA[r][c] = sin(A[r][c]);
 return(sinA);
/* ------------------------------------ */
double **Diag_cos_mZ(
double **A,
double **cosA)
int r;
int c;
int i=0;
 m0_mZ(cosA);
 for (r=R1; r<A[R_SIZE][C0]; r++,i++)
 for (c=C1; c<A[C_SIZE][C0]; c+=C2)
 if((r+i)==c) cosA[r][c]=cos(A[r][c]);
 return(cosA);
/* ------------------------------------ */
void r_commute2_mZ(
double **A,
double **B,
int n
double **P; 
double **Pinv; 
double **D;
double **T;
double **Dt;
int r=rsize_Z(A);
 P = i_mZ(r,r);
 Pinv = i_mZ(r,r);
 D = i_mZ(r,r);
 T = i_mZ(r,r);
 Dt = i_mZ(r,r);
 r_mZ(P,n); 
 rdiag_mZ(D,n);
 inv_mZ(P,Pinv);
 mul_mZ(P,Diag_sin_mZ(D,Dt),T);
 mul_mZ(T,Pinv,A);
 mul_mZ(P,Diag_cos_mZ(D,Dt),T);
 mul_mZ(T,Pinv,B);
 f_mZ(P);
 f_mZ(Pinv);
 f_mZ(D);
 f_mZ(T);
 f_mZ(Dt);
/* ------------------------------------ */
 Déclaration des fichiers h.

Mathc complexes/a128
Application
Mathc complexes/a129
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c00a.c */
void fun(void)
int n = 10; 
int i = 0; 
double **A = rE_mZ(i_mZ(RCA,RCA),999,+1.E-3); 
double **A_n = i_mZ(RCA,RCA);
double **sA = i_mZ(RCA,RCA);
double **ExpA = i_mZ(RCA,RCA); 
double **NewExpA = i_mZ(RCA,RCA); 
 clrscrn(); 
 printf(" Copy/Past into the octave window. \n\n");
 p_Octave_mZ(A, "A", P3, P3);
 printf(" expm (A)\n\n\n");
 for(i = 0; i <= n; i++)
 pow_mZ(i, A, A_n); 
 smul_mZ(1./factorial(i), A_n, sA); 
 add_mZ(ExpA,sA,NewExpA); 
 c_mZ(NewExpA,ExpA);

printf(" ExpA :");
 p_mZ(ExpA,S8,P6,S8,P6,C4);
 f_mZ(A);
 f_mZ(A_n);
 f_mZ(sA);
 f_mZ(ExpA);
 f_mZ(NewExpA); 
/* ------------------------------------ */
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)
 Exemple de sortie écran :
 Copy/Past into the octave window. 
 A=[
-0.931+0.156*i,+0.215-0.504*i,+0.875-0.822*i,+0.418-0.106*i;
+0.288-0.738*i,-0.932+0.063*i,+0.568+0.540*i,-0.662+0.345*i;
+0.288-0.616*i,+0.123-0.495*i,-0.172+0.494*i,-0.964-0.190*i;
-0.433-0.191*i,+0.004-0.803*i,+0.847-0.280*i,+0.011-0.540*i]
 expm (A)
 ExpA :
+0.278034-0.263946i +0.039443-0.359540i +0.677053-0.373020i -0.103917+0.213178i 
+0.333674-0.267614i +0.448775+0.064881i +0.063273+0.212616i -0.428475+0.081523i 
+0.288970-0.221687i +0.035377-0.072844i +0.506777+0.130905i -0.716659-0.053923i 
-0.431989-0.282729i -0.199920-0.509689i +0.524032-0.342780i +0.620337-0.224214i 
 Press return to continue
 Press X to stop

Mathc complexes/a130
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c00b.c */
void fun(void)
int n = 10; 
int i = 0; 
double **A = rE_mZ(i_mZ(RCA,RCA),999,+1.E-3); 
double **A_n = i_mZ(RCA,RCA);
double **sA = i_mZ(RCA,RCA);
double **ExpA = i_mZ(RCA,RCA); 
double **NewExpA = i_mZ(RCA,RCA); 
 clrscrn(); 
 printf(" Copy/Past into the octave window. \n\n");
 p_Octave_mZ(A, "A", P3, P3);
 printf(" expm (A)\n\n");
 stop(); 
 clrscrn(); 
 printf(" A :");
 p_mZ(A,S4,P4,S8,P6,C6);
 for(i = 0; i <= n; i++)
 pow_mZ(i, A, A_n); 
 smul_mZ(1./factorial(i), A_n, sA); 
 add_mZ(ExpA,sA,NewExpA);
 printf(" NewExpA n = %d :",i);
 p_mZ(NewExpA,S8,P6,S8,P6,C6); 
 c_mZ(NewExpA,ExpA);
 stop();
 clrscrn(); 
 printf(" ExpA :");
 p_mZ(ExpA,S8,P6,S8,P6,C6);
 f_mZ(A);
 f_mZ(A_n);
 f_mZ(sA);
 f_mZ(ExpA);
 f_mZ(NewExpA); 
/* ------------------------------------ */
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)
 Exemple de sortie écran :
 Copy/Past into the octave window. 
 A=[
+0.517-0.056*i,+0.243+0.401*i,+0.138+0.308*i,-0.852-0.852*i;
-0.237-0.979*i,-0.476+0.812*i,-0.873-0.975*i,+0.938+0.887*i;
-0.125-0.106*i,+0.153-0.682*i,+0.349+0.618*i,-0.045-0.753*i;
+0.226+0.907*i,-0.081-0.716*i,+0.414+0.571*i,+0.074-0.525*i]
 expm (A)
 Press return to continue. 
 ------------------------------------
 A :
+0.5170-0.056000i +0.2430+0.401000i +0.1380+0.308000i -0.8520-0.852000i 
-0.2370-0.979000i -0.4760+0.812000i -0.8730-0.975000i +0.9380+0.887000i 
-0.1250-0.106000i +0.1530-0.682000i +0.3490+0.618000i -0.0450-0.753000i 
+0.2260+0.907000i -0.0810-0.716000i +0.4140+0.571000i +0.0740-0.525000i 
 NewExpA n = 0 :
+1.000000+0.000000i +0.000000+0.000000i +0.000000+0.000000i +0.000000+0.000000i 
+0.000000+0.000000i +1.000000+0.000000i +0.000000+0.000000i +0.000000+0.000000i 
+0.000000+0.000000i +0.000000+0.000000i +1.000000+0.000000i +0.000000+0.000000i 
+0.000000+0.000000i +0.000000+0.000000i +0.000000+0.000000i +1.000000+0.000000i 
 Press return to continue. 
 NewExpA n = 1 :
+1.517000-0.056000i +0.243000+0.401000i +0.138000+0.308000i -0.852000-0.852000i 
-0.237000-0.979000i +0.524000+0.812000i -0.873000-0.975000i +0.938000+0.887000i 
-0.125000-0.106000i +0.153000-0.682000i +1.349000+0.618000i -0.045000-0.753000i 
+0.226000+0.907000i -0.081000-0.716000i +0.414000+0.571000i +1.074000-0.525000i 
 ExpA :
+2.119712-1.154057i +0.042849+0.812418i +0.552870-0.393331i -2.067558-0.359511i 
-0.669493-0.490951i +0.608939+0.227871i -0.456034-0.964534i +0.454646+1.477771i 
-0.001853-0.283301i +0.293496-0.519407i +1.088740+0.767773i +0.306629-0.947963i 
+0.798707+1.282303i -0.148751-0.501495i +0.256848+1.118903i +1.580383-1.818201i 
 Press return to continue
 Press X to stop

Mathc complexes/a131
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c00c.c */
double **Exp_mZ(
double **A,
double **ExpA
double **A_n = i_mZ(RCA,RCA);
double **sA = i_mZ(RCA,RCA);
double **NewExpA = i_mZ(RCA,RCA);
int n = 10; 
int i = 0; 
 for(i = 0; i <= n; i++)
 pow_mZ(i, A, A_n); 
 smul_mZ(1./factorial(i), A_n, sA); 
 add_mZ(ExpA,sA,NewExpA); 
 c_mZ(NewExpA,ExpA);

f_mZ(A_n);
 f_mZ(sA);
 f_mZ(NewExpA);
 return (ExpA); 
/* ------------------------------------ */
void fun(void)
double **A = rE_mZ(i_mZ(RCA,RCA),999999999,+1.E-9); 
double **ExpA = i_mZ(RCA,RCA); 
 clrscrn(); 
 printf(" Copy/Past into the octave window. \n");
 p_Octave_mZ(A, "A", P9, P9);
 printf(" expm (A)\n\n");
 Exp_mZ(A, ExpA);
 printf(" ExpA :");
 p_mZ(ExpA,S8,P6,S8,P6,C6);
 f_mZ(A);
 f_mZ(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)
 Exemple de sortie écran :
 Copy/Past into the octave window. 
 A=[
+0.9800+0.1960*i,+0.9130+0.5030*i,+0.5290-0.6070*i,+0.6290+0.9570*i;
+0.3980-0.4720*i,+0.7180-0.0890*i,-0.7170+0.6740*i,+0.3950+0.3900*i;
+0.9690-0.0360*i,+0.0040+0.3800*i,-0.2380-0.6130*i,-0.4090+0.6630*i;
-0.0190+0.1890*i,+0.3230-0.4630*i,+0.2750-0.3880*i,+0.3600+0.4820*i]
 expm (A)
 ExpA :
+3.539701-0.246861i +3.511082+1.461404i +0.160950-0.663128i +1.251337+3.424947i 
+0.477610-0.566795i +2.517752-0.638068i -0.539014+0.958794i +0.977770+0.471292i 
+1.734940-0.403141i +1.445311+1.053302i +0.565714-0.732940i +0.108221+1.816247i 
+0.067336-0.116619i +0.800798-0.593310i +0.353656-0.060909i +1.480073+0.886323i 
 Press return to continue
 Press X to stop