ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 09 Mar 2020 04:19:57 -0500How to solve numericaly with arbitrary precisionhttp://ask.sagemath.org/question/50197/how-to-solve-numericaly-with-arbitrary-precision/Hello,
I want to solve a numerical equation for which I can only access by a lambda function, the M matrix is to big for the determinant to be computed on the symbolic ring.
f = lambda om: RRR(M.subs({omega:om}).change_ring(RRR).det())
But , find-root solve in the built in float type of Python which is lacking the precision I need. Is there a way in sage to solve numericaly with arbitrary precision?
Thank you
Regards
*(edited with example more in line with what I am trying to achieve)*
sage: x=var('x')
sage: M= Matrix(SR,[[cos(x),cosh(x)],[sin(x),sinh(x)]])
sage: RRR = RealField(200)
sage: f = lambda om: M.subs({x:om}).change_ring(RRR).det()
sage: find_root(f,1,2)JonasAMon, 09 Mar 2020 04:19:57 -0500http://ask.sagemath.org/question/50197/Random orientation of a graphhttp://ask.sagemath.org/question/42274/random-orientation-of-a-graph/ Is there a command to randomly orient a graph? (no additional edges) not the to_directed commandstandardtrickynessSun, 06 May 2018 19:36:46 -0500http://ask.sagemath.org/question/42274/canonicalize_radical for matrices.http://ask.sagemath.org/question/34302/canonicalize_radical-for-matrices/The following all works
sage: a = sqrt(2)*sqrt(3)*sqrt(6)
sage: v = vector([a])
sage: M = Matrix([v, v])
sage: a.canonicalize_radical()
6
sage: v.canonicalize_radical()
(6)
However the following doesn't work:
sage: M = Matrix([v, v])
sage: M.canonicalize_radical()
EDIT: Could somebody please tell me the right place to ask for "vectorization of canonicalize_radical for matrices" as a new feature of sage?Saul SchleimerTue, 02 Aug 2016 13:46:22 -0500http://ask.sagemath.org/question/34302/Can SAGE compute with ordinals?http://ask.sagemath.org/question/25035/can-sage-compute-with-ordinals/Computing with ordinal expressions like $(\omega^{\omega^2+1}+\omega)^{\omega+2}$ is not very different from handling polynomials, at least if we restrict to ordinals below $\epsilon_0$ written in Cantor Normal Form.
I did not see ordinals mentioned in the manual. Does SAGE know how to do such computations?
I'm interested in basic operations like addition, multiplication, exponentiation, comparison, and it is painful (and risky) to do them by hand.
phsFri, 28 Nov 2014 09:26:23 -0600http://ask.sagemath.org/question/25035/Question about unit conversion and feature request.http://ask.sagemath.org/question/10726/question-about-unit-conversion-and-feature-request/I frequently need to convert units and I find sage very useful in doing that. However, sage does not support conversion to natural units which is frequently used in particle physics. So I have to keep multiplying expressions by $\hbar$ and $c$ in each notebook. Is there a more efficient way to convert quantities from SI to natural units. Does anyone have a idea so that sage can automatically identify the length, mass and time dimension and multiply by appropriate power of $\hbar$ and $c$. Also how difficult would it be to include this feature in sage?
Let me give a brief explanation of what natural units are. All the quantities in natural units are generally expressed a power of energy and $c$ and $\hbar$ are set to one. So one over length is equal to energy etc. ShashankMon, 11 Nov 2013 05:32:52 -0600http://ask.sagemath.org/question/10726/Normalize vector to euclidean unit lengthhttp://ask.sagemath.org/question/9410/normalize-vector-to-euclidean-unit-length/I know I can compute a vector of unit length in a given direction using something like
v = some_vector_computation()
v = v/v.norm()
some_other_computation(v)
On the other hand, the most intuitive way to write this in a single line won't work:
some_other_computation(some_vector_computation().normalize())
This is because of the way `normalize` is defined, which is well documented and has been discussed in [this question](http://ask.sagemath.org/question/726/vectornormalize-function).
So I wonder, is there some other way to write the above in a single line? I'm not interested in solutions which call `some_vector_computation` twice, or have to name the vector, or use some lambda function, or similar hacks. I very much have a method in mind, but anything with similar complexibility and readability would be fine.
I know I could probably add my own method to the vector class at runtime, but modifying sage classes in this way doesn't exactly feel right. And I fear that using a non-standard method might make my code much harder to read, as others would expect being able to reproduce it, but won't be able to if they missed my custom method.
If there is no such method, do you agree that there should be, and that I should file a feature request on the Sage Trac?MvGWed, 10 Oct 2012 02:20:15 -0500http://ask.sagemath.org/question/9410/Filing feature requestshttp://ask.sagemath.org/question/8090/filing-feature-requests/Where can one file a feature request?
And shouldn't that place be linked with a big red flashing banner from the Sage homepage?chaeslocWed, 27 Apr 2011 04:48:16 -0500http://ask.sagemath.org/question/8090/message to another user on AskSagehttp://ask.sagemath.org/question/7965/message-to-another-user-on-asksage/How can I send a message t another user on AskSage?czsanTue, 22 Feb 2011 02:13:50 -0600http://ask.sagemath.org/question/7965/