Aller au contenu

Mathc matrices/a218

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"
/* ------------------------------------ */
#define   RA R4
#define   CA C4
#define   Cb C1
/* ------------------------------------ */
int main(void)
{
double ab[RA*(CA+Cb)]={
// I1    I2    I3    
   +1,   +1,   -1,   +0,    +0,
  -60,  +30,   +0,   +0,    +0,  
   +0,  +30,  +20,   +0,    +120,
  +60,   +0,  +20,   +0,    +120
};

double **Ab = ca_A_mR(ab,i_Abr_Ac_bc_mR(RA,CA,Cb));
double **A  = c_Ab_A_mR(Ab,i_mR(RA,CA));
double **b  = c_Ab_b_mR(Ab,i_mR(RA,Cb));

  clrscrn();
  printf(" A :");
  p_mR(A,S5,P0,C7);
  printf(" b :");
  p_mR(b,S5,P0,C7);
  printf(" Ab :");
  p_mR(Ab,S5,P0,C7);
  getchar();

  clrscrn();
  printf(" Copy/Past into the octave window.\n\n");
  p_Octave_mR(Ab,"Ab",P0);
  printf("\n rref(Ab,.00000000001)\n\n");
  printf("  gj_TP_mR(Ab) :\n\n"
         "   I1    I2    I3  ");
  gj_TP_mR(Ab);
  p_mR(Ab,S5,P0,C7);
  stop();

  f_mR(Ab);
  f_mR(b);
  f_mR(A);
  
  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


Exemple de sortie écran :
 ------------------------------------ 
 A :
   +1    +1    -1    +0 
  -60   +30    +0    +0 
   +0   +30   +20    +0 
  +60    +0   +20    +0 

 b :
   +0 
   +0 
 +120 
 +120 

 Ab :
   +1    +1    -1    +0    +0 
  -60   +30    +0    +0    +0 
   +0   +30   +20    +0  +120 
  +60    +0   +20    +0  +120 


 ------------------------------------
 Copy/Past into the octave window.

 Ab=[
+1,+1,-1,+0,+0;
-60,+30,+0,+0,+0;
+0,+30,+20,+0,+120;
+60,+0,+20,+0,+120]


 rref(Ab,.00000000001)

  gj_TP_mR(Ab) :

   I1    I2    I3  
   +1    +0    +0    +0    +1 
   +0    +1    +0    +0    +2 
   -0    -0    +1    -0    +3 
   +0    +0    +0    +0    +0 

 Press return to continue.