Strange results from assume (maybe a bug?) ad asksign
Subject: Strange results from assume (maybe a bug?) ad asksign
From: ferriste at libero.it
Date: Sat, 27 Dec 2008 15:27:11 +0100 (CET)
Hi, I am developing a software running within Maxima and I need to define
angles within the four region of the Cartesion plane (0<alpha<%pi/2, %
pi/2<alpha<%pi,...). In example, if the angle alpha belongs to the region
0<alpha<%pi/2, I write:
(%i1) assume(alpha>0,alpha<%pi/2);
but...
(%i2) is
(alpha>%pi);
(%o2) unknown
when it should be false. Also, if one
defines a partially redundant rule like this:
(%i3) assume(a>1,a>2);
(%
o3) [a > 1, a > 2]
(%i4) is(a>1.5);
(%
o4) true
when it should be unknown, if the rules
are linked by a boolean and (or isn't so?).
Also, with the above assumption
about alpha:
(%i5) asksign(sin(alpha));
Is sin(alpha) positive, negative, or
zero?
Maxima should easily understand that the sine of an angle within 0 and %
pi/2 is positive...
In the Maxima manual I read, in the page explaining
assume:
"Maxima?s deduction mechanism is not very strong; there are many
obvious consequences
which cannot be determined by is. This is a known
weakness."
Ok, but there are some things quite banal to be evaluated, but not
less important... In my (for now) little software there are many trigonometric
functions, and I am continuously asked about the sign of sine and cosine. I
have solved the problem by declaring:
assume(sin(alpha)>0,cos(alpha)>0);
that
is the same thing of saying 0<alpha<%pi/2, but it's not efficient and it is a
quite serious issue for my code.
Are these bugs or lacks of functionality in
Maxima :-(? Or am I wrong about something?
Stefano