Aller au contenu

Mathc initiation/Fichiers c : c59cb1

Un livre de Wikilivres.


Sommaire


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


c18b1.c
/* ---------------------------------- */
/* save as c18b1.c                    */
/* ---------------------------------- */
#include "x_hfile.h"
#include      "fb.h"
/* ---------------------------------- */
int main(void)
{
double m =  0.;

 clrscrn();
 printf(" Let S be the part of the graph of z = %s with z >= 0.  \n\n", feq);
 printf(" Let C be the trace of S on the x-y-plane.              \n\n");
 printf(" Verify Stokes's theorem for the vector field,          \n\n");
 printf("     F(x,y,z) = %si %sj %sk\n\n\n\n\n",Meq,Neq,Peq);

 printf(" Stoke's theorem.                    \n\n" 
        "     /           //                    \n" 
        "    |           ||                     \n" 
        "    O F.T ds  = || (curl F).n  dS      \n" 
        "    |           ||                     \n" 
        "   / C         //                      \n" 
        "               S                   \n\n\n");
 stop();

 clrscrn();
 printf("     //                    \n" 
        "    ||                     \n" 
        "    || (curl F).n dS =     \n" 
        "    ||                     \n" 
        "   //                      \n" 
        "   S                   \n\n\n" 
        
        "   with F = Mi + Nj + Pk     \n\n" 
        
        " (curl F) = [(P_y-N_z)i + (M_z-P_x)j + (N_x-M_y)k]\n\n\n\n" 
        
        "            (-f_xi-f_yj+k)           \n" 
        "        n =  ------------            \n" 
        "           [(f_x)^2+(f_y)^2+1]^1/2 \n\n\n\n" 
        
        "       dS = [(f_x)^2+(f_y)^2+1]^1/2 dA             dA = dxdy\n\n"); 
 stop();

 clrscrn();
 printf(" With the Stokes's theorem you find :\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 :     (y)-> %s            \n", veq);
 printf(" u :     (y)-> %s          \n\n", ueq);
  
 printf(" b = %+.1f\n a = %+.1f\n\n",by,ay);
 
  m = stokes_dxdy(           M,N,P,
                             f,
                             u,  v,LOOP,
                             ay,by,LOOP);

 printf("     / b   / v(y)\n" 
        "    |     |      \n" 
        "    |     |   (curl F).n    [(f_x)^2+(f_y)^2+1]^1/2 dx dy = %.3f\n"
        "    |     |      \n" 
        "   /  a  /   u(y)\n\n\n",m);
 stop();
 
 return 0;
}
/* ---------------------------------- */
/* ---------------------------------- */


Vérifions le théorème de Stoke partie 1.


Exemple de sortie écran :

 Let S be the part of the graph of z = 4-x**2-y**2 with z >= 0.  

 Let C be the trace of S on the x-y-plane.              

 Verify Stokes's theorem for the vector field,          

     F(x,y,z) = + 2*yi + exp(z)j  - atan(x)k




 Stoke's theorem.

     /           //                    
    |           ||                     
    O F.T ds  = || (curl F).n  dS      
    |           ||                     
   / C         //                      
               S                   


 Press return to continue.

Exemple de sortie écran :

    //                    
    ||                     
    || (curl F).n dS =     
    ||                     
   //                      
   S                   


   with F = Mi + Nj + Pk     

 (curl F) = [(P_y-N_z)i + (M_z-P_x)j + (N_x-M_y)k]



            (-f_xi-f_yj+k)           
        n =  ------------            
           [(f_x)^2+(f_y)^2+1]^1/2 



       dS = [(f_x)^2+(f_y)^2+1]^1/2 dA             dA = dxdy

 Press return to continue.


Exemple de sortie écran :

 With the Stokes's theorem you find :


 F : (x,y,z)-> + 2*yi + exp(z)j  - atan(x)k 

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

 u :     (y)-> -sqrt(4-y**2)       
 v :     (y)-> +sqrt(4-y**2)     

 a = -2.0   b = +2.0

     / b   / v(y)
    |     |      
    |     |   (curl F).n    [(f_x)^2+(f_y)^2+1]^1/2 dx dy = -25.129
    |     |      
   /  a  /   u(y)


 Press return to continue.