[sage-support] Re: Plotting Python functions of two variables

2011-04-10 Thread Pierre
I realize that my 4th paragraph (specifically "the implicit replacement...") is not very truthful. It may be a good first explanation, but there's a more technical answer if you (or anyone) cares for one. when you try plot( foo, ...) then the first thing sage does is evaluate "foo" once. It has

[sage-support] Re: Plotting Python functions of two variables

2011-04-10 Thread Pierre
"lambda x : f(x)" should read "the function which maps x to f(x)". It has nothing to do with symbolic computations, and exists in Python. note that "lambda x : x^2" is exactly the same as "lambda y : y^2", which is mathematically very sound. Using the symbolic ring however, if x and y are formal v

[sage-support] Re: Plotting Python functions of two variables

2011-04-10 Thread ObsessiveMathsFreak
Partial seems useful, thank you. The Lambda solutions also work. But what IS lambda anyway? I don't see that its doing anything other than being syntactic verbose. On Apr 9, 7:24 am, Jason Grout wrote: > On 4/8/11 2:00 PM, John H Palmieri wrote: > > > > > > > On Friday, April 8, 2011 11:03:14 AM

[sage-support] Re: Plotting Python functions of two variables

2011-04-08 Thread Jason Grout
On 4/8/11 2:00 PM, John H Palmieri wrote: On Friday, April 8, 2011 11:03:14 AM UTC-7, ObsessiveMathsFreak wrote: I have a python type function taking two variables is defined in such a say that accidental evaluation is a possibility. Here is a simplified version def h(x,n):

[sage-support] Re: Plotting Python functions of two variables

2011-04-08 Thread John H Palmieri
On Friday, April 8, 2011 3:59:23 PM UTC-7, ObsessiveMathsFreak wrote: > > This notation isn't very flexible though. For example, suppose I > wanted to plot h(-x,n) over the same range. > > Can this be done without calling the symbolic engine? Is there a way > to bypass symbolic plots altogethe

[sage-support] Re: Plotting Python functions of two variables

2011-04-08 Thread Kelvin Li
> On Apr 8, 11:25 pm, John H Palmieri wrote: > > > On Friday, April 8, 2011 2:51:03 PM UTC-7, ObsessiveMathsFreak wrote: > > > > That worked, thank you. But I don't understand why the standard > > > notation has so many problems. What exactly is going wrong? > > > I think this is what's going on:

[sage-support] Re: Plotting Python functions of two variables

2011-04-08 Thread ObsessiveMathsFreak
This notation isn't very flexible though. For example, suppose I wanted to plot h(-x,n) over the same range. Can this be done without calling the symbolic engine? Is there a way to bypass symbolic plots altogether? On Apr 8, 11:25 pm, John H Palmieri wrote: > On Friday, April 8, 2011 2:51:03 PM

[sage-support] Re: Plotting Python functions of two variables

2011-04-08 Thread John H Palmieri
On Friday, April 8, 2011 2:51:03 PM UTC-7, ObsessiveMathsFreak wrote: > > That worked, thank you. But I don't understand why the standard > notation has so many problems. What exactly is going wrong? > I think this is what's going on: if you start with this: > > def h(x,n): > > >if x>2

[sage-support] Re: Plotting Python functions of two variables

2011-04-08 Thread ObsessiveMathsFreak
That worked, thank you. But I don't understand why the standard notation has so many problems. What exactly is going wrong? On Apr 8, 8:00 pm, John H Palmieri wrote: > On Friday, April 8, 2011 11:03:14 AM UTC-7, ObsessiveMathsFreak wrote: > > > I have a python type function taking two variables i

[sage-support] Re: Plotting Python functions of two variables

2011-04-08 Thread achrzesz
Or: sage: plot(lambda x: h(x,3), (x, 0, 4),exclude=[2]) On 8 Kwi, 21:00, John H Palmieri wrote: > On Friday, April 8, 2011 11:03:14 AM UTC-7, ObsessiveMathsFreak wrote: > > > I have a python type function taking two variables is defined in such > > a say that accidental evaluation is a possibili

[sage-support] Re: Plotting Python functions of two variables

2011-04-08 Thread John H Palmieri
On Friday, April 8, 2011 11:03:14 AM UTC-7, ObsessiveMathsFreak wrote: > > I have a python type function taking two variables is defined in such > a say that accidental evaluation is a possibility. Here is a > simplified version > > def h(x,n): >if x>2: >return n-x >