Mathc initiation/Fichiers c : c60ce
Aller à la navigation
Aller à la recherche
Installer et compiler ces fichiers dans votre répertoire de travail. .
![]() |
c18e.c |
---|
/* ---------------------------------- */
/* save as c18e.c */
/* ---------------------------------- */
#include "x_hfile.h"
#include "fe.h"
/* ---------------------------------- */
int main(void)
{
double ax = 0;
double bx = 2.;
int nx = 2*50;
int nz = 2*50;
double m = 0;
clrscrn();
m = surface_dzdx( g,h,
u,v,
nz,
ax,bx,nx,
H);
printf(" Evaluate this surface integrals equation.\n\n");
printf(" // \n");
printf(" || \n");
printf(" || g(x,h(x,z),z)* sqrt[ h_x(x,z)^2 + h_y(x,z)^2 + 1 ] dA = %.3f\n",m);
printf(" || \n");
printf(" // \n");
printf(" Rzx \n\n\n");
printf(" With.\n\n\n");
printf(" g : (x,y,z)-> %s\n\n", geq);
printf(" h : (x,z)-> %s\n\n", feq);
printf(" u : (x)-> %s \n", ueq);
printf(" v : (x)-> %s\n\n", veq);
printf(" a = %+.1f b = %+.1f \n",ax,bx);
stop();
return 0;
}
/* ---------------------------------- */
/* ---------------------------------- */
L'algorithme consiste à adapter la fonction qui calcule les intégrales doubles au calcul des surfaces en 3d.
Exemple de sortie écran :
Evaluate this surface integrals equation.
//
||
|| g(x,h(x,z),z)* sqrt[ h_x(x,z)^2 + h_y(x,z)^2 + 1 ] dA = -181.417
||
//
Rzx
With.
g : (x,y,z)-> x**2-2*y+z
h : (x,z)-> 8-4*x
u : (x)-> 0
v : (x)-> 6
a = +0.0 b = +2.0
Press return to continue.
Sortie écran d'un CAS :
> restart:
> g := (x,y,z)-> x**2-2*y+z:
> h := (x,z)-> 8-4*x:
> Int(
> Int(
> g(x,h(x,z),z)*
> sqrt( diff(h(x,z),x)^2 + diff(h(x,z),z)^2 + 1),
>
> z = 0 .. 6),
> x = 0 .. 2);
2 6
/ /
| | 2
| | (x - 16 + 8 x + z) sqrt(17) dz dx
| |
/ /
0 0
> evalf(value(%));
>
-181.4166475
>