Mathc initiation/Fichiers c : c66ca


Sommaire


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


Crystal Clear mimetype source c.png c18a.c
'
/* ---------------------------------- */
/* save as c18a.c                    */
/* ---------------------------------- */
#include "x_hfile.h"
#include      "fa.h"
/* ---------------------------------- */
int main(void)
{
double   a  = 0.;
double   b  = 1.;
int      n =  2*50;

double   x1 = 1.;
double   y1 = 0.;
double   z1 = 2.;

double   x2 = -2;
double   y2 = 1.;
double   z2 = 3.;

double   m = 0;

/* ---------------------------------- */
 clrscrn();
 printf(" Let  F(x,y,z) = M(x,y,z)n + N(x,y,z)h + N(x,y,z)k\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,z1) and B(x2,y2,z2).\n\n");
 printf(" If F(x,y,z) = grad f(x,y,z) then \n\n");
 printf("    (                              ((x2,y2,z2)          (x2,y2,z2)\n");
 printf(" int( M(x,y,z)dx + N(x,y,z)dy = int(       F.dr = [f(x,y)]\n");
 printf("    (c                             ((x1,y1,z1)          (x1,y1,z1)\n");
 printf(" \n");
 stop();

/* ---------------------------------- */
 clrscrn();
 printf(" Let  F(x,y,z) = %si + %sj + %sk       \n\n",Meq,Neq,Peq);
 printf(" and has  C parametrization :\n\n");
 printf(" x = %s;     y = %s;    z = %s;    %.1f < t =< %.1f \n\n\n",
          geq, heq, keq, a, b);
 printf(" Let  f(x,y,z) = %s              \n\n",feq);
 printf(" Verify if F(x,y,z) = grad f(x,y,z)\n\n");

 m  =lineintegral_dx(
              M,
              g,h,k,
              a,b,n,
              H);

 m  +=lineintegral_dy(
              N,
              g,h,k,
              a,b,n,
              H);

 m  +=lineintegral_dz(
              P,
              g,h,k,
              a,b,n,
              H);

 printf("  then \n\n");
 printf("        (b\n");
 printf("     int(        F.dr  =  %+.3f\n",  m);
 printf("        (a\n\n\n");
 printf("  f(x2,y2,y2) - f(x1,y1,z1)  = %+.3f\n\n", f(x2,y2,z2) - f(x1,y1,z1));

 stop();

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


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


Exemple de sortie écran :
 Let  F(x,y,z) = M(x,y,z)n + N(x,y,z)h + N(x,y,z)k

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

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

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


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

 and has  C parametrization :

 x = -3*t+1;     y = t;    z = t+2;    0.0 < t =< 1.0 


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

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

  then 

        (b
     int(        F.dr  =  -31.000
        (a


  f(x2,y2,y2) - f(x1,y1,z1)  = -31.000

 Press return to continue.