Mathc initiation/Fichiers c : c66cb
Apparence
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 x1 = 0.;
double y1 = 1.;
double z1 = 1./2.;
double x2 = PI/2;
double y2 = 3.;
double z2 = 2.;
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) = grad f(x,y). Ensuite nous vérifions que le calcul de l'intégrale de F(x,y) est bien égal à f(x2,y2) - f(x1,y1).
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) = (y**2*cos(x))i + (2*y*sin(x) + exp(2*z))j + (2*y*exp(2*z))k
and has C parametrization :
x = 1/2*t*Pi; y = 2*t+1; z = 1.5*t+.5; 0.0 < t =< 1.0
Let f(x,y,z) = y**2*sin(x) + y*exp(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 = +170.076
(c (c (c
f(x2,y2,z2) - f(x1,y1,z1) = +170.076
Press return to continue.