Problème d'affichage graphique
Publié : jeu. août 30, 2012 10:55 am
j'ai écrit un programme hier qui représentait des fonctions
il fonctionnait très bien et aujourd'hui il ne trace plus les fonctions.
pourquoi ?
voilà le programme
alcol():={
coef:=-0.15;
a:=0.26;
b:=0.29;
c:=0.29;
d:=0.37;
A(x):=piecewise(x<0,0,x<0.5,2*a*x,x<0.5-a/coef,coef*(x-0.5)+a,0);
B(x):=piecewise(x<0.5,0,x<1,2*b*(x-0.5),x<1-b/coef,coef*(x-1)+b,0);
C(x):=piecewise(x<1,0,x<1.5,2*c*(x-1),x<1.5-c/coef,coef*(x-1.5)+c,0);
D(x):=piecewise(x<1.5,0,x<2,2*d*(x-1.5),x<2-d/coef,coef*(x-2)+d,0);
s(x):=A(x)+B(x)+C(x)+D(x);
plotfunc(A(x),x=0..10,couleur=bleu);
plotfunc(B(x),x=0..10,couleur=rouge);
plotfunc(C(x),x=0..10,couleur=vert);
plotfunc(D(x),x=0..10,couleur=bleu);
plotfunc(s(x),x=0..10,couleur=noir);
}:;
il fonctionnait très bien et aujourd'hui il ne trace plus les fonctions.
pourquoi ?
voilà le programme
alcol():={
coef:=-0.15;
a:=0.26;
b:=0.29;
c:=0.29;
d:=0.37;
A(x):=piecewise(x<0,0,x<0.5,2*a*x,x<0.5-a/coef,coef*(x-0.5)+a,0);
B(x):=piecewise(x<0.5,0,x<1,2*b*(x-0.5),x<1-b/coef,coef*(x-1)+b,0);
C(x):=piecewise(x<1,0,x<1.5,2*c*(x-1),x<1.5-c/coef,coef*(x-1.5)+c,0);
D(x):=piecewise(x<1.5,0,x<2,2*d*(x-1.5),x<2-d/coef,coef*(x-2)+d,0);
s(x):=A(x)+B(x)+C(x)+D(x);
plotfunc(A(x),x=0..10,couleur=bleu);
plotfunc(B(x),x=0..10,couleur=rouge);
plotfunc(C(x),x=0..10,couleur=vert);
plotfunc(D(x),x=0..10,couleur=bleu);
plotfunc(s(x),x=0..10,couleur=noir);
}:;