Aller au contenu

Mathc initiation/Fichiers h : c50a6

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)
{
 clrscrn();

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

 printf(" Find the surface area for the given functions\n");
 printf(" with the simpson's rule.\n\n\n");
 printf("    (b     (v(x)\n");
 printf(" int(   int(     sqrt(g_x()**2 + g_y()**2 + 1)  dydx = %.3f\n", 
                                               S_dydx(g, u,v,LOOP, a,b,LOOP));
 printf("    (a     (u(x)\n\n\n");

 stop();

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


Exemple de sortie écran :

 g : (x,y)-> y + 1./2.*x**2

 v :   (x)-> 1  
 u :   (x)-> 0

 b =    +1.0
 a =    +0.0


 Find the surface area for the given functions
 with the simpson's rule.


    (b     (v(x)
 int(   int(     sqrt(g_x()**2 + g_y()**2 + 1)  dydx = 1.525
    (a     (u(x)




 Press return to continue.


Exemple de sortie écran :

Verify with maple

> restart:
> 
> g := (x,y)->y+(x^2)/2:
> Int(
> Int(
> 
> sqrt( diff(g(x,y),x)^2 + diff(g(x,y),y)^2 + 1),
> 
> y = 0 .. 1),
> x = 0 .. 1);

                        1    1
                       /    /
                      |    |         2
                      |    |   sqrt(x  + 2) dy dx
                      |    |
                     /    /
                       0    0

> evalf(value(%));
> 

                             1.524504352