On 07/26/2012 10:50 PM, Anthony Wickstead wrote:
Earlier post sent prematurely by acciident, sorry!On Thursday, July 26, 2012 3:47:34 PM UTC+1, Anthony Wickstead wrote: I don't think I am doing anything stupid, but I am fairly new to Sage. I am using Sage 5.0 (Ubuntu 12.04 64 bit, running under Virtualbox) but the same behaviour occurs with Sage 4.7 running under Debian (not sure of version). I am trying to plot the graph of h(a,x) fo a range of values of a. def h(a,x): if x<=a: return 2-sqrt(1-(1-x/a)^4) else: return sqrt(1-((x-a)/(2-a))^6) plot(sqrt(x),(x,0,1)) #Works fine [h(.5,x) for x in [0..2,step=.1]] #Returns plausible looking list plot(h(.5,x),(x,0,2)) #shows a horizontal straight line graph (approximately zero)
This is not the right way to plot h(.5,x). You should use it like this (at least on the command line or notebook cell):
g(x) = h(.5,x) plot(g(x), (x,0,1))
plot(sqrt(x),(x,0,1) #another straight line, approximately sqrt(2)
I get the correct plot of sqrt with this, as long as I use g(x).
Is this a weird bug or am I doing something wrong? Tony Wickstead -- -- To post to this group, send an email to [email protected] To unsubscribe from this group, send an email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org
-- -- To post to this group, send an email to [email protected] To unsubscribe from this group, send an email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org
