Mathc initiation/c35a6


Sommaire


Installer ce fichier dans votre répertoire de travail.

Crystal Clear mimetype source h.png x_yzx.h
'
/* ---------------------------------- */
/* save as x_yzx.h                   */
/* --------------------------------- */
double inty_dydzdx(
double (*P_f)(double x, double y, double z),
double x,
double z,

double (*Puy)(double x, double z),
double (*Pvy)(double x, double z),
   int    ny
)
{
   int i = 0;
double m = 0.;
double M = 0.;

 for(i = 0; i <= ny; i++)
 {
    if(i ==0 || i== ny){m = 1.;}
  else                {m = 2.;}

  M += m * (*P_f)( x, (((*Puy)( x,z)) + i*(((*Pvy)( x,z))-((*Puy)( x,z)))/ny), z);
 }

  return( ((((*Pvy)( x,z)) -((*Puy)( x,z)))*M) / (2*ny) );
}
/* --------------------------------- */
double intz_dydzdx(
double (*P_f)(double x, double y, double z),
double x,

double (*Psz)(double x),
double (*Ptz)(double x),
   int    nz,
   
double (*Puy)(double x, double z),
double (*Pvy)(double x, double z),
   int    ny
)
{
   int i = 0;
double m = 0.;
double M = 0.;

 for(i = 0; i <= nz; i++)
 {
    if(i ==0 || i== nz){m = 1.;}
  else                {m = 2.;}

M += m * inty_dydzdx(      (*P_f),
                                  x,
                           (((*Psz)(x))+i*(((*Ptz)(x))-((*Psz)(x)))/nz),
                           
                             (*Puy),
                             (*Pvy),
                               ny);
 }

  return( ((((*Ptz)(x)) -((*Psz)(x)))*M) / (2*nz) );
}
/* --------------------------------- */
double trapezoid_dydzdx(
double (*P_f)(double x, double y, double z),

double ax,
double bx,
   int nx,
   
double (*Psz)(double x),
double (*Ptz)(double x),
   int    nz,
   
double (*Puy)(double x, double z),
double (*Pvy)(double x, double z),
   int    ny
)
{
   int i = 0;
double m = 0.;
double M = 0.;

 for(i = 0; i <= nx; i++)
 {
    if(i ==0 || i== nx){m = 1.;}
  else                {m = 2.;}

M += m *         intz_dydzdx((*P_f),
                             (ax+i*(bx-ax)/nx),
                             
                             (*Psz),
                             (*Ptz),
                               nz,
                               
                             (*Puy),
                             (*Pvy),
                               ny);
 }

  return( ((bx -ax)*M) / (2*nx) );
}
/* --------------------------------- */


Les fonctions pour calculer les intégrales de la forme dydzdx