Re: [sage-support] Re: Gap does not seem to work correctly inside Sage! Help!
On Jun 29, 2012, at 11:03 PM, Walter Carlip wrote: > Okay, using the init.sage file with "gap._eval_using_file_cutoff = 10" > seems to work now. Thanks. > > Have a new question, which should perhaps go somewhere else, but I'll try > asking here. When I execute > the gap command "SaveWorkspace("MyWorkspace");" in a sage notebook, I get the > reply "true". But > where does this workspace get stored? If I give a full path, I can find the > file, but can't find it otherwise. It's in a temporary directory, e.g. for me it was /private/var/folders/dc/dcWBTFsQGHan33Mnxx-plE+++TI/-Tmp-/tmpLQ2ceA I found this out by running str := ""; strStream := OutputTextString(str,true); Process( DirectoryCurrent(),"/bin/sh", InputTextNone(),strStream, ["-c","echo $PWD"] ); CloseStream(strStream); str; since I couldn't figure out how to get DirectoryCurrent() to give me the full path to the directory. -Ivan -- 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 URL: http://www.sagemath.org
Re: [sage-support] Re: Gap does not seem to work correctly inside Sage! Help!
Just tried this on my laptop at home. It did give back an interesting path, including rather rudely named directories beginning with "-" characters. However, no file with the name I gave to the workspace appeared there. -- 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 URL: http://www.sagemath.org
Re: [sage-support] Re: Gap does not seem to work correctly inside Sage! Help!
Okay, nevermind. Found it. Now worried, however, that students may need to save more than their .sage subdirectory between sessions. As a backup, would be nice to save workspaces in a place that is accessible for saving and restoring. On Saturday, June 30, 2012 11:43:12 AM UTC-5, Walter Carlip wrote: > > Just tried this on my laptop at home. It did give back an interesting > path, including rather rudely > named directories beginning with "-" characters. However, no file with > the name I gave to the > workspace appeared there. > -- 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 URL: http://www.sagemath.org
[sage-support] Re: Multiplicity of roots nummerical
But this is a rather fragile concept: see http://whww.sagenb.org/home/pub/4840 http://www.sagenb.org/home/pub/4840 If you can't, expand f below as x^2-2*x+1 then try perturbing the +1 term, e.g. +1+10^(-20). What you really need in the approximate square-free decomposition of f: see, e.g. Chin,P., Corless,R.M. & Corliss,G.F., Optimization Strategies for Floating-Point GCD. Proc. ISSAC '98 (ed. O.Gloor), ACM, New York, 1998, pp. 228-235. Nagasaka,K., Approximate polynomial GCD over integers. J. Symbolic Comp. 46(2011) pp. 1306-1317. On Friday, 29 June 2012 11:46:25 UTC+1, achrzesz wrote: > > Notice that roots gives you the multiplicity > > sage: f=(x-1)^2 > sage: f.roots(ring=RealField()) > [(1.00, 2)] > sage: f=x^3-x-1 > sage: f.roots(ring=RealField()) > [(1.32471795724475, 1)] > sage: f.roots(ring=RDF) > [(1.32471795724, 1)] > sage: f.roots(ring=CDF) > [(-0.662358978622 - 0.562279512062*I, 1), > (-0.662358978622 + 0.562279512062*I, 1), > (1.32471795724 - 1.11022302463e-16*I, 1)] > > On Friday, June 29, 2012 11:57:33 AM UTC+2, Noud wrote: >> >> Hi, >> >> I have some polynomials over the RealField() and I would like to find the >> approximate roots of the polynomials numerical. This is not really a >> problem, sicne find_root does a good job finding these. But now I also want >> to know the (approximate) multiplicity of these roots. Is it possible to do >> this numerically? I would guess that you cannot use the GCD algorithm on >> this one. I already know that the zeros of these polynomials are not >> algebraic over the rationals. >> >> Best regards, >> Noud >> > -- 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 URL: http://www.sagemath.org
[sage-support] Issues with adding color to plots.
Hi, I am having issues with adding color to plots. Code: a = [i/pi for i in range(79)] p1 = plot([circle((-sin(i),cos(i)),1, edgecolor = colors[i]) for i in a]) p2 = plot([circle((sin(i),-cos(i)),1, edgecolor = colors[i]) for i in a]) p3 = p1 + p2 show(p3, aspect_ratio = 1, axes = False) error: --- TypeError Traceback (most recent call last) /home/nooniensoong97/ in () /home/nooniensoong97/programs/sage-4.7.2-linux-32bit-ubuntu_10.04_lts-i686-Linux/local/lib/python2.6/site-packages/sage/symbolic/expression.so in sage.symbolic.expression.Expression.__index__ (sage/symbolic/expression.cpp:17306)() /home/nooniensoong97/programs/sage-4.7.2-linux-32bit-ubuntu_10.04_lts-i686-Linux/local/lib/python2.6/site-packages/sage/symbolic/expression.so in sage.symbolic.expression.Expression._integer_ (sage/symbolic/expression.cpp:4400)() TypeError: unable to convert x (=1/pi) to an integer -- 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 URL: http://www.sagemath.org
[sage-support] Re: Issues with adding color to plots.
a = [i/pi for i in range(79)] colors = rainbow(len(a)) p1 = plot([circle((-sin(i),cos(i)),1, edgecolor = colors[i]) for i in a]) p2 = plot([circle((sin(i),-cos(i)),1, edgecolor = colors[i]) for i in a]) p3 = p1 + p2 show(p3, aspect_ratio = 1, axes = False) -- 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 URL: http://www.sagemath.org
[sage-support] Re: Issues with adding color to plots.
What you wanted was very beautiful, I like it very much. a = [j/pi for j in range(79)] colors = rainbow(len(a)) p1 = plot([circle((-sin(a[i]),cos(a[i])),1, edgecolor = colors[i]) for i in range(len(a))]) p2 = plot([circle((sin(a[i]),-cos(a[i])),1, edgecolor = colors[i]) for i in range(len(a))]) p3 = p1 + p2 show(p3, aspect_ratio = 1, axes = False) Note how this version doesn't give a possible problem with two different "i"s, and doesn't attempt to use the elements of the list as indices for the list. There are some really good Python tutorials out there which will help get used to these subtleties - I like http://www.greenteapress.com/thinkpython/ though others will have their favorites. Good luck! - kcrisman On Saturday, June 30, 2012 6:43:40 PM UTC-4, Eric Kangas wrote: > > > > a = [i/pi for i in range(79)] > > colors = rainbow(len(a)) > > p1 = plot([circle((-sin(i),cos(i)),1, edgecolor = colors[i]) for i in a]) > > p2 = plot([circle((sin(i),-cos(i)),1, edgecolor = colors[i]) for i in a]) > > p3 = p1 + p2 > > show(p3, aspect_ratio = 1, axes = False) > > -- 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 URL: http://www.sagemath.org
[sage-support] Question
Dears members, How I will can get the coefficients list in Fraction Field. When I write p.lis() i obtained this message: 'FractionFieldElement_1poly_field' object has no attribute 'list' -- - MSc. Juan del Carmen Grados Vásquez Laboratório Nacional de Computação Científica Tel: +55 24 2233-6260 (http://www.lncc.br/) http://juaninf.blogspot.com - -- 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 URL: http://www.sagemath.org
[sage-support] Fraction Fields coefficients
Dears members, How I will can get the coefficients list in Fraction Field. When I write p.lis() i obtained this message: 'FractionFieldElement_1poly_field' object has no attribute 'list' -- 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 URL: http://www.sagemath.org
Re: [sage-support] Fraction Fields coefficients
Perhaps your looking for something like sage: R. = QQ[] sage: f = 2 * x^2 / (x^3 + 5); f 2*x^2/(x^3 + 5) sage: f.numerator().list() [0, 0, 2] sage: f.denominator().list() [5, 0, 0, 1] On Sat, Jun 30, 2012 at 8:26 PM, juaninf wrote: > Dears members, > > How I will can get the coefficients list in Fraction Field. When I write > p.lis() i obtained this message: > > 'FractionFieldElement_1poly_field' object has no attribute 'list' > > -- > 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 > URL: http://www.sagemath.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 URL: http://www.sagemath.org