radcan() simplification error.



I haven't looked at your example in detail, but I suspect that your question
relates to the treatment of things like expr: sqrt(x^2-2*x+1).  radcan(expr)
=> x-1, where you might expect abs(x-1), as returned by
scanmap(factor,expr).  This radcan behavior is intentional, on the theory
that either branch of the root is correct.

Why, then, does radcan(sqrt(x^2)) return abs(x)?  Because the *general
simplifier* tries to simplify to the positive root, and so simplifies the
expression to abs(x) before radcan even looks at it:

(%i2) sqrt(x^2);
(%o2) abs(x)
(%i3) radcan(%);
(%o3) abs(x)
(%i4) sqrt(x^2-2*x+1);
(%o4) sqrt(x^2-2*x+1)
(%i5) radcan(%);
(%o5) x-1
(%i6) scanmap(factor,%o4);
(%o6) abs(x-1)
(%i7) radcan(%);
(%o7) abs(x-1)

             -s

On Wed, May 25, 2011 at 17:18, Constantine Frangos <cfrangos at telkomsa.net>wrote:

>
> Dear List,
>
> Any assistance with the following would be appreciated:
>
> (1) The function radcan() seems to simplify the following expression
> correctly:
>
> (%i98) radcan(sqrt(a^2)/sqrt(4*%pi^2*(q0-2000)^2));
>
> (%o98) abs(a)/(2*%pi*abs(q0-2000))
> (%i99)
>
> (2) However, for the following more complicated expression, radcan() seems
> to simplify the denominator incorrectly:
>
> (%i99)
> radcan(sqrt((sin(2*%pi*pmin*(q0-q))-sin(2*%pi*pmax*(q0-q)))^2/(4*%pi^2*(q0-q)^2)+(cos(2*%pi*pmin*(q0-q))-cos(2*%pi*pmax*(q0-q)))^2/(4*%pi^2*(q0-q)^2)));
>
> rat: replaced 2.0 by 2/1 = 2.0
>
> rat: replaced 2.0 by 2/1 = 2.0
>
> rat: replaced 2.0 by 2/1 = 2.0
>
> rat: replaced 2.0 by 2/1 = 2.0
>
> rat: replaced 2.0 by 2/1 = 2.0
>
> rat: replaced 2.0 by 2/1 = 2.0
>
> rat: replaced 2.0 by 2/1 = 2.0
>
> rat: replaced 2.0 by 2/1 = 2.0
> (%o99) sqrt(sin(2*%pi*pmin*q0-2*%pi*pmin*q)^2
>             -2*sin(2*%pi*pmax*q0-2*%pi*pmax*q)
>               *sin(2*%pi*pmin*q0-2*%pi*pmin*q)
>             +cos(2*%pi*pmin*q0-2*%pi*pmin*q)^2
>             -2*cos(2*%pi*pmax*q0-2*%pi*pmax*q)
>               *cos(2*%pi*pmin*q0-2*%pi*pmin*q)
>             +sin(2*%pi*pmax*q0-2*%pi*pmax*q)^2
>             +cos(2*%pi*pmax*q0-2*%pi*pmax*q)^2)
>        /(2*%pi*q0-2*%pi*q)
> (%i100)
>
>
> (3) On the other hand, radcan() seems to take into account some facts
> specified by the
> assume() statement in the example below. Do other Maxima built-in
> simplification functions
> take specified constraints into account ?
>
> (%i101) assume(q0>=2000);
>
> (%o101) [q0 >= 2000]
> (%i102) radcan(sqrt(a^2)/sqrt(4*%pi^2*(q0-2000)^2));
>
> (%o102) abs(a)/(2*%pi*q0-4000*%pi)
> (%i103)
>
>
> Thanks very much.
> Constantine Frangos.
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>