Mathc matrices/a41
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c00.c |
---|
/* ------------------------------------ */
/* Save as : c00.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
/* ------------------------------------ */
#define RA R3
#define CA C3
#define Cb C2
/* ------------------------------------ */
/* ------------------------------------ */
#define B (1.)
//#define B (1./5.)
/* ------------------------------------ */
/* ------------------------------------ */
int main(void)
{
/*
* Find a value for "B" so that the system is compatible.
*/
double ab[RA*(CA+Cb)]={
// A = x*B + y
-2, +8, -5, -4*B, +1,
-6, -9, +6, -4*B, +0,
-2, +8, -5, -9*B, +2
};
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,S3,P0,C7);
printf(" b :");
p_mR(b,S3,P0,C7);
printf(" Ab :");
p_mR(Ab,S3,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_PP_mR(Ab,YES) :");
gj_PP_mR(Ab,YES);
p_mR(Ab,S8,P4,C7);
stop();
f_mR(Ab);
f_mR(b);
f_mR(A);
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Calculer la valeur de B pour que le système soit compatible. Exemple de sortie écran :
------------------------------------
A :
-2 +8 -5
-6 -9 +6
-2 +8 -5
b :
-4 +1
-4 +0
-9 +2
Ab :
-2 +8 -5 -4 +1
-6 -9 +6 -4 +0
-2 +8 -5 -9 +2
------------------------------------
Copy/Past into the octave window.
Ab=[
-2,+8,-5,-4,+1;
-6,-9,+6,-4,+0;
-2,+8,-5,-9,+2]
rref(Ab,.00000000001)
gj_PP_mR(Ab,YES) :
+1.0000 +0.0000 -0.0455 +1.0303 -0.1364
+0.0000 +1.0000 -0.6364 -0.2424 +0.0909
+0.0000 +0.0000 +0.0000 -5.0000 +1.0000
Press return to continue.
La dernière ligne donne :
+0.0000 +0.0000 +0.0000 -5.0000 +1.0000 ou bien +0.0000 = -5.0000 +1.0000 en introduisant B +0.0000 = -5.0000 B +1.0000 soit le système -5.0000 B = -1.0000 cela donne B 1./5.