Mathc initiation/Fichiers c : c51c1b
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 a = 0;
double b = 2.;
int n = 2*20;
double S01 = 0;
double S02 = 0;
double j = H;
/* --------------------------------- */
clrscrn();
printf(" The Green's theorem : \n\n");
printf(" ( (b (v(y)\n"
" int( M(x,y) + dx N(x,y) dy = int( int( (N_x - M_y) dy dx\n"
" (c (a (u(y) \n\n\n\n\n");
printf(" Use the line integral to evaluate : \n\n");
printf(" ( \n");
printf(" int( %s + dx %s dy = \n", Meq, Neq);
printf(" (c\n\n\n\n");
stop();
/* --------------------------------- */
clrscrn();
printf(" M(x,y) = %s \n", Meq);
printf(" N(x,y) = %s \n\n", Neq);
printf(" v(y) = %s \n", veq);
printf(" u(y) = %s \n", ueq);
printf(" r(y) = %s \n\n", req);
S01 = lineintegral_dx( M,r,u,a,b,n,j) + lineintegral_dx( M,r,v,b,a,n,j);
S02 = lineintegral_dy( N,r,u,a,b,n,j) + lineintegral_dy( N,r,v,b,a,n,j);
printf(" (\n"
" int( %s dx = %+.5f\n"
" (C\n\n", Meq,S01 );
printf(" (\n"
" int( %s dy = %+.5f\n"
" (C\n\n\n", Neq, S02);
printf(" ( \n"
" int( %s dx + %s dy = %+.5f\n"
" (C\n\n\n",Meq,Neq,S01+S02 );
stop();
return 0;
}
/* ---------------------------------
* With simpson_dydy();
S01 = lineintegral_dx( M,r,u,a,b,n,j) + lineintegral_dx( M,r,v,b,a,n,j);
S02 = lineintegral_dy( N,r,u,a,b,n,j) + lineintegral_dy( N,r,v,b,a,n,j);
* With simpson_dxdy();
S01 = lineintegral_dx( M,u,r,b,a,n,j) + lineintegral_dx( M,v,r,a,b,n,j);
S02 = lineintegral_dy( N,u,r,b,a,n,j) + lineintegral_dy( N,v,r,a,b,n,j) ;
--------------------------------- */
/* --------------------------------- */
/* --------------------------------- */
On utilise les intégrales curviligne du théorème de Green.
Exemple de sortie écran :
The Green's theorem :
( (b (v(y)
int( M(x,y) + dx N(x,y) dy = int( int( (N_x - M_y) dy dx
(c (a (u(y)
Use the line integral to evaluate :
(
int( (5*x*y) + dx (x**3) dy =
(c
Press return to continue.
Exemple de sortie écran :
M(x,y) = (5*x*y)
N(x,y) = (x**3)
v(y) = 2*y
u(y) = y**2
r(y) = y
(
int( (5*x*y) dx = -6.66667
(C
(
int( (x**3) dy = +4.80000
(C
(
int( (5*x*y) dx + (x**3) dy = -1.86666
(C
Press return to continue.