[Maxima] realpart strangeness, was: besselarray bug, was: Bessel plotting problem
fateman at cs.berkeley.edu
Thu Jun 12 11:53:44 CDT 2008
Seems to me that realpart should operate only on constants that look like
<realnumber> + <realnumber>*%i.
rectform is another functionality, trying to obtain <evaluable-to-a-real>
coeff(expression,%i) will work for some things, but its semantics are not
the same as realpart.
my 2 cents.
From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu]
On Behalf Of Stavros Macrakis
Sent: Thursday, June 12, 2008 9:24 AM
To: Robert Dodier
Cc: Maxima List
Subject: Re: [Maxima] realpart strangeness, was: besselarray bug,was: Bessel
On Thu, Jun 12, 2008 at 12:21 AM, Robert Dodier <robert.dodier at gmail.com>
The more serious is that realpart (and imagpart) assumes that any
function it doesn;t recognize (which includes Bessel functions) is
purely real. Yikes. Should return a noun expression in that case.
This bug was reported before:
This is not a bug; realpart operates as designed. Whether the *design* is
good is another matter, and we may well want to revisit it.
Maxima in general assumes that all unknown quantities (functions and
variables) are real unless otherwise specified. Thus imagpart(x) => 0,
imagpart(f(x)) => 0, imagpart(f(%i)) => 0, etc. For *variables*, this has
proven to be a reasonable pragmatic decision, I think. This can be
overridden, variable-by-variable, using declare(var,complex). As it
happens, this also works for var as a function:
imagpart(ff(x)) => 'imagpart(ff(x))
Unfortunately, this doesn't work for bessel_i -- *that* is a bug.
The assumption that all variables and functions are real could be changed in
Maxima could assume that all variables and functions are complex unless
otherwise specified. This would, I suspect, be annoying in many cases, e.g.
imagpart(a+b*%i) => 'imagpart(a)+'realpart(b).
Maxima could assume that all variables are real, but unknown functions are
real for real arguments, which is of course untrue for many common built-in
functions like sqrt, asin, etc. -- so why should it be assumed for unknown
functions?: subst(asin,f,imagpart(f(x))) would not be the same as
asin(subst(asin,f,f(x))) and subst(%i,x,imagpart(f(x))) would not be equal
Probably the only consistent approach would be to assume that unknown
functions are always potentially complex, so rectform(f(x)) =>
'realpart(f(x)) + 'imagpart(f(x)). Is this going to make life easier or
harder for users? I don't know.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Maxima