Aller au contenu

Mathc initiation/Fichiers c : c28ce

Un livre de Wikilivres.


Sommaire


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

c16e.c
/* --------------------------------- */
/* save as c16e.c                    */
/* --------------------------------- */
#include "x_hfile.h"
#include       "fe.h"
/* --------------------------------- */
int main(void)
{
double   h = .01;
pt2d     p = i_pt2d(2,0);	
v2d      u = grad_fxy(f,h,p);
v2d      v = normalize2d(u);

  clrscrn();
  printf("  f   : x,y-> %s\n\n\n",feq);

  printf(" Find a unit vector in the direction        \n" );
  printf(" in which f increases most rapidly at p(%+.1f,%+.1f)\n\n\n",p.x,p.y);

  printf("  grad f(x,y)]p = %+.3fi  %+.3fj  \n\n\n",u.i,u.j);    

  printf("  v = u / ||u|| = %+.3fi  %+.3fj  \n\n",v.i,v.j);
  printf("  which is a unit vector in the direction in which f \n");
  printf("  increases most rapidly at p(%+.1f,%+.1f)\n\n\n",p.x,p.y);

  printf("  and the rate of change in that direction is ||grad f(x,y)]p||\n\n");
  printf("  ||u|| = %+.3f \n\n\n",norm2d(u));

  stop();

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


Dérivée directionnelle (Directional derivative)

En analyse mathématique, la notion de dérivée directionnelle permet de quantifier la variation locale d'une fonction dépendant de plusieurs variables, en un point donné et le long d'une direction donnée dans l'espace de ces variables.


Exemple de sortie écran :

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


 Find a unit vector in the direction        
 in which f increases most rapidly at p(+2.0,+0.0)


  grad f(x,y)]p = +4.000i  -8.001j  


  v = u / ||u|| = +0.447i  -0.894j  

  which is a unit vector in the direction in which f 
  increases most rapidly at p(+2.0,+0.0)


  and the rate of change in that direction is ||grad f(x,y)]p||

  ||u|| = +8.945 


 Press return to continue.