On Tue, 05 Dec 2006 04:12:52 -0800, Joel B. Mohler  
<[EMAIL PROTECTED]> wrote:

>
> On Tuesday 05 December 2006 02:43, William Stein wrote:
>> >>> f = sin(x) should be illegal (though I'm not sure how to throw an
>> >>> informative error here).
>>
>> That means writing "sin(x)" is illegal, so
>>
>>    show(plot(sin(x)))
>>
>> is illegal
>
> I realize that some of the things that Robert & I are saying would make  
> the
> above plot much more complicated to generate (personally, the result of  
> that
> plot command is near useless so I'm not sure I care, but it's nice to  
> have
> default bounds I guess).

The bounds are irrelevant for this discussion.  Surely you wouldn't
say that the results of

       show(plot(sin(x), 0, 2*pi))

is "nearly useless", would you?  This works in the current version of
SAGE already, and is very natural.

> However, I think that if the above plot command
> works, the following should also:
>
> sage: show(plot(1))

Yes.  That it doesn't is a bug.

> ---------------------------------------------------------------------------
> <type 'exceptions.ValueError'>            Traceback (most recent call  
> last)
>
> /home/joel/<ipython console> in <module>()
>
> /home/joel/sage-1.5.alpha6/local/lib/python2.5/site-packages/sage/plot/plot.py
> in __call__(self, funcs, xmin, xmax, parametric, polar, show, **kwds)
>    2096                 data.append((x, float(y)))
>    2097             except (TypeError, ValueError), msg:
> -> 2098                 raise ValueError, "Unable to compute f(%s)"%x

> My suggestion for a fix is that the input to plot command should be  
> coerced to
> a function of one variable and then evaluated.  Constants would, of  
> course,
> be coerced to the constant function.

The solution in mathematica and most systems is that one
has to give the variable one is plotting with respect to.

You know, honestly, the problem of how to express do Calculus with
a computer algebra system is not exactly a new one.  It's been
to some degree completely and totally solved by Mathematica.
Maybe the real discussion we should be having is how can we
make a basic interface to SAGE for doing calculus that is very similar
to mathematica's?   Only if there is a strong technical reason why
something is not possible in Python, should we even be having these
discussions.   Basically, before we continue going along the route
suggested by you and Robert, I would like a very good justification
for why Mathematica/Maple got it wrong (despite millions of users
and two decades of polishing and work).  Otherwise, I don't understand
why we don't just do something similar to Mathematica.  This reduces
the learning curve for some people a lot, and means we spend time
solving problems instead of coming up with a new design that is probably
wrong anyways, then spending a lot of time testing it, only to find
that it really doesn't work for various reasons.

What do you think Bobby?

We are building the car, not reinventing the wheel.

  -- William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to