Mathc initiation/a305
Installer et compiler ces fichiers dans votre répertoire de travail.
c01b.c |
---|
/* --------------------------------- */
/* save as c01b.c */
/* --------------------------------- */
#include "x_hfile.h"
#include "fb.h"
/* --------------------------------- */
int main(void)
{
CTRL_splot w = i_ctrl_splot(0.5,2.5, -1,8, 0,0, 0,0, 0,0);
pt2d d = i_pt2d(0.025,0.025);
double step = .01;
clrscrn();
printf(" Verify that v(x) >= u(x) on [%.3f,%.3f].\n\n\n", ax, bx);
printf(" v : x-> %s \n", veq);
printf(" u : x-> %s\n\n", ueq);
G_f_ab(w,
ax,bx,
veq,v,
ueq,u);
stop();
clrscrn();
printf(" Draw a typical vertical rectangle on a graph.\n\n");
printf(" Upper boundary (v) : %s \n",veq);
printf(" lower boundary (u) : %s \n\n",ueq);
printf(" The length of the rectangle is : (%s) - (%s) \n",veq, ueq);
printf(" The width of the rectangle is : dx \n\n");
printf(" The Area of the rectangle is : ((%s) - (%s)) * dx\n",veq, ueq);
printf(" \n\n\n\n\n");
G_f(w,
ax,bx,
d,
step,
v,u);
stop();
clrscrn();
printf(" If we apply \n\n\n");
printf(" (%.3f\n", bx);
printf(" int( \n");
printf(" (%.3f\n\n\n", ax);
printf(" to : ((%s) - (%s)) * dx\n\n", veq, ueq);
printf(" We obtain a limit of sums of areas of vertical rectangles.\n\n\n");
printf(" (%.3f\n", bx);
printf(" int( (%s) * dx = %.6f\n", v_minu_ueq,
simpson(v_minu_u, ax,bx,LOOP));
printf(" (%.3f\n\n\n", ax);
stop();
return 0;
}
/* --------------------------------- */
/* --------------------------------- */
Exemple de sortie écran :
If we apply
(2.000
int(
(1.000
to : ((exp(x)) - (log(x))) * dx
We obtain a limit of sums of areas of vertical rectangles.
(2.000
int( (exp(x)-log(x)) * dx = 4.284480
(1.000
Press return to continue.