Aller au contenu

Mathc initiation/Fichiers h : c71a3

Un livre de Wikilivres.


Sommaire


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

c01a.c
/* --------------------------------- */
/* save as c01a.c                    */
/* --------------------------------- */
#include "x_hfile.h"
#include      "fa.h"
/* --------------------------------- */
int main(void)
{
CTRL_splot p;

p.xmin  = -6,     p.xmax    =   4;
p.ymin  = -4,     p.ymax    =   6;
p.zmin  = -6,     p.zmax    =   6;
p.rot_x = 90,     p.rot_z   =  39;
p.scale =  1,     p.scale_z =   1;

pt2d     Q = i_pt2d(-2,1);

 clrscrn();
 
 printf(" Let f be a function of two variables        \n\n");
 printf(" that has continuous second partial derivatives\n");
 printf(" throughout an open disk R containing (a,b). \n\n");
 printf(" If  f_x(a,b) = f_y(a,b) = 0 and             \n\n");
 printf(" Hessian(a,b) > 0,                           \n\n");
 printf(" then f(a,b) is                            \n\n\n");
 printf("   (I)  a local maximum of f if f_xx(a,b) < 0\n\n");
 printf("   (II) a local minimum of f if f_xx(a,b) > 0\n\n\n\n");
 
 stop();

 clrscrn();
 
 printf(" Verify if f_x(a,b) = f_y(a,b) = 0.\n\n\n");
 printf(" f   : x,y-> %s\n\n\n",   feq  );
 printf(" f_x(%0.2f,%0.2f) = %0.9f    \n\n",Q.x,Q.y, fxy_x(f,H,Q));
 printf(" f_y(%0.2f,%0.2f) = %0.9f  \n\n\n",Q.x,Q.y, fxy_y(f,H,Q));
 
 stop();

 clrscrn();
 
 printf(" Verify if Hessian(a,b) > 0\n\n\n");
 printf(" f   : x,y-> %s\n\n\n",   feq  );
 printf(" Hessian(%0.2f,%0.2f) = %0.9f    \n\n",Q.x,Q.y, Hessian(f,f_xy,Q) );
 
 stop();

 clrscrn();
 
 printf(" if f_xx(a,b) < 0 then it is  a local maximum.\n\n");
 printf(" if f_xx(a,b) > 0 then it is  a local minimum\n\n\n\n");
 printf(" f   : x,y-> %s\n\n\n",   feq  );
 printf(" f_xx(%0.2f,%0.2f) = %0.9f\n\n\n\n",Q.x,Q.y, fxy_xx(f,H,Q));
 printf("   You can use f_yy instead of f_xx.\n\n");
 printf(" f_yy(%0.2f,%0.2f) = %0.9f    \n\n",Q.x,Q.y, fxy_yy(f,H,Q));
 
 stop();

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

     G_3d_p(    p,
                feq,f,
                Q);

 printf(" ... load \"a_main.plt\" ... with gnuplot.  \n\n");
 
 stop();
 
 return 0;
}
/* --------------------------------- */
/* --------------------------------- */


Exemple de sortie écran :

 Let f be a function of two variables        

 that has continuous second partial derivatives
 throughout an open disk R containing (a,b). 

 If  f_x(a,b) = f_y(a,b) = 0 and             

 Hessian(a,b) > 0,                            

 then f(a,b) is                            


   (I)  a local maximum of f if f_xx(a,b) < 0

   (II) a local minimum of f if f_xx(a,b) > 0



 Press return to continue.


Exemple de sortie écran :

 Verify if f_x(a,b) = f_y(a,b) = 0.


 f   : x,y-> -x**2 - 4*x - y**2 + 2*y - 1


 f_x(-2.00,1.00) = 0.000000000    

 f_y(-2.00,1.00) = 0.000000000  


 Press return to continue.



Exemple de sortie écran :

 Verify if Hessian(a,b) > 0


 f   : x,y-> -x**2 - 4*x - y**2 + 2*y - 1


 Hessian(-2.00,1.00) = 3.999999951    

 Press return to continue.


Exemple de sortie écran :

 if f_xx(a,b) < 0 then it is  a local maximum.

 if f_xx(a,b) > 0 then it is  a local minimum



 f   : x,y-> -x**2 - 4*x - y**2 + 2*y - 1


 f_xx(-2.00,1.00) = -1.999999988



   You can use f_yy instead of f_xx.

 f_yy(-2.00,1.00) = -1.999999988    

 Press return to continue.


Exemple de sortie écran :

 f : (x,y)-> -x**2 - 4*x - y**2 + 2*y - 1


 Open the file ... load "a_main.plt" ... with gnuplot.

 Press return to continue.