Mathc matrices/a123

Un livre de Wikilivres.


Application


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


c02c.c
/* ------------------------------------ */
/*  Save as :   c02c.c                  */
/* ------------------------------------ */
#include      "v_a.h"
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));
  
double ta[R3*C4]={ 1,0,0,  16,
                   0,1,0,  27,
                   0,0,1,  25};
                   
double **T  =    ca_A_mR(ta,i_mR(R3,C4));
double **A  =          r_mR(i_mR(R3,C3),9);  
double **AT =    mul_mR(A,T,i_mR(R3,C4));  
double **Ab = gj_TP_mR(c_mR(AT,i_Abr_Ac_bc_mR(R3,C3,C1)));  

  printf(" You want to create this nonlinear system of equations :\n");
  printf("\n");
  printf(" a X**4 + b Y**3 + c Z**2 = d \n");
  printf(" e X**4 + f Y**3 + g Z**2 = h \n");
  printf(" i X**4 + j Y**3 + k Z**2 = l \n");
  printf("\n");
  printf(" With        X = 2,     Y =  3,    Z = 5 \n");
  printf(" You have X**4 = 16, Y**3 = 27, Z**2 = 25 \n");
  printf("\n");
  printf(" In  fact, you  want to  find a matrix, \n");
  printf(" which has this reduced row-echelon form :\n\n"   
          "Ab:");
   
  p_mR(T,S7,P3,C6);
  stop();  

  clrscrn();  
  printf(" If :\n\n A = r_mR(i_mR(R3,C3),9); ");
  p_mR(A,S7,P3,C6);  
  
  printf(" And :\n\n T :");
  p_mR(T,S7,P3,C6); 

  printf(" I suggest this matrix : A*T = Ab\n\n"  
  " Ab : ");
  P_mR(AT,S8,P3,C6);
  stop();  

  clrscrn();    
  printf("\n  With the Gauss Jordan function :\n"
  "Ab:");
  p_mR(Ab,S7,P3,C6);
  stop();


  f_mR(Ab);
  f_mR(A);
  f_mR(T);
  f_mR(AT);

  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


Le but de ce travail est de créer des systèmes dont on connait le résultat par avance.


Exemple de sortie écran :
 ------------------------
 You want to create this nonlinear system of equations :

 a X**4 + b Y**3 + c Z**2 = d 
 e X**4 + f Y**3 + g Z**2 = h 
 i X**4 + j Y**3 + k Z**2 = l 

 With        X = 2,     Y =  3,    Z = 5 
 You have X**4 = 16, Y**3 = 27, Z**2 = 25 

 In  fact, you  want to  find a matrix, 
 which has this reduced row-echelon form :

Ab:
 +1.000  +0.000  +0.000 +16.000 
 +0.000  +1.000  +0.000 +27.000 
 +0.000  +0.000  +1.000 +25.000 

 Press return to continue. 


 ------------------------
 If :

 A = r_mR(i_mR(R3,C3),9); 
 +6.000  +2.000  +4.000 
 -4.000  -4.000  -8.000 
 -2.000  -5.000  -9.000 

 And :

 T :
 +1.000  +0.000  +0.000 +16.000 
 +0.000  +1.000  +0.000 +27.000 
 +0.000  +0.000  +1.000 +25.000 

 I suggest this matrix : A*T = Ab

 Ab : 
  +6.000,   +2.000,   +4.000, +250.000, 
  -4.000,   -4.000,   -8.000, -372.000, 
  -2.000,   -5.000,   -9.000, -392.000  

 Press return to continue. 


 ------------------------
  With the Gauss Jordan function :
Ab:
 +1.000  +0.000  +0.000 +16.000 
 +0.000  +1.000  +0.000 +27.000 
 +0.000  +0.000  +1.000 +25.000 

 Press return to continue.