Mathc initiation/Fichiers c : c26ca


Sommaire


Installer et compiler ces fichiers dans votre répertoire de travail.

c16a.c
/* --------------------------------- */
/* save as c16a.c                    */
/* --------------------------------- */
#include "x_hfile.h"
#include      "fa.h"
/* --------------------------------- */
int main(void)
{
double   h = .001;
pt3d  p = i_pt3d(0.5,0.2,0.3);

 clrscrn();
 
 printf(" f   : x,y-> %s\n\n",   feq  );
 printf(" f_x : x,y-> %s\n\n\n",Dfeq_x);
 
 printf("  f_x(%0.2f,%0.2f,%0.2f) = %0.9f"
        " with the equation\n\n",
           p.x,p.y,p.z,   f_x(p.x,p.y,p.z));
 printf("  f_x(%0.2f,%0.2f,%0.2f) = %0.9f"
        " with the formula \n\n",
           p.x,p.y,p.z, fxyz_x(f,h,p));
 stop();

 clrscrn();
 
 printf(" f   : x,y-> %s\n\n",   feq  );
 printf(" f_y : x,y-> %s\n\n\n",Dfeq_y);
 
 printf("  f_y(%0.2f,%0.2f,%0.2f) = %0.9f"
        " with the equation\n\n",
           p.x,p.y,p.z,   f_y(p.x,p.y,p.z));
 printf("  f_y(%0.2f,%0.2f,%0.2f) = %0.9f"
        " with the formula \n\n",
           p.x,p.y,p.z, fxyz_y(f,h,p));
 stop();

 clrscrn();
 
 printf(" f   : x,y-> %s\n\n",   feq  );
 printf(" f_z : x,y-> %s\n\n\n",Dfeq_z);
 
 printf("  f_z(%0.2f,%0.2f,%0.2f) = %0.9f"
        " with the equation\n\n",
           p.x,p.y,p.z,   f_z(p.x,p.y,p.z));
 printf("  f_z(%0.2f,%0.2f,%0.2f) = %0.9f"
        " with the formula \n\n",
           p.x,p.y,p.z, fxyz_z(f,h,p));

 stop();

 return 0;
}
/* --------------------------------- */


Essayez avec h = .1, h = .01, h = .001, h = .0001, h = .00001 pour observer l'augmentation de la précision des calculs.


Exemple de sortie écran :

 f   : x,y-> y*sin(x*y*z)*z

 f_x : x,y-> y**2*z**2*cos(x*y*z)


  f_x(0.50,0.20,0.30) = 0.003598380 with the equation

  f_x(0.50,0.20,0.30) = 0.003598380 with the formula 

 Press return to continue.

Exemple de sortie écran :

 f   : x,y-> y*sin(x*y*z)*z

 f_y : x,y-> x*y*z*z*cos(x*y*z)+z*sin(x*y*z)


  f_y(0.50,0.20,0.30) = 0.017994600 with the equation

  f_y(0.50,0.20,0.30) = 0.017994600 with the formula 

 Press return to continue.


Exemple de sortie écran :

 f   : x,y-> y*sin(x*y*z)*z

 f_z : x,y-> x*y**2*z*cos(x*y*z)+y*sin(x*y*z)


  f_z(0.50,0.20,0.30) = 0.011996400 with the equation

  f_z(0.50,0.20,0.30) = 0.011996400 with the formula 

 Press return to continue.