Mathc initiation/a461
Apparence
Installer ce fichier dans votre répertoire de travail.
x_jdvdu.h |
---|
/* ---------------------------------- */
/* save as x_jdvdu.h */
/* ---------------------------------- */
double J_dv(
double (*P_f)(double x, double y),
double (*P_u)(double s, double t),
double (*P_v)(double s, double t),
double (*P_ay)(double x),
double (*P_by)(double x),
int ny,
double x
)
{
double y = 0;
int i = 0;
double m = 0.;
double M = 0.;
pt2d p;
for(i = 0; i <= ny; i++)
{
if(i ==0 || i== ny){m = 1.;}
else if(fmod(i,2) == 0) {m = 2.;}
else {m = 4.;}
y = ((*P_ay)(x)) + i*(((*P_by)(x))-((*P_ay)(x)))/ny;
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_by)(x)) -((*P_ay)(x)))*M) / (3*ny) );
}
/* ---------------------------------- */
double J_dvdu(
double (*P_f)(double x, double y),
double (*P_u)(double s, double t),
double (*P_v)(double s, double t),
double (*P_ay)(double x),
double (*P_by)(double x),
int ny,
double ax,
double bx,
int nx
)
{
double x = 0;
int i = 0;
double m = 0.;
double M = 0.;
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 = (ax + i*(bx-ax)/nx);
M += m * J_dv((*P_f),
(*P_u), (*P_v),
(*P_ay),(*P_by),ny, x);
}
return( ((bx -ax)*M) / (3*nx) );
}
/* ---------------------------------- */
/* ---------------------------------- */
----