Mathc initiation/Fichiers c : c63ca

Un livre de Wikilivres.


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 f1,f2,f3;

/* --------------------------------- */
 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();

 f1 = flux_dzdydx(       M,
                         fxyz_x,
                         u,v,LOOP,
                         s,t,LOOP,
                         ax,bx,LOOP);

 printf("    ///                   \n");
 printf("   |||                    \n");
 printf("   |||   M_x dV  =  %.3f\n",f1);
 printf("   |||                    \n");
 printf("  ///                     \n");
 printf("   Q                   \n\n");


  f2 = flux_dzdydx(      N,
                         fxyz_y,
                         u,v,LOOP,
                         s,t,LOOP,
                         ax,bx,LOOP);

 printf("    ///                   \n");
 printf("   |||                    \n");
 printf("   |||   N_y dV  =  %.3f\n",f2);
 printf("   |||                    \n");
 printf("  ///                     \n");
 printf("   Q                   \n\n");

  f3  = flux_dzdydx(     P,
                         fxyz_z,
                         u,v,LOOP,
                         s,t,LOOP,
                         ax,bx,LOOP);

 printf("    ///                   \n");
 printf("   |||                    \n");
 printf("   |||   P_z dV  =  %.3f\n",f3);
 printf("   |||                    \n");
 printf("  ///                     \n");
 printf("   Q                   \n\n");
 stop();

/* --------------------------------- */
 clrscrn();
 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");
 
 printf("    ///             ///            ///               \n");
 printf("   |||             |||            |||                \n");
 printf("   |||  M_x dV  +  ||| N_y dV  +  |||  P_z dV  = %.3f\n",f1+f2+f3);
 printf("   |||             |||            |||                \n");
 printf("  ///             ///            ///                 \n");
 printf("   Q              Q              Q               \n\n\n");

 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) Ici on fait le calcul en trois étapes. L'originalité de ce travail est que l'on introduit les fonctions dérivées partielles en argument de la fonction.


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.


Exemple de sortie écran :
    ///                   
   |||                    
   |||   M_x dV  =  -0.000
   |||                    
  ///                     
   Q                   

    ///                   
   |||                    
   |||   N_y dV  =  0.000
   |||                    
  ///                     
   Q                   

    ///                   
   |||                    
   |||   P_z dV  =  24.000
   |||                    
  ///                     
   Q                   

 Press return to continue.


Exemple de sortie écran :
    ///             ///                      
   |||             |||                       
   ||| div F dV =  |||  M_x + N_y + P_z dV   
   |||             |||                       
  ///             ///                        
   Q               Q                     


    ///             ///            ///               
   |||             |||            |||                
   |||  M_x dV  +  ||| N_y dV  +  |||  P_z dV  = 24.000
   |||             |||            |||                
  ///             ///            ///                 
   Q              Q              Q               


 Press return to continue.