Mathc initiation/a460
Apparence
Installer ce fichier dans votre répertoire de travail.
x_jdudv.h |
---|
/* ---------------------------------- */
/* save as x_jdudv.h */
/* ---------------------------------- */
double J_du(
double (*P_f)(double x, double y),
double (*P_u)(double s, double t),
double (*P_v)(double s, double t),
double (*P_ax)(double y),
double (*P_bx)(double y),
int nx,
double y
)
{
double x = 0;
int i = 0;
double m = 0.;
double M = 0.;
pt2d p;
for(i = 0; i <= nx; i++)
{
if(i ==0 || i== nx){m = 1.;}
else if(fmod(i,2) == 0 ){m = 2.;}
else {m = 4.;}
x = ((*P_ax)(y)) + i*(((*P_bx)(y))-((*P_ax)(y)))/nx;
p.x = x;
p.y = y;
M += m * (*P_f)((*P_u)(x,y), (*P_v)(x,y))
*
fabs(fxy_x((*P_u),H,p) * fxy_y((*P_v),H,p)
-
fxy_x((*P_v),H,p) * fxy_y((*P_u),H,p));
}
return( ((((*P_bx)(y)) -((*P_ax)(y)))*M) / (3*nx) );
}
/* ---------------------------------- */
double J_dudv(
double (*P_f)(double x, double y),
double (*P_u)(double s, double t),
double (*P_v)(double s, double t),
double (*P_ax)(double y),
double (*P_bx)(double y),
int nx,
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 if(fmod(i,2) == 0 ){m = 2.;}
else {m = 4.;}
M += m * J_du((*P_f),
(*P_u),(*P_v),
(*P_ax),(*P_bx),nx,
(ay+i*(by-ay)/ny));
}
return( ((by-ay)*M) / (3*ny) );
}
/* ---------------------------------- */
/* ---------------------------------- */
----