On Mon, Oct 23, 2006 at 10:59:18PM -0600, Robert Dodier wrote:
> On 10/19/06, Marco Ciampa <ciampix at libero.it> wrote:
>
> >To extend the concept Maxima could be made avare to treat some
> >"base tipes" numbers like integer, natural, rational, real or complex
> >(and it could be made extensible too). Such a "typized" CAS would
> >resolve automatically the problem of having to plot the result of an
> >equation like this:
> >
> >plot2d([sqrt(x-2) * sqrt(x-4)], [x,-5,5]);
> >
> >only in the _real_ field.
>
> I don't think that such an approach is workable in Maxima,
> not even if we consider wishful thinking. However some aspect of
> it is feasible, I believe.
>
> In general the proposal is infeasible because in many places
> Maxima constructs results without actually doing arithmetic.
> So, for example, if the sqrt function refused to return imaginary
> numbers, it might not help, because some other function can
> still do return '((foo) 1 2 3 %i) whenever it wants.
>
> The part that is feasible, I believe, is to rework the simplifier
> to be more explicit about the identities it applies. The primary
> goal here is to make the simplifier comprehensible.
> At present there is no description or specification of the
> identiies known to Maxima aside from the source code.
> That's only useful to extremely dedicated, expert Lisp programmers.
> I believe our audience is somewhat wider than that.
>
> Anyway, a side effect of clearing up the simplifier would be
> (I'm guessing) to make it easier to apply or retract groups
> of identities. So it may well be possible to retract identities
> which yield results in C, so that the simplifier (if not other
> parts of Maxima) might yield only results in R. However in
> the absence of any actual implementation, that's all speculation.
>
> Finally I'll mention again that the plot_realpart
> flag has the desired effect on plot2d.
>
> For what it's worth,
> Robert Dodier
Thank you to you and to Richard for the quick reply and sorry for being so
slow at the response.
I supposed that the solution was not so easy since changing the way maxima
works touch things very deep into the inner workings of it.
Sorry but no plot_realpart nor realpart(), as Richard Fateman suggested, are
useful with equations like: sqrt(x-2)*sqrt(x-4) that are very common in a
high school math lesson. Simply put: maxima does "too much" and forces the
teacher to plot sqrt(x-2) and sqrt(x-4) in two separate sessions,
explaining way maxima plots the negative part of the entire equation result graph
even if for values of x<4 the results are not defined (so introducing earlier
the complex numbers).
Maxima is great but fails as a teching "starting" math tool. To be right,
I do not even know of any commercial alternative that is able to plot correctly
that equation for Real numbers...if in the future this way of working will
be considered, it probably will be the first professional tool with this
feature ever.
Many thanks,
--
Marco Ciampa
+--------------------+
| Linux User #78271 |
| FSFE fellow #364 |
+--------------------+