[sage-support] Re: Wrong limit

2008-11-12 Thread mabshoff
On Nov 11, 2:38 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On 11 Lis, 22:21, Robert Samal [EMAIL PROTECTED] wrote: Hi, Hi Minh, I think this issue has been fixed in sage-3.1.4. Under sage-3.1.4, the command sage: lim ( x*(sqrt(x^2)-sqrt(x))/sqrt(x^2 -x), x=oo) +Infinity

[sage-support] taking functions as arguments

2008-11-12 Thread pong
I defined a function which show the shaded area between the graphs of two functions over an interval (maybe such function already exist?). For example, plot_shaded_area(sin(x), cos(x), 1,2) show the shaded area between sine and cosine over [1,2]. Well, my script doesn't work if I change cos(x)

[sage-support] Re: taking functions as arguments

2008-11-12 Thread Jason Grout
pong wrote: I defined a function which show the shaded area between the graphs of two functions over an interval (maybe such function already exist?). For example, plot_shaded_area(sin(x), cos(x), 1,2) show the shaded area between sine and cosine over [1,2]. Well, my script doesn't work

[sage-support] Re: Computing a sum

2008-11-12 Thread Ondrej Certik
On Tue, Nov 11, 2008 at 3:15 AM, cesarnda [EMAIL PROTECTED] wrote: that is the output I was expecting, but it is not the input I gave. Obviously, 1/x - 1/(x+1) = 1/(x*(x+1)) but, if the right hand side can be done why the left hand side can't? This is the bug I was talking about... It

[sage-support] Re: How do you plot equations if one parameter is a list of values ?

2008-11-12 Thread kex
Thank you very much Stan, this was helpfull I have more questions, I get this message: verbose 0 (3605: plot.py, _plot) WARNING: When plotting, failed to evaluate function at 200 points. verbose 0 (3605: plot.py, _plot) Last error message: '' Why does it fail to evaluate ? my datasheet:

[sage-support] Re: Computing a sum

2008-11-12 Thread Robert Dodier
On Nov 10, 7:15 pm, cesarnda [EMAIL PROTECTED] wrote: that is the output I was expecting, but it is not the input I gave. Obviously, 1/x - 1/(x+1) = 1/(x*(x+1)) but, if the right hand side can be done why the left hand side can't? This is the bug I was talking about... Thanks for pointing

[sage-support] Re: Drawing points on a sphere

2008-11-12 Thread acardh
I change the sequence of dots to size=2 and now the line looks better. world + sum([point3d(v, color='red') for v in city_coords]) + sum ([point3d(v, size=2, color='green') for v in mydots]) The parametric_plot3d command seems a better way to do this but I am not sure yet how to use it. I am

[sage-support] Re: taking functions as arguments

2008-11-12 Thread pong
Here is my script def shaded_area_plot(f,g,c,d,a,b): step = 0.01 vf = [(x,f(x)) for x in srange(a, (b+step), step)] vg = [(x,g(x)) for x in srange(b, (a-step), -step)] sha = polygon(vf + vg, rgbcolor='grey') return(plot(f, (c,d)) + plot(g, (c,d), rgbcolor='red') + sha) Most

[sage-support] Re: taking functions as arguments

2008-11-12 Thread Jason Grout
pong wrote: Here is my script def shaded_area_plot(f,g,c,d,a,b): step = 0.01 from sage.ext.fast_eval import fast_float f = fast_float(f) g = fast_float(g) vf = [(x,f(x)) for x in srange(a, (b+step), step)] vg = [(x,g(x)) for x in srange(b, (a-step), -step)] sha =

[sage-support] When to use fast_float

2008-11-12 Thread kcrisman
put those three lines in where indicated and it will be orders of magnitude faster for most cases, plus will handle constants, lambda functions, etc., automatically. fast_float is one of Sage's coolest secrets. That brings up a question I've had for a while. When is it good to use

[sage-support] Re: How do you plot equations if one parameter is a list of values ?

2008-11-12 Thread Robert Bradshaw
If one does sage: Ii.subs(pars).variables() (x,) so that is fine. However, sage: RR(Ii.subs(pars)(x=-10)) Traceback (most recent call last): ... TypeError which tells you what the error is (not very helpful in this case). On a hunch sage: CC(Ii.subs(pars)(x=-10)) 2.59329101030962e-14*I so

[sage-support] Re: When to use fast_float

2008-11-12 Thread Robert Bradshaw
On Nov 12, 2008, at 5:52 PM, kcrisman wrote: put those three lines in where indicated and it will be orders of magnitude faster for most cases, plus will handle constants, lambda functions, etc., automatically. fast_float is one of Sage's coolest secrets. Thanks :) That brings up a