Aller au contenu

Mathc matrices/c32e

Un livre de Wikilivres.


Application


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


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

  srand(time(&t));
  
double ta[R3*C4]={ 1,0,0,  15,
                   0,1,0,  20,
                   0,0,1,   2};
                   
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*Y + b X*Z + c Z**(1/2) = d \n");
  printf(" e X*Y + f X*Z + g Z**(1/2) = h \n");
  printf(" i X*Y + j X*Z + k Z**(1/2) = l \n");
  printf("\n");
  printf(" With       X = 5,    Y =  3,        Z = 4 \n");
  printf(" You have X*Y = 15, X*Z = 20, Z**(1/2) = 2 \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*Y + b X*Z + c Z**(1/2) = d 
 e X*Y + f X*Z + g Z**(1/2) = h 
 i X*Y + j X*Z + k Z**(1/2) = l 

 With       X = 5,    Y =  3,        Z = 4 
 You have X*Y = 15, X*Z = 20, Z**(1/2) = 2 

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

Ab:
 +1.000  +0.000  +0.000 +15.000 
 +0.000  +1.000  +0.000 +20.000 
 +0.000  +0.000  +1.000  +2.000 

 Press return to continue. 


 If :

 A = r_mR(i_mR(R3,C3),9);   
 +2.000  -1.000  -6.000 
 +2.000  -7.000  -6.000 
 -6.000  +6.000  +7.000 

 And :

 T :
 +1.000  +0.000  +0.000 +15.000 
 +0.000  +1.000  +0.000 +20.000 
 +0.000  +0.000  +1.000  +2.000 

 I suggest this matrix : A*T = Ab

 Ab : 
  +2.000   -1.000   -6.000   -2.000 
  +2.000   -7.000   -6.000 -122.000 
  -6.000   +6.000   +7.000  +44.000 

 Press return to continue. 


 
  With the Gauss Jordan function :
Ab:
 +1.000  -0.000  -0.000 +15.000 
 +0.000  +1.000  +0.000 +20.000 
 +0.000  -0.000  +1.000  +2.000 

 Press return to continue.