Re: [sage-support] Unable to Solve Simple Problem

2011-04-10 Thread ancienthart
I think sage solving is based on maxima, and I've noticed that Maxima has always had this problem with non-linear equations. If you set it up as follows: eq = x == sqrt(1 + x) solns = solve(eq^2,x); solns You will get: [x == -1/2*sqrt(5) + 1/2, x == 1/2*sqrt(5) + 1/2] Of course, then you have

[sage-support] Re: Unable to Solve Simple Problem

2011-04-10 Thread The_Fool
Unfortunately, that method could produce extraneous solutions. There is an additional constraint from the original equation that x=0 since the square root of something must be =0 (no complex number is a solution, either). That is missing from x^2-x-1=0. Is there a way to make Sage check it

[sage-support] Re: Unable to Solve Simple Problem

2011-04-10 Thread ancienthart
Which is why I did the sanity checking in the last step. I admit n( ) on lhs() and rhs() is ugly, but I'm sure others could suggest ways to check for equality in an equation. On the other hand, you didn't mention in the original problem that x had to be in the reals. :D Joal Heagney -- To

Re: [sage-support] Sage Scripts

2011-04-10 Thread Justin C. Walker
On Apr 9, 2011, at 22:23 , nkulmati wrote: Hi All, I am a newbie to Sage. My main purpose is to write scripts (algorithms). That is, I am not interested in the answer-question approach of the notebook, but I want to write and execute .sage files using sage just as I do with .m files using

[sage-support] Re: Unable to Solve Simple Problem

2011-04-10 Thread ancienthart
Here's a one-liner to filter the solutions: filter((lambda x: n(eq.subs(x).lhs()) == n(eq.subs(x).rhs())),solns -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit

[sage-support] Re: Unable to Solve Simple Problem

2011-04-10 Thread ancienthart
Here's a one liner to filter the solutions. filter((lambda x: n(eq.subs(x).lhs()) == n(eq.subs(x).rhs())),solns) -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit

[sage-support] Re: Unable to Solve Simple Problem

2011-04-10 Thread achrzesz
sage: solve(x==sqrt(x+1),x,to_poly_solve='force') [x == 1/2*sqrt(5) + 1/2] On 10 Kwi, 09:01, ancienthart joalheag...@gmail.com wrote: Here's a one liner to filter the solutions. filter((lambda x: n(eq.subs(x).lhs()) == n(eq.subs(x).rhs())),solns) -- To post to this group, send email to

