Mathc initiation/Fichiers c : c66ca
Apparence
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 x1 = 1.;
double y1 = 0.;
double z1 = 2.;
double x2 = -2;
double y2 = 1.;
double z2 = 3.;
double m = 0;
clrscrn();
printf(" Let F(x,y,z) = M(x,y,z) i + N(x,y,z) j + P(x,y,z) k\n\n");
printf(" Be continuous on an open connected region D,\n");
printf(" And let C be a piecewise-smooth curve in D\n");
printf(" With endpoints A(x1,y1,z1) and B(x2,y2,z2).\n\n");
printf(" If F(x,y,z) = grad f(x,y,z) then \n\n");
printf(" ( ( ( (x2,y2,z2)\n");
printf(" int( M(x,y,z)dx + int( N(x,y,z)dy+ int( P(x,y,z)dz = [f(x,y)]\n");
printf(" (c (c (c (x1,y1,z1)\n\n\n");
stop();
clrscrn();
printf(" Let F(x,y,z) = %si + %sj + %sk \n\n",Meq,Neq,Peq);
printf(" and has C parametrization :\n\n");
printf(" x = %s; y = %s; z = %s; %.1f < t =< %.1f \n\n\n",
geq, heq, keq, a, b);
printf(" Let f(x,y,z) = %s \n\n",feq);
printf(" Verify if F(x,y,z) = grad f(x,y,z)\n\n");
m = lint3d_dx(
M,
g,h,k,
a,b,LOOP);
m += lint3d_dy(
N,
g,h,k,
a,b,LOOP);
m += lint3d_dz(
P,
g,h,k,
a,b,LOOP);
printf(" then \n\n");
printf(" ( ( ( \n");
printf(" int( M(x,y,z)dx + int( N(x,y,z)dy + int( P(x,y,z)dz = %+.3f\n",m);
printf(" (c (c (c \n\n\n");
printf(" f(x2,y2,z2) - f(x1,y1,z1) = %+.3f\n\n", f(x2,y2,z2) - f(x1,y1,z1));
stop();
return 0;
}
/* ---------------------------------- */
/* ---------------------------------- */
Nous devons commencer par vérifier manuellement que F(x,y,z) = grad f(x,y,z). Ensuite nous vérifions que le calcul de l'intégrale de F(x,y,y) est bien égal à f(x2,y2,z2) - f(x1,y1,z1).
Exemple de sortie écran :
Let F(x,y,z) = M(x,y,z) i + N(x,y,z) j + P(x,y,z) k
Be continuous on an open connected region D,
And let C be a piecewise-smooth curve in D
With endpoints A(x1,y1,z1) and B(x2,y2,z2).
If F(x,y,z) = grad f(x,y,z) then
( ( ( (x2,y2,z2)
int( M(x,y,z)dx + int( N(x,y,z)dy+ int( P(x,y,z)dz = [f(x,y)]
(c (c (c (x1,y1,z1)
Press return to continue.
Exemple de sortie écran :
Let F(x,y,z) = (6*x*y**3 + 2*z**2)i + (9*x**2*y**2)j + (4*x*z+1)k
and has C parametrization :
x = (-3*t+1); y = t; z = t+2; 0.0 < t =< 1.0
Let f(x,y,z) = 3*x**2*y**3 + 2*x*z**2 + z
Verify if F(x,y,z) = grad f(x,y,z)
then
( ( (
int( M(x,y,z)dx + int( N(x,y,z)dy + int( P(x,y,z)dz = -31.000
(c (c (c
f(x2,y2,z2) - f(x1,y1,z1) = -31.000
Press return to continue.