Mathc initiation/Fichiers c : c60cb
Aller à la navigation
Aller à la recherche
Installer et compiler ces fichiers dans votre répertoire de travail. .
![]() |
c18b.c |
---|
/* ---------------------------------- */
/* save as c18b.c */
/* ---------------------------------- */
#include "x_hfile.h"
#include "fb.h"
/* ---------------------------------- */
int main(void)
{
double az = 0;
double bz = 3.;
int nz = 2*50;
int nx = 2*50;
double m = 0;
clrscrn();
m = surface_dxdz( g,h,
u,v,
nx,
az,bz,nz,
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(" Rxz \n\n\n");
printf(" With.\n\n\n");
printf(" g : (x,y,z)-> %s\n\n", geq);
printf(" f : (x,z)-> %s\n\n", feq);
printf(" u : (z)-> %s \n", ueq);
printf(" v : (z)-> %s\n\n", veq);
printf(" a = %+.1f b = %+.1f \n",az,bz);
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 = 24.926
||
//
Rxz
With.
g : (x,y,z)-> x*y**2*z**3
f : (x,z)-> 1./3.*(12-2*y-4*z)
u : (z)-> 0
v : (z)-> (6-2*y)
a = +0.0 b = +3.0
Press return to continue.
Sortie écran d'un CAS :
> restart:
> g := (x,y,z)->x*y**2*z**3:
> f := (x,z)->1./3.*(12-2*x-4*z):
> Int(
> Int(
> g(x,f(x,z),z)*
> sqrt( diff(f(x,z),x)^2 + diff(f(x,z),z)^2 + 1),
>
> x = 0 .. 6-2*z),
> z = 0 .. 3);
3 6 - 2 z
/ /
| |
| | 1.795054935
| |
/ /
0 0
2 3
x (4.000000000 - .6666666666 x - 1.333333333 z) z dx dz
> evalf(value(%));
>
24.92561995
>