On 08/21/2008 12:18:26 PM, David Joyner wrote: > > On Thu, Aug 21, 2008 at 1:58 PM, Mike Witt <[EMAIL PROTECTED]> wrote: > > > > This is an attempt to ask my previous question more clearly :-) > > I *conjecture* (and definitely could be wrong) that your problem is related > to the issue that Sage can plot symbolic functions but constants (rather, > numerical constants which have not been coerced to the symbolic expression > ring) don't mix well with symbolic expressions. I think this will be fixed > soon > but don't know what, if any, active trac tickets are related to this. You > might > try coercing the expressions to the symbolic expression ring (type > ?SR for details), assuming the above conjecture is roughly correct.
I *think* that's correct. Is it not this ticket? http://trac.sagemath.org/sage_trac/ticket/2410 If it's going be fixed soon, then I might not want to spend too much time on a work around. I will look into coercing the expressions, as you mentioned. I'm sorry that I don't seem to be able to explain this in an understandable way. I'm not quite sure what I'm doing wrong (in my explanation). > > 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. > > > > -Mike > > > > > > > > > > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---