Mathc initiation/Fichiers c : c61cb


Sommaire


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


c00b.c
/* ---------------------------------- */
/* save as c00b.c                     */
/* ---------------------------------- */
#include "x_hfile.h"
#include      "fb.h"
/* ---------------------------------- */
int main(void)
{  
double  m = IntFlux_simpson_dydx( M,  N,  P,
                                  f,
                                  u,  v,LOOP,
                                  ax,bx,LOOP);
 clrscrn();

 printf(" Let S be the part of the graph of z = %s with z >= 0.  \n\n", feq);
 printf(" If F(x,y,z) = %si %sj %sk, find the flux of F through S\n\n\n",
          Meq,Neq,Peq);
printf(" Consider f(x,y) = (%s)\n\n",feq);
 printf("          n      = grad(f(x,y)) / ||grad(f(x,y))||\n\n\n");
                             
 printf(" The flux of F through S is \n\n");
 printf("     //                  \n");
 printf("    ||                   \n");
 printf("    || F.n  dS = %.3f\n",m);
 printf("    ||                   \n");
 printf("   //                    \n");
 printf("   S                 \n\n\n");
 stop();

  clrscrn();
 printf("    Formula : \n\n");
 printf("     //                  \n");
 printf("    ||                   \n");
 printf("    || F.n  dS = %.3f\n",m);
 printf("    ||                   \n");
 printf("   //                    \n");
 printf("   S                 \n\n\n");

 printf("     //\n");
 printf("    ||              (n)\n");
 printf("    || \n");
 printf("    ||     F  .  (-f_xi-f_yj+k)    dS = %.3f\n",m);
 printf("    ||            ------------    \n");
 printf("    ||         [f_x^2+f_y^2+1]^1/2\n");
 printf("   //  \n");
 printf("   S \n\n\n");
 stop();

 clrscrn();
 printf("    Formula :\n\n");
 printf("     //\n");
 printf("    || \n");
 printf("    ||     F  .  (-f_xi-f_yj+k)    dS = %.3f\n",m);
 printf("    ||            ------------   \n");
 printf("    ||        [f_x^2+f_y^2+1]^1/2\n");
 printf("    || \n");
 printf("   //  \n");
 printf("   S \n\n\n");

 printf("     //\n");
 printf("    ||    (F)       (n)                  (dS)\n");
 printf("    || \n");
 printf("    ||     F  .  (-f_xi-f_yj+k)   [f_x^2+f_y^2+1]^1/2 dA = %.3f\n",m);
 printf("    ||            -----------     \n");
 printf("    ||         [f_x^2+f_y^2+1]^1/2\n");
 printf("   //  \n    ");
 printf("   Rxy \n\n\n");
 stop();

 clrscrn();
 printf("     / b   / v(x)\n");
 printf("    |     |      \n");
 printf("    |     |     F.(-f_xi-f_yj+k)    [f_x^2+f_y^2+1]^1/2 dy dx = %.3f\n",m);
 printf("    |     |        -----------     \n");
 printf("    |     |     [f_x^2+f_y^2+1]^1/2\n");
 printf("    |     |      \n");
 printf("   /  a  /   u(x)\n\n\n");

 printf(" With.\n\n\n");
 printf(" F : (x,y,z)-> %si %sj %sk \n\n",Meq,Neq,Peq);
 printf(" f :   (x,y)-> %s    \n\n", feq);

 printf(" v :     (x)-> %s       \n", veq);
 printf(" u :     (x)-> %s     \n\n", ueq); 
 printf(" b = %+.1f\n a = %+.1f\n\n",bx,ax);

 stop();

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


L'algorithme consiste à adapter la fonction qui calcule les intégrales doubles au calcul des flux.

Remarque :

 Dans cette version nous utilisons cet algorithme pour l'intégrale.

     / b   / v(y)
    |     |      
    |     |     F.(-f_xi-f_yj+k)    [f_x^2+f_y^2+1]^1/2 dx dy = 
    |     |        -----------     
    |     |     [f_x^2+f_y^2+1]^1/2
    |     |      
   /  a  /   u(y)
   
   
   Dans la prochaine version nous utiliserons la version simplifiée.
   
     / b   / v(y)
    |     |      
    |     |     F.(-f_xi-f_yj+k)    dx dy = 
    |     |      
   /  a  /   u(y)


Exemple de sortie écran :
     / b   / v(x)
    |     |      
    |     |     F.(-f_xi-f_yj+k)    [f_x^2+f_y^2+1]^1/2 dy dx = 4.712
    |     |        -----------     
    |     |     [f_x^2+f_y^2+1]^1/2
    |     |      
   /  a  /   u(x)


 With.


 F : (x,y,z)-> xi yj zk 

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

 u :     (x)-> -sqrt(1-x**2)      
 v :     (x)-> +sqrt(1-x**2)    

 a = -1.0   b = +1.0 
 Press return to continue.