Mathc initiation/Fichiers c : c28ch


Sommaire


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

Crystal Clear mimetype source c.png c16h.c
'
/* --------------------------------- */
/* save as c16h.c                    */
/* --------------------------------- */
#include "x_hfile.h"
#include       "ff.h"
/* --------------------------------- */
int main(void)
{
double   h = .01;
pt3d  p = i_pt3d(-2,3,1);

v3d     u = grad_fxyz(f,h,p);
v3d mns_u = mns_u3d(u);
v3d     v = normalize3d(mns_u);

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

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

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

  printf("  and the rate of change in that direction is -||grad f(x,y,z)]p||\n\n");
  printf("  -||u|| = %+.3f \n\n\n",-norm3d(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,z-> sqrt(x*x + y*y + z*z)


 Find a unit vector in the direction        
 in which f decreases most rapidly at p(-2.0,+3.0,+1.0)


  -grad f(x,y,z)]p = +0.535i -0.802j -0.267j 


  v = u / ||u|| = +0.535i -0.802j -0.267k  

  which is a unit vector in the direction in which f 
  decreases most rapidly at p(-2.0,+3.0,+1.0)


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

  -||u|| = -1.000 


 Press return to continue.