« Mathc initiation/c33cc » : différence entre les versions
Contenu supprimé Contenu ajouté
petit correction |
petit correction |
||
Ligne 11 : | Ligne 11 : | ||
<syntaxhighlight lang="c"> |
<syntaxhighlight lang="c"> |
||
/* ---------------------------------- */ |
/* ---------------------------------- */ |
||
/* save as |
/* save as c17c.c */ |
||
/* --------------------------------- */ |
/* --------------------------------- */ |
||
#include "x_hfile.h" |
#include "x_hfile.h" |
||
#include " |
#include "fc.h" |
||
/* --------------------------------- */ |
/* --------------------------------- */ |
||
int main(void) |
int main(void) |
||
Ligne 27 : | Ligne 27 : | ||
ay = 0; |
ay = 0; |
||
by = |
by = 4; |
||
n = 2*150; |
n = 2*150; |
||
ny = 2*150; |
ny = 2*150; |
||
M = trapezoid_dxdy(f, u,v,n, ay,by,ny); |
M = trapezoid_dxdy(f, u,v,n, ay,by,ny); |
||
printf(" With the trapezoidal's rule.\n\n"); |
printf(" With the trapezoidal's rule.\n\n"); |
||
Ligne 44 : | Ligne 43 : | ||
} |
} |
||
/* --------------------------------- */ |
/* --------------------------------- */ |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
Ligne 53 : | Ligne 51 : | ||
<syntaxhighlight lang="dos"> |
<syntaxhighlight lang="dos"> |
||
f : (x,y)-> |
f : (x,y)-> x**3+4*y |
||
u : (y)-> |
u : (y)-> y/2. |
||
v : (y)-> sqrt( |
v : (y)-> sqrt(y) |
||
Ligne 66 : | Ligne 64 : | ||
With the trapezoidal's rule. |
With the trapezoidal's rule. |
||
( |
(4.000 (sqrt(y) |
||
int( int( |
int( int( x**3+4*y dx dy = 10.666577 |
||
(0.000 ( |
(0.000 (y/2. |
||
Press return to continue. |
Press return to continue. |
||
</syntaxhighlight> |
</syntaxhighlight> |
Version du 19 juillet 2021 à 19:22
Installer et compiler ces fichiers dans votre répertoire de travail.
c17c.c |
---|
/* ---------------------------------- */
/* save as c17c.c */
/* --------------------------------- */
#include "x_hfile.h"
#include "fc.h"
/* --------------------------------- */
int main(void)
{
double ay,by,n,ny,M;
clrscrn();
printf(" f : (x,y)-> %s\n\n\n", feq);
printf(" u : (y)-> %s \n\n", ueq);
printf(" v : (y)-> %s\n\n\n", veq);
printf("\n\n\n");
ay = 0;
by = 4;
n = 2*150;
ny = 2*150;
M = trapezoid_dxdy(f, u,v,n, ay,by,ny);
printf(" With the trapezoidal's rule.\n\n");
printf(" (%.3f (%s\n", by, veq);
printf(" int( int( %s dx dy = %.6f\n", feq, M);
printf(" (%.3f (%s\n\n\n", ay, ueq);
stop();
return 0;
}
/* --------------------------------- */
Exemple de sortie écran :
f : (x,y)-> x**3+4*y
u : (y)-> y/2.
v : (y)-> sqrt(y)
With the trapezoidal's rule.
(4.000 (sqrt(y)
int( int( x**3+4*y dx dy = 10.666577
(0.000 (y/2.
Press return to continue.