Répondre à : comportement de maxima

Accueil Forums Programmation WIMS Programmation d’exercices OEF comportement de maxima Répondre à : comportement de maxima

#4184
lemaire
Participant
Up
0
Down
::

float without map seems to work also for simple expressions:

 a:float(cos(2/10*x));
b:float(cos(0.2*x)-cos(2/10*x));
c:float(cos(0.2)-cos(2/10));
d:float(exp(0.2*x)-exp(2/10*x));
e:float(ratsimp(exp(0.2*x)-exp(2/10*x)));

give
cos(0.2 x)
0.0
0.0
2.718281828459045^(0.2x) – 1.0 2.718281828459045^(x/5)
0.0

But if we compose exp and cos, terms are not always simplified:


f:float(ratsimp(exp(cos(0.2)*x)-exp(cos(2/10)*x)));
g:float(ratsimp(trigsimp(exp(cos(0.2*x))-exp(cos(2/10*x)))));

Answers are:


rat: replaced 0.9800665778412416 by 21157347/21587663 = 0.980066577841242
                                                
 2.718281828459045^ ( 21157347 x/ 21587663 ) - 1.0 2.718281828459045^(cos(1/5) x)

and


rat: replaced 0.2 by 1/5 = 0.2
 0.0

I wonder if it will better not to use 0.2 in expression when using the answer type formal; The problem could be avoided if a warning message can be displayed to students when they enter a comma number. For instance,
Your answer must not contain a decimal point. Write decimal numbers as fractions.

  • Cette réponse a été modifiée le il y a 7 années par lemaire.