[sage-support] Re: failure to logging input
I have done that. This time I get the following message: -- | Sage Version 3.2.3, Release Date: 2009-01-05 | | Type notebook() for the GUI, and license() for information.| -- sage: load "last_session.py" Loading log file one line at a time... ERROR: File `/home/james/.sage/temp/ubuntu8/7753/_home_james__sage_init_sage_0.py` not found. Finished replaying log file The following lines/blocks in file reported errors: 'interact': 1, 'logfile': 'last_session.py', 'profile': ''}) ... and, next SAGE stops and I'm back to linux shell. Also, it shouldn't really matter what you call your log session... J From: sage-support@googlegroups.com [sage-supp...@googlegroups.com] On Behalf Of William Stein [wst...@gmail.com] Sent: 28 February 2009 06:13 To: sage-support@googlegroups.com; Fernando Perez Subject: [sage-support] Re: failure to logging input Hi, Name the log "last_session.py" then do load "last_session.py" and see what happens. The problem is that log is already "preparsed" (it's .py code not .sage code). William --~--~-~--~~~---~--~~ 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 this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] numerical_sqrt?
Hi, what is the use of this function? It seems equivalent to sqrt. Roland --~--~-~--~~~---~--~~ 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 this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] derivative
Hello Another problem: I want the derivative for the function arccos((1-x^2)/(1+x^2)) I wrote: f=arccos((1-x^2)/(1+x^2)) f.diff(x) -(-2*x/(x^2 + 1) - 2*x*(1 - x^2)/(x^2 + 1)^2)/sqrt(1 - (1 - x^2)^2/ (x^2 + 1)^2) The best answer would be: 2/(1+x^2)*sign(x) How can I simplify this expression to get this answer? Best Loïc --~--~-~--~~~---~--~~ 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 this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] simplify arctan
Hello arctan(2)+arctan(5)+arctan(8)=5*pi/4. How can I simplify arctan(2)+arctan(5)+arctan(8) to get this value? Thanks in advance Loïc --~--~-~--~~~---~--~~ 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 this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: derivative
This works: f=arccos((1-x^2)/(1+x^2)) g=f.diff(x) g.simplify_full() 2*x/((x^2 + 1)*abs(x)) In general: type g. TAB and you will find all kind of handy functions. Roland On 28 feb, 10:58, Loïc wrote: > Hello > > Another problem: > I want the derivative for the function arccos((1-x^2)/(1+x^2)) > > I wrote: > > f=arccos((1-x^2)/(1+x^2)) > f.diff(x) > -(-2*x/(x^2 + 1) - 2*x*(1 - x^2)/(x^2 + 1)^2)/sqrt(1 - (1 - x^2)^2/ > (x^2 + 1)^2) > > The best answer would be: > 2/(1+x^2)*sign(x) > > How can I simplify this expression to get this answer? > > Best > > Loïc --~--~-~--~~~---~--~~ 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 this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: derivative
Thank you very much ! Loïc Le samedi 28 février 2009 à 02:37 -0800, Rolandb a écrit : > This works: > > f=arccos((1-x^2)/(1+x^2)) > g=f.diff(x) > g.simplify_full() > 2*x/((x^2 + 1)*abs(x)) > > In general: type g. TAB and you will find all kind of handy functions. > > Roland > > On 28 feb, 10:58, Loïc wrote: > > Hello > > > > Another problem: > > I want the derivative for the function arccos((1-x^2)/(1+x^2)) > > > > I wrote: > > > > f=arccos((1-x^2)/(1+x^2)) > > f.diff(x) > > -(-2*x/(x^2 + 1) - 2*x*(1 - x^2)/(x^2 + 1)^2)/sqrt(1 - (1 - x^2)^2/ > > (x^2 + 1)^2) > > > > The best answer would be: > > 2/(1+x^2)*sign(x) > > > > How can I simplify this expression to get this answer? > > > > Best > > > > Loïc > > > --~--~-~--~~~---~--~~ 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 this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: failure to logging input
On Sat, Feb 28, 2009 at 3:06 AM, Foadi, James wrote: > > I have done that. > This time I get the following message: I have to say that logging in Sage was as far as I know never designed to be something you could just read back in like you're trying to do. You might want to look into sage_session and load_session. William > > > -- > | Sage Version 3.2.3, Release Date: 2009-01-05 | > | Type notebook() for the GUI, and license() for information. | > -- > sage: load "last_session.py" > Loading log file one line at a time... > ERROR: File > `/home/james/.sage/temp/ubuntu8/7753/_home_james__sage_init_sage_0.py` not > found. > Finished replaying log file > > The following lines/blocks in file reported errors: > 'interact': 1, > 'logfile': 'last_session.py', > 'profile': ''}) > > > > > ... and, next SAGE stops and I'm back to linux shell. > Also, it shouldn't really matter what you call your log session... > > > J > > From: sage-support@googlegroups.com [sage-supp...@googlegroups.com] On Behalf > Of William Stein [wst...@gmail.com] > Sent: 28 February 2009 06:13 > To: sage-support@googlegroups.com; Fernando Perez > Subject: [sage-support] Re: failure to logging input > > Hi, > > Name the log "last_session.py" then do > > load "last_session.py" > > and see what happens. > > The problem is that log is already "preparsed" (it's .py code not .sage code). > > William > > > -- William Stein Associate Professor of Mathematics University of Washington http://wstein.org --~--~-~--~~~---~--~~ 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 this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: ideals of points
That works. Thanks! Dave On Feb 26, 5:31 pm, Alex Raichev wrote: > Hi Dave: > > I'm also just learning the basics of interacting with Singular through > Sage. So probably someone else on the list can answer your question > better than me. Still, i'll take a stab at it. > > Carrying on with your/Singular's notation, try > > sage: singular.setring(AC) > sage: sol= singular('SOL').sage_structured_str_list() > > to save the output of SOL as a structured list of Sage strings. (I > found this command by typing help(sage.interfaces.singular) and > browsing the documentation page that popped up.) Now all you have to > do is convert those Sage strings to Sage numbers with the eval() > command. For instance, > > sage: a= eval(sol[1][1][1][1]) > > Does that work? > > Alex > > P.S. I'll be jumping for joy if/when the Singular people fix the bug > that's breaking the potentially super-useful variety() command. > > On Feb 27, 5:54 am,davidp wrote: > > > Thanks for your response. I tried what you suggested and got the > > error you anticipated. So it looks like I need to work within > > Singular. The relevant page at the Singular site: > > >http://www.singular.uni-kl.de/Manual/latest/sing_1168.htm#SEC1227 > > > Using the notation from the site just referenced, I end up with a > > ring, AC, in which the solutions are supposed to be stored in 'SOL'. > > I can execute singular.setring(AC), but cannot subsequently access the > > solutions. > > > Thanks, > > Dave > > > On Feb 25, 1:49 pm, Alex Raichev wrote: > > > > Hi Dave: > > > > Once you have your zero-dimensional ideal K within a Sage ring, you > > > could try the variety() command > > > > K.variety(ring=QQbar) or > > > K.variety(ring=CC) > > > > to get its solutions as algebraic numbers or complex floating point > > > numbers, respectively. See 'variety()' under > > > >http://www.sagemath.org/doc/ref/module-sage.rings.polynomial.multi-po... > > > > for more details. Problem is, variety() sometimes > > > fails:http://sagetrac.org/sage_trac/ticket/4622. > > > > Alex > > > > On Feb 25, 7:27 am,davidp wrote: > > > > > Hi, > > > > > I have the following homogeneous Singular ideal defining a finite set > > > > of points in projective space. I would like to get numerical > > > > approximations for these points. > > > > > sage: S.ring() > > > > > // characteristic : 0 > > > > // number of vars : 4 > > > > // block 1 : ordering dp > > > > // : names x_3 x_2 x_1 x_0 > > > > // block 2 : ordering C > > > > sage: S.ideal() > > > > > x_1^3-x_3*x_2*x_0, > > > > x_3*x_2*x_1-x_0^3, > > > > x_2^3-x_3*x_1*x_0, > > > > x_3^3-x_2*x_1*x_0, > > > > x_2^2*x_1^2-x_3^2*x_0^2, > > > > x_3^2*x_1^2-x_2^2*x_0^2, > > > > x_3^2*x_2^2-x_1^2*x_0^2 > > > > sage: type(S.ideal()) > > > > > > > > > One way to go might be to map to a new ring, setting x_0 = 1, then use > > > > the nice Singular algorithm for finding the solutions: > > > > >http://www.singular.uni-kl.de/Manual/3-0-4/sing_582.htm > > > > > I couldn't figure out how to get the Singular "map" function to work > > > > with Sage, so I just converted equations using string commands (saved > > > > in "y" in the following code) then tried: > > > > > sage: R = singular.ring(0,'(x_3,x_2,x_1)','lp') > > > > sage: J = singular.ideal(y) > > > > sage: J > > > > > -x_3*x_2+x_1^3, > > > > x_3*x_2*x_1-1, > > > > -x_3*x_1+x_2^3, > > > > x_3^3-x_2*x_1, > > > > -x_3^2+x_2^2*x_1^2, > > > > x_3^2*x_1^2-x_2^2, > > > > x_3^2*x_2^2-x_1^2 > > > > sage: K = J.groebner() > > > > sage: M = K.solve(10,1) > > > > > I'm not sure where to go from there. Of course, I might be taking the > > > > wrong approach altogether. > > > > > Any advice would be appreciated. > > > > > Thanks, > > > > Dave --~--~-~--~~~---~--~~ 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 this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: numerical_sqrt?
It's from the days before sqrt accepted a precision parameter. Should almost certainly be deprecated. Also, one has the oddness that sage: numerical_sqrt(3) sqrt(3) http://trac.sagemath.org/sage_trac/ticket/5404 - Robert On Feb 28, 2009, at 1:06 AM, Rolandb wrote: > > Hi, what is the use of this function? It seems equivalent to sqrt. > Roland > > --~--~-~--~~~---~--~~ 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 this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---