[sage-devel] Re: plot3d problem - stalled in maxima

2008-12-01 Thread Jason Grout

David Joyner wrote:
 Since
 
 sage: x,y = var(x y)
 sage: plot3d(x^2-y^2, (x,-1,1),(y,-1,1))
 
 works fine, why not just use variables
 
 sage: f = x^2-y^2
 sage: f.variables()
 (x, y)
 
 to find the missing variables in plot3d(x^2-y^2, (-1,1),(-1,1))
 and then replace the arguments (-1,1),(-1,1) by
 (x,-1,1),(y,-1,1) in plot3d.parametric_plot3d?


Please use f.arguments() instead of f.variables().  The difference 
is illustrated below:

sage: var(x,y)
(x, y)
sage: f(x,y) = x
sage: f.variables()
(x,)
sage: f.arguments()
(x, y)

In this case, using variables won't work since only one thing is 
passed back, but using arguments does work, since the function was 
defined as taking two inputs.

Jason


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: plot3d problem - stalled in maxima

2008-12-01 Thread Jason Grout

Jason Grout wrote:
 David Joyner wrote:
 Since

 sage: x,y = var(x y)
 sage: plot3d(x^2-y^2, (x,-1,1),(y,-1,1))

 works fine, why not just use variables

 sage: f = x^2-y^2
 sage: f.variables()
 (x, y)

 to find the missing variables in plot3d(x^2-y^2, (-1,1),(-1,1))
 and then replace the arguments (-1,1),(-1,1) by
 (x,-1,1),(y,-1,1) in plot3d.parametric_plot3d?
 
 
 Please use f.arguments() instead of f.variables().  The difference 
 is illustrated below:
 
 sage: var(x,y)
 (x, y)
 sage: f(x,y) = x
 sage: f.variables()
 (x,)
 sage: f.arguments()
 (x, y)
 
 In this case, using variables won't work since only one thing is 
 passed back, but using arguments does work, since the function was 
 defined as taking two inputs.


I should note that I'm not commenting on the original problem, just 
commenting on using .arguments() versus using .variables()

Jason


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: plot3d problem - stalled in maxima

2008-11-30 Thread David Joyner

Since

sage: x,y = var(x y)
sage: plot3d(x^2-y^2, (x,-1,1),(y,-1,1))

works fine, why not just use variables

sage: f = x^2-y^2
sage: f.variables()
(x, y)

to find the missing variables in plot3d(x^2-y^2, (-1,1),(-1,1))
and then replace the arguments (-1,1),(-1,1) by
(x,-1,1),(y,-1,1) in plot3d.parametric_plot3d?

Am I missing something?


On Sun, Nov 30, 2008 at 11:35 AM, mikeslov [EMAIL PROTECTED] wrote:

 I saw similar tickets, now closed, but the problem remains in version
 3.2:

 x,y=var(x y)

 plot3d(x^2-y^2, (-1,1),(-1,1))

 There must be something wrong in the function
 sage.plot.plot3d.parametric_plot3d.adapt_to_callable

 My crude fix was:

try:
try:
if len(f):
s = sum(f) # get common universe
except TypeError:
s=f

 instead of original code at the beginning of mentioned function:

try:
s = sum(f) # get common universe
...

 I know, this is probably not the right fix, but maybe, it can drive
 someone with deeper knowledge of code in the right direction.

 Michal

 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---