[Maxima] problems with abs() and cabs()
macrakis at alum.mit.edu
Thu Jan 7 16:13:52 CST 2010
On Thu, Jan 7, 2010 at 4:57 PM, Stanislav Maslovski <
stanislav.maslovski at gmail.com> wrote:
> On Thu, Jan 07, 2010 at 10:01:35AM -0500, Stavros Macrakis wrote:
> > The approach using "cabs" is probably not ideal.
> > The purpose of cabs is to produce a *symbolic expression* for the complex
> > absolute value.
> In what sense exactly is it different from myabs(z) :=
> sqrt(realpart(z)^2 + imagpart(z)^2)?
It does not necessarily give an answer in that form. For example,
cabs(exp(%i*x)) => 1, but myabs(exp(%i*x)) => sqrt(sin(x)^2+cos(x)^2), which
of course is equal to 1, but is not simplified to 1.
> The documentation is unclear.
Unclear about what in particular?
By experimentation I see that all 3 functions return same symbolic answers
> if given a symbolic expression.
The fact that abs(x) gives the same result as cabs(x) is a recent, um,
innovation (OK, frankly, I consider it a bug), which was apparently
introduced by an implementor who didn't understand the rationale behind abs
and cabs being different. I can understand how that might happen, since the
documentation does not distinguish clearly between abs and cabs.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Maxima