[sage-support] Re: change from cosine to degrees
Thanks. Hopefully some of the math will start coming back as I go through this. I'm glad I didn't spend an hour looking for the 'conversion'. --~--~-~--~~~---~--~~ 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: change from cosine to degrees
On Thu, Aug 20, 2009 at 4:58 PM, Hermit wrote: > > Sorry but I've spent over an hour on google and not found this. I've > had calculus but haven't used it in years. I decided to do some > brushing up and learn sage at the same time. > > I have the number -0.6167. If I want degree representation on my old > HP48 I use acos and get 128(degrees) In sage n(acos(y)) returns > 2.23534511018429. > > Well, the good news is I've just realized that is radians so I'm > closer. :) How do I get degrees and WHERE should I be looking in the > docs? > > Thanks. > Sage does not currently include any capabilities for "unit conversions". David Ackerman is currently working on implementing a unit conversions package, which would make the above problem trivial, when it gets included with Sage. In the meantime, do what Tim Lahey suggests. 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] Re: change from cosine to degrees
On Aug 20, 2009, at 7:58 PM, Hermit wrote: > > Sorry but I've spent over an hour on google and not found this. I've > had calculus but haven't used it in years. I decided to do some > brushing up and learn sage at the same time. > > I have the number -0.6167. If I want degree representation on my old > HP48 I use acos and get 128(degrees) In sage n(acos(y)) returns > 2.23534511018429. > > Well, the good news is I've just realized that is radians so I'm > closer. :) How do I get degrees and WHERE should I be looking in the > docs? > I'm not sure about docs, but a simple way to convert from radians to degrees is multiply by 180/pi since there are 180 degrees in pi radians. --- Tim Lahey PhD Candidate, Systems Design Engineering University of Waterloo http://www.linkedin.com/in/timlahey --~--~-~--~~~---~--~~ 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] change from cosine to degrees
Sorry but I've spent over an hour on google and not found this. I've had calculus but haven't used it in years. I decided to do some brushing up and learn sage at the same time. I have the number -0.6167. If I want degree representation on my old HP48 I use acos and get 128(degrees) In sage n(acos(y)) returns 2.23534511018429. Well, the good news is I've just realized that is radians so I'm closer. :) How do I get degrees and WHERE should I be looking in the docs? Thanks. --~--~-~--~~~---~--~~ 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] ANN: FuncDesigner 0.15RC, DerApproximator 0.15RC, OpenOpt 0.25RC
Hi all, I would like to inform you about new packages - FuncDesigner and DerApproximator. They have been extracted from OpenOpt into standalone Python modules. FuncDesigner is a convenient tool for building functions and getting their derivatives via Automatic differentiation (http://openopt.org/ AD), not to be confused with numerical differentiation via finite- differences derivatives approximation and symbolic differentiation provided by Maxima, SymPy etc. See http://openopt.org/FuncDesigner for more details DerApproximator is a small yet important package for getting/checking derivatives (currently only 1st ones), extracted from OpenOpt framework to be standalone Python module. It is required by FuncDesigner (for obtaining derivatives of oofuns beyond standard set without routines to yield them directly) and some OpenOpt solvers (when there are some functions without user-supplied derivatives). See http://openopt.org/DerApproximator for more details. All my tests pass OK, but since there was an awful lots of changes, I decided it's better to introduce RCs before stable releases, mb some bugs are still lurking. Regards, D. --~--~-~--~~~---~--~~ 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: Solution
Perhaps you could convert this into a system of linear equations then use the solve command? On Thu, Aug 20, 2009 at 2:39 PM, Santanu Sarkar wrote: > Hi, > How can I find the solution x1,...,z3 in SAGE where > A= [x1,x2,x3, > y1,y2,y3, > z1,z2,z3] is a (3,3) matrix which satisfy AB=C > where B=[1,2 > 3,4, > 5,6] a (3,2) matrix and > C=[0,0, > 1,0, > 0,2] another (3,2) matrix ? > > > > --~--~-~--~~~---~--~~ 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: Solution
On Thu, Aug 20, 2009 at 11:39 AM, Santanu Sarkar wrote: > Hi, > How can I find the solution x1,...,z3 in SAGE where > A= [x1,x2,x3, > y1,y2,y3, > z1,z2,z3] is a (3,3) matrix which satisfy AB=C > where B=[1,2 > 3,4, > 5,6] a (3,2) matrix and > C=[0,0, > 1,0, > 0,2] another (3,2) matrix ? > sage: B = matrix([[1,2],[3,4],[5,6]]) sage: C = matrix([[0,0],[1,0],[0,2]]) sage: A = B.solve_left(C); A [ 0 0 0] [-2 1 0] [ 3 -1 0] sage: A*B == C True -- 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] Solution
Hi, How can I find the solution x1,...,z3 in SAGE where A= [x1,x2,x3, y1,y2,y3, z1,z2,z3] is a (3,3) matrix which satisfy AB=C where B=[1,2 3,4, 5,6] a (3,2) matrix and C=[0,0, 1,0, 0,2] another (3,2) matrix ? --~--~-~--~~~---~--~~ 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: Weave broken in Sage 4.1 Mac intel 64 bit
On Thu, Aug 20, 2009 at 9:02 AM, felix wrote: > > Hi, > > this should have happened to other people, but I can't find some other > post on this one. I wonder if there is almost nobody using Sage who also uses weave? I've never used weave, and we use it nowhere in the Sage codebase. As a result of this, you may consider also asking your question below on the scipy list if nobody here has anything useful to say (like me just now). > I'm not sure which update exactly caused the bug, > since I didn't use weave since Sage 3.something. All I can say is, > that weave doesn't work at all in Sage 4.1 and 4.11 (64 bit) under Mac > OS X 10.5.8 on my MacBook Pro Unibody rev. A. It used to work fine > before. > > Weave doesn't even try to compile anything anymore it just produces a > KeyError: > from scipy import weave weave.inline("""printf("hello");""") > > File "", line 1, in > File "/Users/felix/Documents/uni/Promotion/sagenotebooks/ > critical_control/worksheets/admin/43/code/27.py", line 7, in > weave.inline("""printf("hello");""") > File "", line 1, in > > File "/Applications/sage/local/lib/python2.6/site-packages/scipy/ > weave/inline_tools.py", line 321, in inline > results = attempt_function_call(code,local_dict,global_dict) > File "/Applications/sage/local/lib/python2.6/site-packages/scipy/ > weave/inline_tools.py", line 389, in attempt_function_call > function_list = function_catalog.get_functions(code,module_dir) > File "/Applications/sage/local/lib/python2.6/site-packages/scipy/ > weave/catalog.py", line 612, in get_functions > function_list = self.get_cataloged_functions(code) > File "/Applications/sage/local/lib/python2.6/site-packages/scipy/ > weave/catalog.py", line 526, in get_cataloged_functions > if cat is not None and code in cat: > File "/Applications/sage/local/lib/python/shelve.py", line 110, in > __contains__ > return key in self.dict > File "/Applications/sage/local/lib/python2.6/site-packages/scipy/io/ > dumbdbm_patched.py", line 73, in __getitem__ > pos, siz = self._index[key] # may raise KeyError > KeyError: 0 > > Also weave.test() fails: > > Running unit tests for scipy.weave > Traceback (most recent call last): > File "", line 1, in > File "/Users/felix/Documents/uni/Promotion/sagenotebooks/ > critical_control/worksheets/admin/43/code/29.py", line 7, in > weave.test() > File "", line 1, in > > File "/Applications/sage/local/lib/python2.6/site-packages/numpy/ > testing/nosetester.py", line 242, in test > self._show_system_info() > File "/Applications/sage/local/lib/python2.6/site-packages/numpy/ > testing/nosetester.py", line 149, in _show_system_info > nose = import_nose() > File "/Applications/sage/local/lib/python2.6/site-packages/numpy/ > testing/nosetester.py", line 49, in import_nose > raise ImportError(msg) > ImportError: Need nose >= 0.10.0 for tests - see > http://somethingaboutorange.com/mrl/projects/nose > > > Any help on this issue would be very appreciated. > > - Felix > > > > -- 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] Weave broken in Sage 4.1 Mac intel 64 bit
Hi, this should have happened to other people, but I can't find some other post on this one. I'm not sure which update exactly caused the bug, since I didn't use weave since Sage 3.something. All I can say is, that weave doesn't work at all in Sage 4.1 and 4.11 (64 bit) under Mac OS X 10.5.8 on my MacBook Pro Unibody rev. A. It used to work fine before. Weave doesn't even try to compile anything anymore it just produces a KeyError: >>> from scipy import weave >>> weave.inline("""printf("hello");""") File "", line 1, in File "/Users/felix/Documents/uni/Promotion/sagenotebooks/ critical_control/worksheets/admin/43/code/27.py", line 7, in weave.inline("""printf("hello");""") File "", line 1, in File "/Applications/sage/local/lib/python2.6/site-packages/scipy/ weave/inline_tools.py", line 321, in inline results = attempt_function_call(code,local_dict,global_dict) File "/Applications/sage/local/lib/python2.6/site-packages/scipy/ weave/inline_tools.py", line 389, in attempt_function_call function_list = function_catalog.get_functions(code,module_dir) File "/Applications/sage/local/lib/python2.6/site-packages/scipy/ weave/catalog.py", line 612, in get_functions function_list = self.get_cataloged_functions(code) File "/Applications/sage/local/lib/python2.6/site-packages/scipy/ weave/catalog.py", line 526, in get_cataloged_functions if cat is not None and code in cat: File "/Applications/sage/local/lib/python/shelve.py", line 110, in __contains__ return key in self.dict File "/Applications/sage/local/lib/python2.6/site-packages/scipy/io/ dumbdbm_patched.py", line 73, in __getitem__ pos, siz = self._index[key] # may raise KeyError KeyError: 0 Also weave.test() fails: Running unit tests for scipy.weave Traceback (most recent call last): File "", line 1, in File "/Users/felix/Documents/uni/Promotion/sagenotebooks/ critical_control/worksheets/admin/43/code/29.py", line 7, in weave.test() File "", line 1, in File "/Applications/sage/local/lib/python2.6/site-packages/numpy/ testing/nosetester.py", line 242, in test self._show_system_info() File "/Applications/sage/local/lib/python2.6/site-packages/numpy/ testing/nosetester.py", line 149, in _show_system_info nose = import_nose() File "/Applications/sage/local/lib/python2.6/site-packages/numpy/ testing/nosetester.py", line 49, in import_nose raise ImportError(msg) ImportError: Need nose >= 0.10.0 for tests - see http://somethingaboutorange.com/mrl/projects/nose Any help on this issue would be very appreciated. - Felix --~--~-~--~~~---~--~~ 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: How to properly define a 'Sage-function'?
On Aug 20, 4:28 am, Jason Grout wrote: > Robert Bradshaw wrote: > > > It's just syntactic sugar. > > To see what Sage transforms something like this into, you can use the > preparse function: > > sage: preparse('f(y,z)=y^2+z') > '__tmp__=var("y,z"); f = symbolic_expression(y**Integer(2)+z).function(y,z)' > > So the variables are first declared with var(), then the expression is > constructed, and then the .function() method is called. Ah, that's very useful, thanks! --~--~-~--~~~---~--~~ 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] variables in finite fields
Hi: I am trying to "define" a variable to be an element of GF(2). In particular, suppose that I create GF(2^4) the following way: K=GF(2) S. = K['x'] QR=S.quotient(1+x+x^4,'a') a=FR.gen() Now I am trying to compute the following: (gamma0 + gamma1*a + gamma2*a^2 + gamma3*a^3)*(beta0 + beta1*a + beta2*a^2 + beta3*a^3) where gamma0,...,gamma3 and beta0,...,beta3 are symbols in GF(2). Essentially I want sage to multiply sage to multiply the two polynomials and then substitute the higher powers of a^i for their representation in the quotient ring. Said in different words, I would like to represent two symbolic elements of GF(2^4) explicitly (in their GF(2) constituents) and have sage compute what product of the two elements looks like. I tried defining gamma0,...gamma3,beta0,..,beta3 as regular vars (gamma0 = var('gamma0')) but I get a typeerror: TypeError: unsupported operand parent(s) for '*': 'Symbolic Ring' and 'Univariate Quotient Polynomial Ring in a over Finite Field of size 2 with modulus x^4 + x + 1' not defining them also does not work. Any ideas? Thanks!! Luis --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---