[sage-support] Re: [sage-announce] Sage 3.3 released
Hi folks, On Sun, Feb 22, 2009 at 7:23 PM, mabshoff michael.absh...@mathematik.uni-dortmund.de wrote: [...] For all the details of what else changed in Sage 3.3 please see the release tour in the Sage wiki at http://wiki.sagemath.org/sage-3.3 And here's a nicely formatted version of the release tour: http://mvngu.wordpress.com/2009/02/23/sage-33-released -- Regards Minh Van Nguyen --~--~-~--~~~---~--~~ 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: Sage 3.3 released
On Feb 23, 2:07 am, Minh Nguyen nguyenmi...@gmail.com wrote: Hi Paul, On Mon, Feb 23, 2009 at 9:58 AM, Paul Zimmermann paul.zimmerm...@loria.fr wrote: And here's a nicely formatted version of the release tour: http://mvngu.wordpress.com/2009/02/23/sage-33-released this is very nice! I wonder how much time it took you to write this page. Indeed, I am extremely happy with the results :). The release tour is something that due to other things to do has always been something where I wanted to improve what I did pre-Minh, but never got around to it. Given that this is very much the first stop for people to check what happened in the release it cannot be overemphasized how important this page is. And it will become ever more important as we gather more users that do not read support or development lists. I had been working on the releae tour of 3.3 at http://wiki.sagemath.org/sage-3.3 since the first few tickets were closed in that milestone. As more tickets were closed, I read/skimmed through them for interesting features and noted down those features in the above wiki. So the release tour was pretty much a work in progress. Note that everybody is welcome to help Minh out with this and Martin Albrecht did do so for the Sage 3.3 release tour as seen in http://wiki.sagemath.org/sage-3.3?action=info I think that any big feature or important fix should automatically be accomplished by a snipped in wiki text to be added to the release tour. There are some important things missing from the list of changes, i.e. fixes to the S-integral point counting code to name one, but given 385 tickets closed against 3.3 this can hardly be blamed on Minh :). What I will try to do in the future is to create stub entires in the current Sage release tour for tickets I consider important, so hopefully this will be less likely to happen. This afternoon (Australian time) I took the wiki page as base and fleshed out my blog post. The beautiful post that you saw took me an afternoon to format. Yep, this should make a great impact since it is too hard for many people not too tightly involved with the development process to distill the changes from the ticket list and figure out what is important and what not. Many of the ticket summaries are also hard to understand without insider knowledge. And in general: the more pretty pictures we have the better it is :) -- Regards Minh Van Nguyen Cheers, Michael --~--~-~--~~~---~--~~ 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] function evaluation
Hallo, I am new using sage and I can say, I is great! But now I got the following problem. I use sage notebook(). I defined a function: def h(f): if (f 10): return 10 if (f = 10): return 0 and now I want to plot it. G=plot(h(f), 0, 20) G.show() I get the error message: Traceback (click to the left for traceback) ... TypeError: no way to make fast_float from None So, sage has a problem with the if statement. When I set def h(f): if (f 10): return 10 else: return 0 it plots with G=plot(h(f), 0, 20) G.show() a constant zero graph. When I call the function myself: h(8) I get 10 and everything is ok. Do you know what this is? The evaluation of the if statement seems not to work in plot(). thank you, steffi --~--~-~--~~~---~--~~ 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: function evaluation
Dear Stefanie, On Mon, Feb 23, 2009 at 11:55:27AM +0100, Stefanie Schmidt wrote: [...] G=plot(h(f), 0, 20) G.show() Although I am not a sage expert, I would say, you want the following: G=plot(h, 0, 20) G.show() Do not give an argument to h. Best regards, Oliver --~--~-~--~~~---~--~~ 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: function evaluation
Oliver Block wrote: Dear Stefanie, On Mon, Feb 23, 2009 at 11:55:27AM +0100, Stefanie Schmidt wrote: [...] G=plot(h(f), 0, 20) G.show() Although I am not a sage expert, I would say, you want the following: G=plot(h, 0, 20) G.show() Do not give an argument to h. Yes, that is correct. When someone calls plot(h(f), 0, 20), then h is evaluated at f first, so if f was 10, then plot(h(f), 0, 20) is exactly the same as plot(0, 0, 20). In order to call h with the numeric values between 0 and 20, you need to pass the *function* h, not the output of evaluating the function at f. Things would work differently if h was a symbolic expression, rather than a python function. For example: h(x) = sin(x) plot(h(x), (x, 0, 20)) or plot(h, 0, 20) would both give the expected plot, because h(x) is sin(x) (i.e., a function, not a number), and h is the function x |-- sin(x). Jason --~--~-~--~~~---~--~~ 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] SAGE NEWBIE - Can sage eliminate symbolic variables in an equation?
Hi, This is probably a silly question but i'm new to SAGE and was wondering if SAGE is able to solve symbolic equations by eliminating variables - similar to MAPLEs eliminate command.Here is what i'm trying to solve: eqn_x = - x - a3 cos(theta1) sin(theta2) + d3 cos(theta1) cos(theta2)+ d2sin(theta1) eqn_y = - y - a3 sin(theta1) sin(theta2) + d3 sin(theta1) cos(theta2) - d2cos(theta1) eqn_z = - z + d3 sin(theta2) + a3 cos(theta2) i'm trying to solve for d3 by eliminating theta1 and theta2 , this is how it can be done in MAPLE: eliminate({eqn_x,eqn_y},theta1) eq_1 := %[2][1] eliminate({eqn_z,eq_1},theta2) eq_2 = %[2][1] and from there it is fairly simple to figure out the next steps and get d3 i've tried various combinations of solve, simplify and trigsimp(from maxima) and other such functions but it doesnt seem to eliminate variables.any ideas? thanks in advance! Ayishwariya --~--~-~--~~~---~--~~ 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: Sage 3.3 released
Dear Minh, This is really a great page, thank you for this, just your link to Pynac is wrong, the project you are linking to is an old one which has nothing to do with this one here. Georg --~--~-~--~~~---~--~~ 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: function evaluation
thank you for you quick answers! it works. but my example in my previous mail was only a simplification of my real problem. your answer works fine with my simplification. but I am not shure what to do with my original problem. I want to plot a function of two variables, but with one variable fixed. I have def g(f,s): (quiet long here with a lot of cases...) and I want to plot for example plot(g(x,90),48,51) the answer of sage is again TypeError: no way to make fast_float from None I think this is a similar problem. but I cannot call it with plot(g(x,48,51), since than it is not clear what variable to use !? regards, steffi Quoting Jason Grout jason-s...@creativetrax.com: Oliver Block wrote: Dear Stefanie, On Mon, Feb 23, 2009 at 11:55:27AM +0100, Stefanie Schmidt wrote: [...] G=plot(h(f), 0, 20) G.show() Although I am not a sage expert, I would say, you want the following: G=plot(h, 0, 20) G.show() Do not give an argument to h. Yes, that is correct. When someone calls plot(h(f), 0, 20), then h is evaluated at f first, so if f was 10, then plot(h(f), 0, 20) is exactly the same as plot(0, 0, 20). In order to call h with the numeric values between 0 and 20, you need to pass the *function* h, not the output of evaluating the function at f. Things would work differently if h was a symbolic expression, rather than a python function. For example: h(x) = sin(x) plot(h(x), (x, 0, 20)) or plot(h, 0, 20) would both give the expected plot, because h(x) is sin(x) (i.e., a function, not a number), and h is the function x |-- sin(x). Jason --~--~-~--~~~---~--~~ 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: function evaluation
On Mon, Feb 23, 2009 at 1:25 PM, Stefanie Schmidt prur...@web.de wrote: thank you for you quick answers! it works. but my example in my previous mail was only a simplification of my real problem. your answer works fine with my simplification. but I am not shure what to do with my original problem. I want to plot a function of two variables, but with one variable fixed. I have def g(f,s): (quiet long here with a lot of cases...) and I want to plot for example plot(g(x,90),48,51) def h(x): return g(x,90) plot(h,48,51) -- Johan --~--~-~--~~~---~--~~ 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: function evaluation
On Mon, Feb 23, 2009 at 05:40:39AM -0600, Jason Grout wrote: [...] Yes, that is correct. When someone calls plot(h(f), 0, 20), then h is evaluated at f first, so if f was 10, then plot(h(f), 0, 20) is exactly the same as plot(0, 0, 20). In order to call h with the numeric values between 0 and 20, you need to pass the *function* h, not the output of evaluating the function at f. Things would work differently if h was a symbolic expression, rather than a python function. For example: h(x) = sin(x) plot(h(x), (x, 0, 20)) or plot(h, 0, 20) would both give the expected plot, because h(x) is sin(x) (i.e., a function, not a number), and h is the function x |-- sin(x). And why does plot(h(x), (x, 0, 20)) with h defined as in Stephanies example, not work? I thought, sage would evaluate h(x) for x values between 0 and 20 and then plot this. Why does this work for h(x) = sin(x) but not for h as defined in Stephanies example? Oliver --~--~-~--~~~---~--~~ 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] Unable to run Sage Version 3.2.3 on OS X (10.5 Intel): Runtime Error: Unable to Start Maxima
I am considering using SAGE for instruction in the classroom for come courses. However, I use an OS 10.5 Intel Mac for preparing materials and want to have a local installation of SAGE to work on worksheets for class and to have as backup in case the server is ever down or I have limited network access in class. However, I downloaded and installed SAGE 3.2.3 as instructed and followed the previous posts on this forum regarding a common runtime error: Unable to start maxima. Has anyone resolved this issue? I also have attempted moving the sage folder to my own directory, and restarting, but this does not resolve the problem. Is this a permissions issue, or something else? For reference, I am able to start the GUI via the command notebook() from the sage command line successfully, but no computation is successful as the engine cannot be started and returns the runtime error. I have also tried running as sudo to no avail. The complete error is included here: Traceback (most recent call last): File stdin, line 1, in module File /Users/rangel/.sage/sage_notebook/worksheets/admin/3/code/ 1.py, line 6, in module sin(pi) File /Applications/sage/local/lib/python2.5/site-packages/ SQLAlchemy-0.4.6-py2.5.egg/, line 1, in module File sage_object.pyx, line 92, in sage.structure.sage_object.SageObject.__repr__ (sage/structure/ sage_object.c:1082) File /Applications/sage/local/lib/python2.5/site-packages/sage/ calculus/calculus.py, line 6291, in _repr_ return self.simplify()._repr_(simplify=False) File /Applications/sage/local/lib/python2.5/site-packages/sage/ calculus/calculus.py, line 3425, in simplify S = evaled_symbolic_expression_from_maxima_string (self._maxima_init_()) File /Applications/sage/local/lib/python2.5/site-packages/sage/ calculus/calculus.py, line 9072, in evaled_symbolic_expression_from_maxima_string return symbolic_expression_from_maxima_string(maxima.eval(x)) File /Applications/sage/local/lib/python2.5/site-packages/sage/ interfaces/expect.py, line 937, in eval return '\n'.join([self._eval_line(L, **kwds) for L in code.split ('\n') if L != '']) File /Applications/sage/local/lib/python2.5/site-packages/sage/ interfaces/maxima.py, line 580, in _eval_line self._sendline(line) File /Applications/sage/local/lib/python2.5/site-packages/sage/ interfaces/maxima.py, line 471, in _sendline self._sendstr(str) File /Applications/sage/local/lib/python2.5/site-packages/sage/ interfaces/expect.py, line 834, in _sendstr self._start() File /Applications/sage/local/lib/python2.5/site-packages/sage/ interfaces/maxima.py, line 450, in _start Expect._start(self) File /Applications/sage/local/lib/python2.5/site-packages/sage/ interfaces/expect.py, line 470, in _start raise RuntimeError, Unable to start %s%self.__name RuntimeError: Unable to start maxima --~--~-~--~~~---~--~~ 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: Unable to run Sage Version 3.2.3 on OS X (10.5 Intel): Runtime Error: Unable to Start Maxima
On Feb 23, 1:17 pm, dr dprangel...@gmail.com wrote: I am considering using SAGE for instruction in the classroom for come courses. However, I use an OS 10.5 Intel Mac for preparing materials and want to have a local installation of SAGE to work on worksheets for class and to have as backup in case the server is ever down or I have limited network access in class. However, I downloaded and installed SAGE 3.2.3 as instructed and followed the previous posts on this forum regarding a common runtime error: Unable to start maxima. Has anyone resolved this issue? This looks like the issue I was having and Michael Abshoff fixed it in the latest release, which is 3.3. I don't think that will be released in binary but the source code is available, if you can build it. Supposedly, 3.4 will be out soon. Mark McClure --~--~-~--~~~---~--~~ 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: Unable to run Sage Version 3.2.3 on OS X (10.5 Intel): Runtime Error: Unable to Start Maxima
On Feb 23, 10:42 am, mark mcclure mcmcc...@unca.edu wrote: On Feb 23, 1:17 pm, dr dprangel...@gmail.com wrote: Hi, I am considering using SAGE for instruction in the classroom for come courses. However, I use an OS 10.5 Intel Mac for preparing materials and want to have a local installation of SAGE to work on worksheets for class and to have as backup in case the server is ever down or I have limited network access in class. However, I downloaded and installed SAGE 3.2.3 as instructed and followed the previous posts on this forum regarding a common runtime error: Unable to start maxima. Has anyone resolved this issue? This looks like the issue I was having and Michael Abshoff fixed it in the latest release, which is 3.3. Nope, so far I only opened a ticket :) I don't think that will be released in binary but the source code is available, if you can build it. Supposedly, 3.4 will be out soon. Yes, but I doubt either one will help here. The issue has not been fixed yet, but you can read the whole story at http://groups.google.com/group/sage-devel/browse_thread/thread/e7f7ddd0ad86971d/413b74e7521b8a92 This is probably the same issue Mark reported at the end of that thread. To quote his solution [you can ignore the bit about the app bundle since it does not apply to 3.2.3]: [quote] I finally got Sage.app working. Still there seems something a bit odd about the fix. I had, in my home directory, a .maxima directory with a file named maxima-init.mac that sets certain maxima preferences. Once I deleted this file, everything worked fine. As I understand it though, the sage directory is supposed to be independent of the rest of the system. Evidently, the latest version of sage is reading information from my home directory. My old sage (v3.0.1) runs fine without removing the file, however. The two lines in the maxima-init file were exactly the following: set_plot_option([gnuplot_term, aqua]); set_plot_option([gnuplot_pipes_term, aqua]); Of course, now I can no longer plot from my standalone copy of maxima. :) [end quote] So if you have such a custom Maxima file you might consider moving it out of the way and try again. If this does not work for you please post the output from ./sage -maxima to debug this further. It would also be a good idea to check that the binary you downloaded is indeed the OSX 10.5 one and not the 10.4, even though the 10.4 binary tends to also work on 10.5. Mark McClure Cheers, Michael --~--~-~--~~~---~--~~ 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: function evaluation
Johan Oudinet wrote: On Mon, Feb 23, 2009 at 1:25 PM, Stefanie Schmidt prur...@web.de wrote: thank you for you quick answers! it works. but my example in my previous mail was only a simplification of my real problem. your answer works fine with my simplification. but I am not shure what to do with my original problem. I want to plot a function of two variables, but with one variable fixed. I have def g(f,s): (quiet long here with a lot of cases...) and I want to plot for example plot(g(x,90),48,51) def h(x): return g(x,90) plot(h,48,51) Or: plot(lambda x: g(x,90), (48, 51)) Or: from functools import partial h=partial(g,s=90) plot(h, (48,51)) (see http://docs.python.org/library/functools.html) Jason --~--~-~--~~~---~--~~ 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: function evaluation
Oliver Block wrote: On Mon, Feb 23, 2009 at 05:40:39AM -0600, Jason Grout wrote: [...] Yes, that is correct. When someone calls plot(h(f), 0, 20), then h is evaluated at f first, so if f was 10, then plot(h(f), 0, 20) is exactly the same as plot(0, 0, 20). In order to call h with the numeric values between 0 and 20, you need to pass the *function* h, not the output of evaluating the function at f. Things would work differently if h was a symbolic expression, rather than a python function. For example: h(x) = sin(x) plot(h(x), (x, 0, 20)) or plot(h, 0, 20) would both give the expected plot, because h(x) is sin(x) (i.e., a function, not a number), and h is the function x |-- sin(x). And why does plot(h(x), (x, 0, 20)) with h defined as in Stephanies example, not work? I thought, sage would evaluate h(x) for x values between 0 and 20 and then plot this. Why does this work for h(x) = sin(x) but not for h as defined in Stephanies example? There is some magic that Sage is doing behind the scenes. h(x) = sin(x) is really: sage: preparse('h(x)=sin(x)') '_=var(x);h=symbolic_expression(sin(x)).function(x)' So, you see, h is a special Sage object. When you do h(x), you get back an object: sage: type(h(x)) class 'sage.calculus.calculus.SymbolicComposition' This SymbolicComposition object knows how to evaluate numbers. So, for example: sage: (h(x))(1.0) 0.841470984807897 Therefore, plot can call whatever h(x) returns (this SymbolicComposition object) and get back y-values. In Steffi's example, h was a normal python function, so h(x) returned just a number, say 34. The plot command then calls this return value (i.e., the integer 34), but that doesn't make sense. In essence, the plot function tries to do: sage: (34)(1.0) --- TypeError Traceback (most recent call last) /home/grout/.sage/temp/good/24102/_home_grout__sage_init_sage_0.py in module() TypeError: 'sage.rings.integer.Integer' object is not callable Does that make more sense? Jason --~--~-~--~~~---~--~~ 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: Unable to run Sage Version 3.2.3 on OS X (10.5 Intel): Runtime Error: Unable to Start Maxima
Hello, Thank you very much for pointing out the section of the previous post that resolves this issue. I renamed the .maxima directory to something else (.old_maxima) and now SAGE works perfectly. Best Regards, David On Feb 23, 10:56 am, mabshoff michael.absh...@mathematik.uni- dortmund.de wrote: On Feb 23, 10:42 am, mark mcclure mcmcc...@unca.edu wrote: On Feb 23, 1:17 pm, dr dprangel...@gmail.com wrote: Hi, I am considering using SAGE for instruction in the classroom for come courses. However, I use an OS 10.5 Intel Mac for preparing materials and want to have a local installation of SAGE to work on worksheets for class and to have as backup in case the server is ever down or I have limited network access in class. However, I downloaded and installed SAGE 3.2.3 as instructed and followed the previous posts on this forum regarding a common runtime error: Unable to start maxima. Has anyone resolved this issue? This looks like the issue I was having and Michael Abshoff fixed it in the latest release, which is 3.3. Nope, so far I only opened a ticket :) I don't think that will be released in binary but the source code is available, if you can build it. Supposedly, 3.4 will be out soon. Yes, but I doubt either one will help here. The issue has not been fixed yet, but you can read the whole story at http://groups.google.com/group/sage-devel/browse_thread/thread/e7f7dd... This is probably the same issue Mark reported at the end of that thread. To quote his solution [you can ignore the bit about the app bundle since it does not apply to 3.2.3]: [quote] I finally got Sage.app working. Still there seems something a bit odd about the fix. I had, in my home directory, a .maxima directory with a file named maxima-init.mac that sets certain maxima preferences. Once I deleted this file, everything worked fine. As I understand it though, the sage directory is supposed to be independent of the rest of the system. Evidently, the latest version of sage is reading information from my home directory. My old sage (v3.0.1) runs fine without removing the file, however. The two lines in the maxima-init file were exactly the following: set_plot_option([gnuplot_term, aqua]); set_plot_option([gnuplot_pipes_term, aqua]); Of course, now I can no longer plot from my standalone copy of maxima. :) [end quote] So if you have such a custom Maxima file you might consider moving it out of the way and try again. If this does not work for you please post the output from ./sage -maxima to debug this further. It would also be a good idea to check that the binary you downloaded is indeed the OSX 10.5 one and not the 10.4, even though the 10.4 binary tends to also work on 10.5. Mark McClure Cheers, Michael --~--~-~--~~~---~--~~ 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: function evaluation
Quoting Jason Grout jason-s...@creativetrax.com: Oliver Block wrote: On Mon, Feb 23, 2009 at 05:40:39AM -0600, Jason Grout wrote: [...] Yes, that is correct. When someone calls plot(h(f), 0, 20), then h is evaluated at f first, so if f was 10, then plot(h(f), 0, 20) is exactly the same as plot(0, 0, 20). In order to call h with the numeric values between 0 and 20, you need to pass the *function* h, not the output of evaluating the function at f. Things would work differently if h was a symbolic expression, rather than a python function. For example: h(x) = sin(x) plot(h(x), (x, 0, 20)) or plot(h, 0, 20) would both give the expected plot, because h(x) is sin(x) (i.e., a function, not a number), and h is the function x |-- sin(x). And why does plot(h(x), (x, 0, 20)) with h defined as in Stephanies example, not work? I thought, sage would evaluate h(x) for x values between 0 and 20 and then plot this. Why does this work for h(x) = sin(x) but not for h as defined in Stephanies example? There is some magic that Sage is doing behind the scenes. h(x) = sin(x) is really: sage: preparse('h(x)=sin(x)') '_=var(x);h=symbolic_expression(sin(x)).function(x)' So, you see, h is a special Sage object. When you do h(x), you get back an object: sage: type(h(x)) class 'sage.calculus.calculus.SymbolicComposition' This SymbolicComposition object knows how to evaluate numbers. So, for example: sage: (h(x))(1.0) 0.841470984807897 Therefore, plot can call whatever h(x) returns (this SymbolicComposition object) and get back y-values. In Steffi's example, h was a normal python function, so h(x) returned just a number, say 34. The plot command then calls this return value (i.e., the integer 34), but that doesn't make sense. In essence, the plot function tries to do: sage: (34)(1.0) --- TypeError Traceback (most recent call last) /home/grout/.sage/temp/good/24102/_home_grout__sage_init_sage_0.py in module() TypeError: 'sage.rings.integer.Integer' object is not callable Does that make more sense? Jason thank you! great! you are wonderful ;-) regards, steffi --~--~-~--~~~---~--~~ 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: polynomial coercion bug?
Carl, regarding the parenthetical remark of your first reply, are you saying the coercion error for plain old monomials below is supposed to happen? If so, then what's the simplest way to take an element f of a polynomial ring R over a number field F and compute its embedded image in RR= R.change_ring(QQbar), supposing you have an embedding phi: F -- QQbar? Grab the coefficients of f, compute their images under phi, grab the monomials of f, redefine (not coerce) them in RR, and reassemble the pieces in RR? Alex -- | Sage Version 3.3, Release Date: 2009-02-21 | | Type notebook() for the GUI, and license() for information.| -- sage: var('t') t sage: F = NumberField(t^4+1, 'a') sage: R.x,y = F[] sage: f= x*y + x^2 sage: RR= R.change_ring(QQbar) sage: print [RR(m) for m in f.monomials()] --- TypeError Traceback (most recent call last) /Users/arai021/ipython console in module() /Applications/sage-3.3/local/lib/python2.5/site-packages/sage/rings/ polynomial/multi_polynomial_ring.pyc in __call__(self, x, check) /Applications/sage-3.3/local/lib/python2.5/site-packages/sage/rings/ qqbar.pyc in __call__(self, x) /Applications/sage-3.3/local/lib/python2.5/site-packages/sage/rings/ qqbar.pyc in __init__(self, x) /Applications/sage-3.3/local/lib/python2.5/site-packages/sage/rings/ qqbar.pyc in __init__(self, parent, x) TypeError: Illegal initializer for algebraic number On Feb 21, 11:05 am, Alex Raichev tortoise.s...@gmail.com wrote: Sweet! Thanks, Carl. Alex On Feb 20, 8:08 pm, Carl Witty carl.wi...@gmail.com wrote: On Feb 19, 10:16 pm, Carl Witty carl.wi...@gmail.com wrote: There's a bug. And, now that you've pointed out the bug, I figured out how to crash Sage with a segmentation fault; so it's a serious bug. Thanks for reporting it! This bug is now being tracked at http://trac.sagemath.org/sage_trac/ticket/5316 OK, I've posted a patch for the bug at that URL, and (assuming it gets positively reviewed) the fix will be in Sage 3.3. Carl --~--~-~--~~~---~--~~ 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: polynomial coercion bug?
On Feb 23, 6:54 pm, Alex Raichev tortoise.s...@gmail.com wrote: Carl, regarding the parenthetical remark of your first reply, are you saying the coercion error for plain old monomials below is supposed to happen? Well, I wouldn't say supposed to happen because I don't think this is the way it should stay long-term. But yes, it's expected; that functionality is not yet implemented. If so, then what's the simplest way to take an element f of a polynomial ring R over a number field F and compute its embedded image in RR= R.change_ring(QQbar), supposing you have an embedding phi: F -- QQbar? Grab the coefficients of f, compute their images under phi, grab the monomials of f, redefine (not coerce) them in RR, and reassemble the pieces in RR? Probably. This was the shortest (probably not the clearest) way I could quickly come up with to do the conversion. sage: var('t') t sage: F.a = NumberField(t^4+1) sage: R.x,y = F[] sage: p = R.random_element() sage: RR = R.change_ring(QQbar) sage: phi = F.embeddings(QQbar)[0] sage: gens = RR.gens() sage: sum([phi(c) * prod([g^e for (g,e) in zip(gens, m.exponents() [0])]) for (c,m) in p]) (-8.36396103067893? + 6.863961030678928?*I)*x*y + (-17.67731239591687? - 10.86922437301290?*I)*y^2 + (-2.828427124746190? - 34.41421356237310? *I)*x + (0.01611083391521890? + 0.1295048468845087?*I)*y - 11.07800623858925? - 4.978342947514801?*I By the way, even if QQbar does get extended to support number fields with embedding someday, it still won't handle the exact example in your email because your number field doesn't have an embedding. Carl --~--~-~--~~~---~--~~ 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: polynomial coercion bug?
On Feb 23, 7:57 pm, Carl Witty carl.wi...@gmail.com wrote: On Feb 23, 6:54 pm, Alex Raichev tortoise.s...@gmail.com wrote: Carl, regarding the parenthetical remark of your first reply, are you saying the coercion error for plain old monomials below is supposed to happen? Well, I wouldn't say supposed to happen because I don't think this is the way it should stay long-term. But yes, it's expected; that functionality is not yet implemented. I've posted a wishlist request for coercions from number fields with embedding into QQbar. http://trac.sagemath.org/sage_trac/ticket/5355 Carl --~--~-~--~~~---~--~~ 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: Sage 3.3 released
Hi Michael, On Mon, Feb 23, 2009 at 10:27 AM, mabshoff michael.absh...@mathematik.uni-dortmund.de wrote: SNIP Note that everybody is welcome to help Minh out with this and Martin Albrecht did do so for the Sage 3.3 release tour as seen in http://wiki.sagemath.org/sage-3.3?action=info I think that any big feature or important fix should automatically be accomplished by a snipped in wiki text to be added to the release tour. There are some important things missing from the list of changes, i.e. fixes to the S-integral point counting code to name one, but given 385 tickets closed against 3.3 this can hardly be blamed on Minh :). What I will try to do in the future is to create stub entires in the current Sage release tour for tickets I consider important, so hopefully this will be less likely to happen. Thanks in advance for alerting me to important features in future milestones. A lot of the time, I would have no ideal how important a patch is until I finally read your release note. This afternoon (Australian time) I took the wiki page as base and fleshed out my blog post. The beautiful post that you saw took me an afternoon to format. Yep, this should make a great impact since it is too hard for many people not too tightly involved with the development process to distill the changes from the ticket list and figure out what is important and what not. Many of the ticket summaries are also hard to understand without insider knowledge. And in general: the more pretty pictures we have the better it is :) Point taken. I'll keep that in mind. -- Regards Minh Van Nguyen --~--~-~--~~~---~--~~ 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: Sage 3.3 released
Hi Georg, On Mon, Feb 23, 2009 at 2:45 PM, ggrafendorfer georg.grafendor...@gmail.com wrote: Dear Minh, This is really a great page, thank you for this, just your link to Pynac is wrong, the project you are linking to is an old one which has nothing to do with this one here. Thank you very much for pointing that out. I have no idea if the Pynac that Sage uses has its own up-to-date website. I'd appreciate it if you could point me to the Pynac website you're hinting at. -- Regards Minh Van Nguyen --~--~-~--~~~---~--~~ 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: Sage 3.3 released
On Tue, Feb 24, 2009 at 7:07 AM, Minh Nguyen nguyenmi...@gmail.com wrote: Hi Georg, On Mon, Feb 23, 2009 at 2:45 PM, ggrafendorfer georg.grafendor...@gmail.com wrote: Dear Minh, This is really a great page, thank you for this, just your link to Pynac is wrong, the project you are linking to is an old one which has nothing to do with this one here. Thank you very much for pointing that out. I have no idea if the Pynac that Sage uses has its own up-to-date website. I'd appreciate it if you could point me to the Pynac website you're hinting at. OK. I think I've just answered my own query. The site in question is http://wiki.sagemath.org/spkg/pynac -- Regards Minh Van Nguyen --~--~-~--~~~---~--~~ 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: Sage 3.3 released
On Mon, Feb 23, 2009 at 11:24 PM, Minh Nguyen nguyenmi...@gmail.com wrote: On Tue, Feb 24, 2009 at 7:07 AM, Minh Nguyen nguyenmi...@gmail.com wrote: Hi Georg, On Mon, Feb 23, 2009 at 2:45 PM, ggrafendorfer georg.grafendor...@gmail.com wrote: Dear Minh, This is really a great page, thank you for this, just your link to Pynac is wrong, the project you are linking to is an old one which has nothing to do with this one here. Thank you very much for pointing that out. I have no idea if the Pynac that Sage uses has its own up-to-date website. I'd appreciate it if you could point me to the Pynac website you're hinting at. OK. I think I've just answered my own query. The site in question is http://wiki.sagemath.org/spkg/pynac I am going to make http://pynac.sagemath.org/ the official website for pynac. Right now it is just a trivial 1-minute webpage I made... 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 -~--~~~~--~~--~--~---