Mathc initiation/Fichiers c : c50c1b


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


Installer ce fichier dans votre répertoire de travail.

x_cylzrk.h
/* --------------------------------- */
/* save as x_cylzrk.h                */
/* --------------------------------- */
double cylindrical_z_dzdxdy(
double (*P_f)(double x, double y, double z),

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

double x,

double y
)
{
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_x_dzdxdy(
double (*P_f)(double x, double y, double z),
   
double (*Puz)(double x, double y),
double (*Pvz)(double x, double y),
   int   nz,

double (*Psx)(double y),
double (*Ptx)(double y),
   int   nx,

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 if(fmod(i,2) == 0){m = 2.;}
  else                   {m = 4.;}

  M += m * cylindrical_z_dzdxdy(      (*P_f),
                           
                             (*Puz),
                             (*Pvz),
                                nz,
                                
                           (((*Psx)(y))+i*(((*Ptx)(y))-((*Psx)(y)))/nx),
                           
                                y);
 }

 return( ((((*Ptx)(y)) -((*Psx)(y)))*M) / (3*nx) );
}
/* --------------------------------- */
double cylindrical_dzdrdk(
double (*P_f)(double x, double y, double z),
   
double (*Puz)(double x, double y),
double (*Pvz)(double x, double y),
   int   nz,
   
double (*Psx)(double y),
double (*Ptx)(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 * cylindrical_x_dzdxdy( (*P_f),
                               
                                 (*Puz),
                                 (*Pvz),
                                    nz,
                             
                                 (*Psx),
                                 (*Ptx),
                                nx,
  
                             (ay+i*(by-ay)/ny));
 }

  return( ((by -ay)*M) / (3*ny) );
}
/* --------------------------------- */
/* --------------------------------- */


Déclaration des fichiers h.