Aller au contenu

Mathc complexes/a83

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"
/* ------------------------------------ */
void fun(int r)
{
double **Ab = r_singular_Ab_mZ(i_Abr_Ac_bc_mZ(r,r,C1),999);
double **A  = c_Ab_A_mZ(Ab,i_mZ(r,r));
double **b  = c_Ab_b_mZ(Ab,i_mZ(r,C1));	
	
  clrscrn();
  printf(" A :");
  p_mZ(A, S5,P0, S4,P0, C6);
  printf(" b :");
  p_mZ(b, S5,P0, S4,P0, C6);
  stop();

  clrscrn();
  printf(" Copy/Past into the octave window.\n\n");
  p_Octave_mZ(Ab,"Ab",P0, P0);
  printf(" rref(Ab,.00000000001)\n\n");
  printf(" gj4_mZ(Ab) :");
  gj4_mZ(Ab);
  p_mZ(Ab,S9,P4,S9,P4,C4);

  f_mZ(Ab);
  f_mZ(b);
  f_mZ(A);
}
/* ------------------------------------ */
int main(void)
{
time_t t;

  srand(time(&t));

do
{
  fun(rp_I(R3)+R2);

} while(stop_w());

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


Matrices singulières. : Le système ici à deux lignes identiques. Il pourrait être inconsistant.  
//Il faut initialiser la matrice Ab avec la fonction :

i_Abr_Ac_bc_mZ(Abr,Ac,bc);

//Pour avoir la bonne taille pour les matrices A et b.

// Par exemple :

double **Ab = r_singular_Ab_mZ(i_Abr_Ac_bc_mZ(r,r,C1),999);

Exemple de sortie écran :

 -------------------------------
 A :
  +39-494i  -732+699i  +304-811i  -278+717i  +666+725i 
  +39-494i  -732+699i  +304-811i  -278+717i  +666+725i 
 -869+614i  +437+502i  -846+691i  +434+806i  -707+587i 
 -869+614i  +437+502i  -846+691i  +434+806i  -707+587i 
 -860-404i  -176+719i  +464+413i   +51-999i  +722+789i 

 b :
 +873 +13i 
 +873 +13i 
 -162-906i 
 -162-906i 
 -102  -1i 

 Press return to continue. 


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

 Ab=[
+39-494*i,-732+699*i,+304-811*i,-278+717*i,+666+725*i,+873+13*i;
+39-494*i,-732+699*i,+304-811*i,-278+717*i,+666+725*i,+873+13*i;
-869+614*i,+437+502*i,-846+691*i,+434+806*i,-707+587*i,-162-906*i;
-869+614*i,+437+502*i,-846+691*i,+434+806*i,-707+587*i,-162-906*i;
-860-404*i,-176+719*i,+464+413*i,+51-999*i,+722+789*i,-102-1*i]

 rref(Ab,.00000000001)

 gj4_mZ(Ab) :
  +1.0000  -0.0000i   -0.0000  -0.0000i   +0.0000  +0.0000i   +1.4124  +0.5569i 
  +0.0000  -0.0000i   +1.0000  +0.0000i   +0.0000  -0.0000i   +0.6810  -1.2564i 
  +0.0000  +0.0000i   +0.0000  +0.0000i   +1.0000  +0.0000i   -0.3974  -1.0692i 
  +0.0000  +0.0000i   +0.0000  +0.0000i   +0.0000  +0.0000i   +0.0000  +0.0000i 
  +0.0000  +0.0000i   +0.0000  +0.0000i   +0.0000  +0.0000i   +0.0000  +0.0000i 

  +0.7164  +0.6018i   -0.1569  -0.2801i 
  +1.2743  -1.2657i   -0.7103  -0.1268i 
  +0.9812  +0.1116i   -0.2128  +0.5840i 
  +0.0000  +0.0000i   +0.0000  +0.0000i 
  +0.0000  +0.0000i   +0.0000  +0.0000i 


 Press return to continue
 Press X      to stop