Aller au contenu

Mathc initiation/0038

Un livre de Wikilivres.


Sommaire

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

c00f.c
/* --------------------------------- */
/* save as c00f.c                    */
/* --------------------------------- */
#include "x_afile.h"
#include      "ff.h"
/* --------------------------------- */
int main(void)
{
double m = flux_dxdzdy(  M,N,P,
                         x0, x1,LOOP,
                         z0, z1,LOOP,
                         Y0, Y1,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("     / y1  / z1(y)  / x1(y, z)                      \n");
 printf("    |     |        |                                \n");
 printf("    |     |        | M_x + N_y + P_z dxdzdy = %.3f  \n",m);
 printf("    |     |        |                                \n");
 printf("   /  y0 /   z0(y) /  x0(y, z)                   \n\n\n");

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

 printf(" x1 :   (x,y)-> %s      \n", x1eq);
 printf(" x0 :   (x,y)-> %s    \n\n", x0eq);
 
 printf(" z1 :     (y)-> %s      \n", z1eq);
 printf(" z0 :     (y)-> %s    \n\n", z0eq); 
 
 printf(" y1 :     (y)-> %s      \n", y1eq); 
 printf(" y0 :     (y)-> %s    \n\n", y0eq);
 stop();

 clrscrn();
 printf(" With.\n\n\n");
 printf(" F : (x,y,z)-> (%s)i + (%s)j + (%s)k \n\n",Meq,Neq,Peq);
 
 printf(" Compute the partial derivative M_x, N_y, P_z:\n\n"
        "  (2*x*z)_x =  (2*z)   \n"
        "  (x*y*z)_y =  (x*z)   \n"
        "    (y*z)_z =    (y) \n\n"
        
        "          ((2*z)+(x*z)+(y))  \n\n"  
              
        " Code Mathematica : S = %.3f    \n\n"
        " integral ((2*z)+(x*z)+(y)) dx dz dy"
        " from (0) to 2  from (0) to (4)  from 0 to ((4-y)/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. 


     / y1  / z1(y)  / x1(y, z)                      
    |     |        |                                
    |     |        | M_x + N_y + P_z dxdzdy = 77.333  
    |     |        |                                
   /  y0 /   z0(y) /  x0(y, z)                   


 With.


 F : (x,y,z)-> (2*x*z)i + (x*y*z)j + (y*z)k 

 x1 :   (x,y)-> (4-y)/2      
 x0 :   (x,y)-> 0    

 z1 :     (y)-> 4      
 z0 :     (y)-> 0    

 y1 :     (y)-> 2      
 y0 :     (y)-> 0    

 Press return to continue. 


 With.


 F : (x,y,z)-> (2*x*z)i + (x*y*z)j + (y*z)k 

 Compute the partial derivative M_x, N_y, P_z:

  (2*x*z)_x =  (2*z)   
  (x*y*z)_y =  (x*z)   
    (y*z)_z =    (y) 

          ((2*z)+(x*z)+(y))  

 Code Mathematica : S = 77.333    

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

 Press return to continue.