Aller au contenu

Mathc complexes/03t

Un livre de Wikilivres.


Application


Installer et compiler ces fichiers dans votre répertoire de travail.


c00a.c
/* ------------------------------------ */
/*  Save as :   c00a.c                  */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
#define   RCA RC3
#define   CX  C1
/* ------------------------------------ */
/* ------------------------------------ */
int main(void)
{
double a[RCA*(RCA*C2)]={
    +3,1, -4,1, -2,1, 
    +5,2, -3,2, -0,2,      
    +6,3, -0,3, -3,3  
};

double x_B[RCA*(CX*C2)]={
   +1,+1,
   +2,+2, 
   +3,+3
};

double b[RCA*(RCA*C2)]={
    +1,+2, +2,+5, +6,+2, 
    +3,+3, +2,+4, +1,+3, 
    +5,+4, +5,+3, +3,+4,
};

double **A   = ca_A_mZ(a, i_mZ(RCA,RCA));
double **B   = ca_A_mZ(b, i_mZ(RCA,RCA));
double **D     =          i_mZ(RCA,RCA) ;

double **X_B = ca_A_mZ(x_B,  i_mZ(RCA,CX));
double **X_S = mul_mZ(B,X_B, i_mZ(RCA,CX));
double **T   =               i_mZ(RCA,CX) ;

double **invB  =  inv_mZ(B, i_mZ(RCA,RCA));
double **invBA =            i_mZ(RCA,RCA) ;

double **DX_B  =            i_mZ(RCA,CX) ;

/* D = invB*A*B        */
  mul_mZ(invB,A,invBA);       
  mul_mZ(invBA,B,D);
/* [T(x)]_B = D*x_B    */ 
  mul_mZ(D,X_B,DX_B);   
  
  clrscrn();
  printf(" In the Standard basis the linear application is :\n\n");
  printf(" T(x_S) = A x_S");
  p_mZ(mul_mZ(A,X_S,T), S10,P2, S8,P2, C4); 
  printf("with\n\n"
         "x_S");
  p_mZ(X_S, S10,P2, S8,P2, C4);   
  printf("A");
  p_mZ(A, S10,P2, S8,P2, C4);   

  stop();
  
  clrscrn();
  printf(" In the B basis the linear application is :\n\n"
         " [T(x_B)]_B = D*x_B           with  D = (invB A B)");
  p_mZ(DX_B, S10,P2, S8,P2, C4); 
  printf("with\n\n"
         "x_B");
  p_mZ(X_B, S10,P2, S8,P2, C4);   
  printf("D = (invB A B)");
  p_mZ(D, S10,P2, S8,P2, C4);      
 
  stop();
    
  clrscrn(); 
  printf(" [T(x_B)]_B = D*x_B           with  D = (invB A B)");
  p_mZ(DX_B, S10,P2, S8,P2, C4);  
        
  printf(" Remark : x_S = B x_B\n\n"
         "   [D*x_B]\n"
         " B [D*x_B] = B [(InvB A B) x_B] = (A B)*x_B = A (B x_B) = A x_S \n\n"
         " B*[D*x_B] = A x_S");
  p_mZ(mul_mZ(B,DX_B,T), S10,P2, S8,P2, C4);   
  
  printf(" T(x_S) = A x_S");
  p_mZ(mul_mZ(A,X_S,T), S10,P2, S8,P2, C4); 
  stop();
  
  f_mZ(A);
  f_mZ(B);
  f_mZ(D);  
  
  f_mZ(X_B);
  f_mZ(X_S);
  f_mZ(T);  
  
  f_mZ(invB);  
  f_mZ(invBA);  

  f_mZ(DX_B);
    
  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
   Vérifions si les résultats sont compatibles
Exemple de sortie écran :
 In the Standard basis the linear application is :

 T(x_S) = A x_S
    -66.00  -92.00i 
   -179.00 +109.00i 
   -327.00  +99.00i 

with

x_S
     +5.00  +41.00i 
    -10.00  +30.00i 
     +2.00  +46.00i 

A
     +3.00   +1.00i      -4.00   +1.00i      -2.00   +1.00i 
     +5.00   +2.00i      -3.00   +2.00i      +0.00   +2.00i 
     +6.00   +3.00i      +0.00   +3.00i      -3.00   +3.00i 

 Press return to continue. 


 In the B basis the linear application is :

 [T(x_B)]_B = D*x_B           with  D = (invB A B)
    -35.06  +88.21i 
    +15.37  -29.92i 
    -11.59  -17.32i 

with

x_B
     +1.00   +1.00i 
     +2.00   +2.00i 
     +3.00   +3.00i 

D = (invB A B)
     -0.35  +10.10i      +3.36  +13.60i      +6.74   +8.11i 
     +1.03   -1.38i      -0.87   -3.77i      -2.19   -4.57i 
     -3.30   -1.70i      -2.91   -0.10i      -1.78   -0.33i 

 Press return to continue. 


 [T(x_B)]_B = D*x_B           with  D = (invB A B)
    -35.06  +88.21i 
    +15.37  -29.92i 
    -11.59  -17.32i 

 Remark : x_S = B x_B

   [D*x_B]
 B [D*x_B] = B [(InvB A B) x_B] = (A B)*x_B = A (B x_B) = A x_S 

 B*[D*x_B] = A x_S
    -66.00  -92.00i 
   -179.00 +109.00i 
   -327.00  +99.00i 

 T(x_S) = A x_S
    -66.00  -92.00i 
   -179.00 +109.00i 
   -327.00  +99.00i 

 Press return to continue.