Mathc initiation/c35a4
Apparence
Installer ce fichier dans votre répertoire de travail.
x_xzy.h |
---|
/* ---------------------------------- */
/* save as x_xzy.h */
/* --------------------------------- */
double intx_dxdzdy(
double (*P_f)(double x, double y, double z),
double (*Pux)(double y, double z),
double (*Pvx)(double y, double z),
int nx,
double z,
double y
)
{
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 * (*P_f)( (((*Pux)( y,z)) + i*(((*Pvx)( y,z))-((*Pux)( y,z)))/nx), y, z);
}
return( ((((*Pvx)( y,z)) -((*Pux)( y,z)))*M) / (2*nx) );
}
/* --------------------------------- */
double intz_dxdzdy(
double (*P_f)(double x, double y, double z),
double (*Pux)(double y, double z),
double (*Pvx)(double y, double z),
int nx,
double (*Psz)(double x),
double (*Ptz)(double x),
int nz,
double y
)
{
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 * intx_dxdzdy( (*P_f),
(*Pux),
(*Pvx),
nx,
(((*Psz)(y))+i*(((*Ptz)(y))-((*Psz)(y)))/nz),
y);
}
return( ((((*Ptz)(y)) -((*Psz)(y)))*M) / (2*nz) );
}
/* --------------------------------- */
double trapezoid_dxdzdy(
double (*P_f)(double x, double y, double z),
double (*Pux)(double y, double z),
double (*Pvx)(double y, double z),
int nx,
double (*Psz)(double x),
double (*Ptz)(double x),
int nz,
double ay,
double by,
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 * intz_dxdzdy( (*P_f),
(*Pux),
(*Pvx),
nx,
(*Psz),
(*Ptz),
nz,
(ay+i*(by-ay)/ny));
}
return( ((by -ay)*M) / (2*ny) );
}
/* --------------------------------- */
Les fonctions pour calculer les intégrales de la forme dxdzdy