Aller au contenu

Mathc initiation/a317

Un livre de Wikilivres.


Sommaire

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

c00d.c
/* --------------------------------- */
/* save as c00d.c                    */
/* --------------------------------- */
#include "x_afile.h"
#include      "fd.h"
/* --------------------------------- */
int main(void)
{
double m = flux_dydxdz(  M,N,P,
                         Y0, Y1,LOOP,
                         x0, x1,LOOP,
                         z0, z1,LOOP);
                         
 clrscrn();
 printf(" Use the divergence theorem to find,\n\n");

 printf(" the flux of F through S.\n\n");

 printf("     //            ///         \n");
 printf("    ||            |||          \n");
 printf("    || F.n dS  =  ||| div F dV \n");
 printf("    ||            |||          \n");
 printf("   //            ///           \n");
 printf("   S                   Q        \n\n\n");

 printf("      If F = Mi + Nj + Pk                    \n\n\n");

 printf("    ///             ///                      \n");
 printf("   |||             |||                       \n");
 printf("   ||| div F dV =  |||  M_x + N_y + P_z dV   \n");
 printf("   |||             |||                       \n");
 printf("  ///             ///                        \n");
 printf("   Q               Q                     \n\n\n");
 stop();

 clrscrn();
 printf("     / z1  / x1(z)  / y1(z, x)                     \n");
 printf("    |     |       |                                \n");
 printf("    |     |       | M_x + N_y + P_z dydxdz = %.3f  \n",m);
 printf("    |     |       |                                \n");
 printf("   /  z0 /   x0(z) /  y0(z, x)                 \n\n\n");

 printf(" With.\n\n\n");
 printf(" F : (z,y,x)-> (%s)i + (%s)j + (%s)k \n\n",Meq,Neq,Peq);

 printf(" y1 :   (z,x)-> %s      \n", y1eq);
 printf(" y0 :   (z,x)-> %s    \n\n", y0eq);

 printf(" x1 :     (z)-> %s      \n", x1eq);
 printf(" x0 :     (z)-> %s    \n\n", x0eq);
 
 printf(" z1 :        -> %s      \n", z1eq);
 printf(" z0 :        -> %s    \n\n", z0eq);
 stop();

 clrscrn();
 printf(" With.\n\n\n");
 printf(" F : (z,y,x)-> (%s)i + (%s)j + (%s)k \n\n",Meq,Neq,Peq);
 
 printf(" Compute the partial derivative M_x, N_y, P_z:\n\n"
        "   (x**3 + sin(z))_x =  (3 x**2)   \n"
        "  (x**2*y + cos(z)_y =    (x**2)   \n"
        " (exp(x**2 + y**2)_z =       (0) \n\n"
        
        "          ((3 x**2)+(x**2)+(0))  \n\n"  
              
        " Code Mathematica : S = %.3f    \n\n"
        " integral ((3 x**2)+(x**2)+(0)) dy dx dz"
        " from (0) to (5-z) from -2 to 2 from 0 to (4-z**2)\n\n",m);
 stop();
 
 return 0;
}
/* --------------------------------- */
/* --------------------------------- */

Ce travail consiste à adapter l'intégrale triple au calcul du flux en 3d par le théorème de la divergence : (M_x + N_y + P_z)

 Exemple de sortie écran :
 Use the divergence theorem to find,

 the flux of F through S.

     //            ///         
    ||            |||          
    || F.n dS  =  ||| div F dV 
    ||            |||          
   //            ///           
   S                   Q        


      If F = Mi + Nj + Pk                    


    ///             ///                      
   |||             |||                       
   ||| div F dV =  |||  M_x + N_y + P_z dV   
   |||             |||                       
  ///             ///                        
   Q               Q                     


 Press return to continue. 


     / z1  / x1(z)  / y1(z, x)                     
    |     |       |                                
    |     |       | M_x + N_y + P_z dydxdz = 780.190  
    |     |       |                                
   /  z0 /   x0(z) /  y0(z, x)                 


 With.


 F : (z,y,x)-> (x^3 + sin(z))i + (x^2*y + cos(z))j + (exp(x^2 + y^2))k 

 y1 :   (z,x)-> 5-z      
 y0 :   (z,x)-> +0    

 x1 :     (z)-> 4-z^2      
 x0 :     (z)-> +0    

 z1 :        -> +2      
 z0 :        -> -2    

 Press return to continue. 


 With.


 F : (z,y,x)-> (x^3 + sin(z))i + (x^2*y + cos(z))j + (exp(x^2 + y^2))k 

 Compute the partial derivative M_x, N_y, P_z:

   (x**3 + sin(z))_x =  (3 x**2)   
  (x**2*y + cos(z)_y =    (x**2)   
 (exp(x**2 + y**2)_z =       (0) 

          ((3 x**2)+(x**2)+(0))  

 Code Mathematica : S = 780.190    

 integral ((3 x**2)+(x**2)+(0)) dy dx dz from (0) to (5-z) from -2 to 2 from 0 to (4-z**2)

 Press return to continue.