Mathc initiation/Fichiers h : c50


SommaireUtilise la commande "Retour en Arrière" de ton navigateur.


Installer ce fichier dans votre répertoire de travail.

x_cylzkr.h
/* --------------------------------- */
/* save as x_cylzkr.h                */
/* --------------------------------- */
double cylindrical_z_dzdydx(
double (*P_f)(double x, double y, double z),

double (*Puz)(double x, double y),
double (*Pvz)(double x, double y),
   int   nz,

double y,

double x
)
{
double z = 0;

   int i = 0;
double m = 0.;
double M = 0.;

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

  z = ((*Puz)(x,y)) + i*(((*Pvz)(x,y))-((*Puz)(x,y)))/nz;
  
  M += m * (*P_f)( x, y, z) * x;
 }

  return( ((((*Pvz)(x,y)) -((*Puz)(x,y)))*M) / (3*nz) );
}
/* --------------------------------- */
double cylindrical_y_dzdydx(
double (*P_f)(double x, double y, double z),
   
double (*Puz)(double x, double y),
double (*Pvz)(double x, double y),
   int   nz,

double (*Psy)(double x),
double (*Pty)(double x),
   int   ny,
   
double x
)
{
   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 * cylindrical_z_dzdydx(     (*P_f),
                           
                             (*Puz),
                             (*Pvz),
                                nz,
                                
                           (((*Psy)(x))+i*(((*Pty)(x))-((*Psy)(x)))/ny),
                           
                                x);
 }

 return( ((((*Pty)(x)) -((*Psy)(x)))*M) / (3*ny) );
}
/* --------------------------------- */
double cylindrical_dzdkdr(
double (*P_f)(double x, double y, double z),
   
double (*Puz)(double x, double y),
double (*Pvz)(double x, double y),
   int   nz,
      
double (*Psy)(double x),
double (*Pty)(double x),
   int   ny,

double ax,
double bx,
   int nx
)
{
   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.;}

  M += m * cylindrical_y_dzdydx(     (*P_f),
                                
                             (*Puz),
                             (*Pvz),
                                nz,
                             
                             (*Psy),
                             (*Pty),
                                ny,
  
                             (ax+i*(bx-ax)/nx));
 }

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


Déclaration des fichiers h.