[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 jason-s...@creativetrax.com wrote: On 4/8/11 2:00 PM, John H Palmieri wrote: On Friday, April

[sage-support] Using scipy special functions

2011-04-10 Thread ObsessiveMathsFreak
I'm completely unable to get the scipy special functions module to work. In addition, it seems to cause chaos on my system once imported sage: import scipy sage: from scipy.special import * sage: scipy.special.lpn(1,1) ---

[sage-support] Re: Saving/Showing large animation consumes vast resources

2011-04-10 Thread Marshall Hampton
Thanks. Does this just slow things down, or does it change the output? There are at least three alternatives to imagemagick. One is to use javascript to animate frames; the result wouldn't be saveable though. There's a 2-year-old ticket for this that no one ever got quite right:

Re: [sage-support] Using scipy special functions

2011-04-10 Thread D. S. McNeil
I'm completely unable to get the scipy special functions module to work. In addition, it seems to cause chaos on my system once imported sage: import scipy sage: from scipy.special import * sage: scipy.special.lpn(1,1) I'd avoid your second line in Sage, which pulls everything in

[sage-support] Root locus plots

2011-04-10 Thread Michel
Hi, I wonder if it is possible to do root locus plots in sage? The root locus plot of a complex function is basically the zero locus of the imaginary part but it should be equipped with various markings. Regards, Michel -- To post to this group, send email to sage-support@googlegroups.com To

[sage-support] Re: Saving/Showing large animation consumes vast resources

2011-04-10 Thread John H Palmieri
On Sunday, April 10, 2011 6:36:08 AM UTC-7, Marshall Hampton wrote: Finally, what I do currently is to use ffmpeg. Because of patent and license issues I think this cannot be part of the standard Sage, but it does a great job and is very flexible. For larger movies this is crucial,

[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

[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 to

[sage-support] Re: Using scipy special functions

2011-04-10 Thread ObsessiveMathsFreak
Ugghh It looks like scipy wasn't quite what I was looking for. All I really need is a way of evaluating generalised legendre functions of the first and second kind. I've actually found a package in sympy that does this

[sage-support] Re: Using scipy special functions

2011-04-10 Thread achrzesz
If numerical tools are sufficient then: sage: from mpmath import * sage: mp.dps = 15; mp.pretty = True sage: legendre(1,0.5) 0.5 sage: legenq(1,0,0.5) -0.725346927832973 On 10 Kwi, 20:17, ObsessiveMathsFreak obsessivemathsfr...@gmail.com wrote: Ugghh It looks like scipy wasn't quite what I

Re: [sage-support] Re: Using scipy special functions

2011-04-10 Thread William Stein
On Sun, Apr 10, 2011 at 11:17 AM, ObsessiveMathsFreak obsessivemathsfr...@gmail.com wrote: Ugghh It looks like scipy wasn't quite what I was looking for. All I really need is a way of evaluating generalised legendre functions of the first and second kind. I've actually found a package in

[sage-support] Re: Using scipy special functions

2011-04-10 Thread achrzesz
Or: sage: import scipy.special sage: scipy.special.legendre(1,0.5) poly1d([ 1., 0.]) sage: scipy.special.lqn(int(1),float(0.5)) (array([ 0.54930614, -0.72534693]), array([ 1., 1.21597281])) On 10 Kwi, 20:17, ObsessiveMathsFreak obsessivemathsfr...@gmail.com wrote: Ugghh It looks

[sage-support] memory error

2011-04-10 Thread Foad Khoshnam
Hi I don't know why the function A=H.point() at the followe program for the finite field with size 101^5 don't work. But for the finite field with size 101^2 it work. sage: k.x=GF(101^5,'x'); sage: x=polygen(k); sage: H = HyperellipticCurve(x^5 + 12*x^4 + 13*x^3 + 15*x^2 + 33*x); sage: J =

[sage-support] memory error

2011-04-10 Thread Foad Khoshnam
Hi I don't know why the function A=H.point() at the followe program for the finite field with size 101^5 don't work. But for the finite field with size 101^2 there is no problem. sage: k.x=GF(101^5,'x'); sage: x=polygen(k); sage: H = HyperellipticCurve(x^5 + 12*x^4 + 13*x^3 + 15*x^2 + 33*x);

[sage-support] Re: Using scipy special functions

2011-04-10 Thread achrzesz
Or simply legendre_P, legendre_Q On 10 Kwi, 21:26, achrzesz achrz...@wp.pl wrote: Or: sage: import scipy.special sage: scipy.special.legendre(1,0.5) poly1d([ 1.,  0.]) sage: scipy.special.lqn(int(1),float(0.5)) (array([ 0.54930614, -0.72534693]), array([ 1.,  1.21597281])) On 10

Re: [sage-support] memory error

2011-04-10 Thread Justin C. Walker
On Apr 10, 2011, at 12:35 , Foad Khoshnam wrote: Hi I don't know why the function A=H.point() at the followe program for the finite field with size 101^5 don't work. But for the finite field with size 101^2 it work. Could you be a little more specific? it doesn't work is not a lot to go on

[sage-support] Re: Saving/Showing large animation consumes vast resources

2011-04-10 Thread ObsessiveMathsFreak
On Apr 10, 4:46 pm, John H Palmieri jhpalmier...@gmail.com wrote: On Sunday, April 10, 2011 6:36:08 AM UTC-7, Marshall Hampton wrote: Finally, what I do currently is to use ffmpeg.  Because of patent and license issues I think this cannot be part of the standard Sage, but it does a great

[sage-support] Re: Using scipy special functions

2011-04-10 Thread ObsessiveMathsFreak
The mpmath import seems to work, but I am unable to plot the resulting functions. I get an error about too many values to unpack. from mpmath import * plot(lambda x: legenp(1,0,x),(x,-1,1)) Traceback (click to the left of this block for traceback) ... ValueError: too many values to unpack On

[sage-support] Re: Using scipy special functions

2011-04-10 Thread achrzesz
Workaround: list_plot([(x,legenp(2,0,x)) for x in srange(-1,1,0.1)],plotjoined=True) On 10 Kwi, 23:47, ObsessiveMathsFreak obsessivemathsfr...@gmail.com wrote: The mpmath import seems to work, but I am unable to plot the resulting functions. I get an error about too many values to unpack. from

[sage-support] Re: Saving/Showing large animation consumes vast resources

2011-04-10 Thread John H Palmieri
On Sunday, April 10, 2011 8:46:51 AM UTC-7, John H Palmieri wrote: On Sunday, April 10, 2011 6:36:08 AM UTC-7, Marshall Hampton wrote: Finally, what I do currently is to use ffmpeg. Because of patent and license issues I think this cannot be part of the standard Sage, but it does a