Oscar Lazo wrote:
On 6 ene, 12:23, Jason Grout <jason-s...@creativetrax.com> wrote:
That was an intentionally simple example to illustrate the problem.
Here's something that is more nontrivial:
def f(x,y):
    if x>pi:
       return y
    else:
       return -y

spherical_plot3d(f, (x,0,2*pi), (y,0,pi))

I have no idea how to make that work. Functions defined by parts are
surely somthing we'd want. The problem, as i've said is that sage
cannot
 multiply functions andsage expressions. That is something better
suited
 for more experienced sage programmers than myself...


The code I posted up (based on your original code) at http://sagenb.org/home/pub/1322/ handles this correctly (I think) if you manually define the f_is_expression to be False at the top of the function. Somewhere, there's a nice way to see if f is a symbolic expression---that test should be done where we now manually set that variable. On the other hand, maybe we could just try executing the first block of code, and make an "except" statement if there is an error that runs the second block of code.

Thanks,

Jason

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to