On 08/21/2008 11:14:16 AM, William Stein wrote:
> 
> On Thu, Aug 21, 2008 at 10:58 AM, Mike Witt <[EMAIL PROTECTED]> wrote:
> >
> > This is an attempt to ask my previous question more clearly :-)
> >
> > I'm looking for a work-around for the situation where I would normally
> > call parametric_plot (or plot, for that matter) with a function, and in
> > some particular case that function turns out to evaluate to a constant.
> >
> > For example:
> >
> > sage: def f(a,b): return e^(a+b*I)
> > ....:
> > sage: parametric_plot([real(f(x,1)),imag(f(x,1))], -pi, pi)
> >
> >  Works as expected
> >
> > sage: parametric_plot([real(f(x,-1)),imag(f(x,-1))], -pi, pi)
> >
> >  Works as expected
> >
> > sage: parametric_plot([real(f(x,0)),imag(f(x,0))], -pi, pi)
> >
> >  Gives a page full of errors, which I interpret to mean that there
> >  was a problem plotting because imag(f(x,0)) evaluates to a constant.
> >
> > I believe that this is the same issue described in:
> >
> > http://trac.sagemath.org/sage_trac/ticket/2410
> >
> > But I'm not sure. I notice that:
> >
> > sage: type(imag(f(x,1)))
> > <class 'sage.calculus.calculus.SymbolicArithmetic'>
> >
> > and:
> >
> > sage: type(imag(f(x,0)))
> > <class 'sage.calculus.calculus.SymbolicConstant'>
> >
> > So, perhaps I could use this test (at least in this particular case) to
> > avoid calling parametric_plot and simply draw a line instead. But
> > I wonder if there is a more general strategy. For example, a single
> > test that will tell if a function if going to evaluate to any kind
> > of "constant" that plot or parametric_plot will have a problem with?
> >
> > I'm trying to be as clear as I can about this. I'm very new to Sage,
> > and I realize that I could be missing something obvious.
> >
> 
> Just out of curiosity, do you know Python?  If not,
> you might *greatly* benefit from learning Python, which
> is a pretty easy thing to do -- it takes a few hours to
> get up to speed with the basics and there are many
> good free resources online.
> 
> William

I've never really used Python, and if I actually decide to dump
Mathematica and go with Sage, it certainly sounds like learning
Python would be a good idea :-)  

I'm curious if you're asking this because the solution to my problem
would be obvious if I knew Python?  If so, could you possibly say a
little more?

-Mike


--~--~---------~--~----~------------~-------~--~----~
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-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to