Aller au contenu

Mathc initiation/Fichiers c : c25cf

Un livre de Wikilivres.


Sommaire


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

c16f.c
/* --------------------------------- */
/* save as c16f.c                    */
/* --------------------------------- */
#include "x_hfile.h"
#include      "fc.h"
/* --------------------------------- */
int main(void)
{
double   h = .0001;
pt2d  p = i_pt2d(0.5,0.2);

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

 clrscrn();
 printf(" f    : x,y-> %s\n\n",   feq   );
 printf(" f_yy : x,y-> %s\n\n\n",Dfeq_yy);
 printf("  f_yy(%0.2f,%0.2f) = %0.9f with the equation\n\n",
           p.x,p.y,   f_yy(       p.x,p.y  ));
 printf("  f_yy(%0.2f,%0.2f) = %0.9f with the formula \n\n",
           p.x,p.y, fxy_yy(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-> exp(2*x+3*y)

 f_xx : x,y-> 4*exp(2*x+3*y)


  f_xx(0.50,0.20) = 19.812129698 with the equation

  f_xx(0.50,0.20) = 19.812129803 with the formula 

 Press return to continue.

Exemple de sortie écran :

 f    : x,y-> exp(2*x+3*y)

 f_yy : x,y-> 9*exp(2*x+3*y)


  f_yy(0.50,0.20) = 44.577291820 with the equation

  f_yy(0.50,0.20) = 44.577292257 with the formula 

 Press return to continue.