Mathc initiation/Fichiers c : c65ca


Sommaire


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


c18a.c
/* ---------------------------------- */
/* save as c18a.c                     */
/* ---------------------------------- */
#include "x_hfile.h"
#include      "fa.h"
/* ---------------------------------- */
int main(void)
{
double   x1 =  0.;
double   y1 =  1.;

double   x2 =  2.;
double   y2 =  3.;

double   m  = 0;

 clrscrn();
 printf(" Let  F(x,y) = M(x,y) i + N(x,y) j \n\n\n");
 printf(" Be continuous on an open connected region D,\n");
 printf(" And let C be a piecewise-smooth curve  in D\n");
 printf(" With endpoints A(x1,y1) and B(x2,y2).\n\n\n");
 printf(" If F(x,y) = grad f(x,y) then \n\n\n");
 printf("    (               (                   (x2,y2)\n");
 printf(" int( M(x,y)dx + int( N(x,y)dy = [f(x,y)]\n");
 printf("    (c              (c                  (x1,y1)\n");
 printf(" \n");
 stop();


 clrscrn();
 printf(" Let  F(x,y) = %si + %sj       \n\n",Meq,Neq);
 printf(" and has  C parametrization :\n\n");
 printf(" x = %s;     y = %s;       %.1f < t =< %.1f \n\n\n",
          geq, heq, a, b);
 printf(" Let  f(x,y) = %s              \n\n\n",feq);
 printf(" Verify if F(x,y) = grad f(x,y)\n\n\n");
        
 m   =lint2d_dx(
              M,
              g,h,
              a,b,LOOP);

 m  +=lint2d_dy(
              N,
              g,h,
              a,b,LOOP);
                
 printf("  then \n\n");
 printf("    (               (                  \n");
 printf(" int( M(x,y)dx + int( N(x,y)dy =  %+.3f\n",  m);
 printf("    (c              (c             \n\n\n");
 
 printf("  f(x2,y2) - f(x1,y1)  = %+.3f\n\n", f(x2,y2) - f(x1,y1));
 stop();

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


Nous devons commencer par vérifier manuellement que F(x,y) = grad f(x,y). Ensuite nous vérifions que le calcul de l'intégrale de F(x,y) est bien égal à f(x2,y2) - f(x1,y1).


Exemple de sortie écran :
 Let  F(x,y) = M(x,y) i + N(x,y) j 


 Be continuous on an open connected region D,
 And let C be a piecewise-smooth curve  in D
 With endpoints A(x1,y1) and B(x2,y2).


 If F(x,y) = grad f(x,y) then 


    (               (                   (x2,y2)
 int( M(x,y)dx + int( N(x,y)dy = [f(x,y)]
    (c              (c                  (x1,y1)
 
 Press return to continue.


Exemple de sortie écran :
 Let  F(x,y) = (2*x + y**3)i + (3*x*y**2 + 4)j       

 and has  C parametrization :

 x = t;     y = t+1;       0.0 < t =< 2.0 


 Let  f(x,y) = x**2 + x*y**3 + 4*y              


 Verify if F(x,y) = grad f(x,y)


  then 

    (               (                  
 int( M(x,y)dx + int( N(x,y)dy =  +66.000
    (c              (c             


  f(x2,y2) - f(x1,y1)  = +66.000

 Press return to continue.