Re: [sage-support] Re: simplify more quickly?

2019-04-02 Thread Andreas Schuldei
yes, that is exactly was i had been hoping for. thank you! (yesterday evening, when i mailed here, the ask.sagemath.org site was down.) On Tue, Apr 2, 2019 at 12:02 AM Eric Gourgoulhon wrote: > I've edited my answer at > https://ask.sagemath.org/question/45959/grad-at-glacial-speed/ > to

[sage-support] Re: simplify more quickly?

2019-04-01 Thread Eric Gourgoulhon
I've edited my answer at https://ask.sagemath.org/question/45959/grad-at-glacial-speed/ to indicate how to change the simplification algorithm. Best wishes, Eric. -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this

[sage-support] Re: simplify

2016-12-29 Thread Dima Pasechnik
For rational functions you'd rather want to work with polynomials, not (symbolic) functions. sage: R.=QQ[] sage: q=(x^2+4*x+4)/(x+2)^2 sage: q 1 sage: q=(x^2+4*x+4)/(x+2)^3 sage: q 1/(x + 2) sage: q.parent() Fraction Field of Univariate Polynomial Ring in x over Rational Field On Thursday,

Re: [sage-support] Re: Simplify square root of square

2015-02-27 Thread Paul Royik
Thank you! On Friday, February 27, 2015 at 5:41:07 PM UTC+2, vdelecroix wrote: Here is one way... not sure it is the best sage: eq1 = sqrt(cos(4*x)+1) sage: eq2 = eq1.simplify_trig() sage: eq2 sqrt(8*cos(x)^4 - 8*cos(x)^2 + 2) The next step consists in factoring what is inside the

[sage-support] Re: Simplify square root of square

2015-02-27 Thread Simon King
Hi Paul, On 2015-02-27, Paul Royik distantjob...@gmail.com wrote: What is the way to consistently simplify square roots of squares? Examples: sqrt((x+1)^2) - x+1 sqrt(cos(4*x)+1) - sqrt(2)cos(2x) Simplification must not change the value of the expression. sqrt(x^2) is certainly not equal

Re: [sage-support] Re: Simplify square root of square

2015-02-27 Thread Vincent Delecroix
But... sage: eq = sqrt((pi-5)^2) sage: eq.canonicalize_radical() pi - 5 And as you can read from the documentation Choose a canonical branch of the given expression. The square root, cube root, natural log, etc. functions are multi-valued. The canonicalize_radical() method will choose

[sage-support] Re: Simplify square root of square

2015-02-27 Thread Paul Royik
OK. Let x is real. How to rewrite sqrt(cos(4x)+1) into sqrt(2)abs(cos(2x))? On Friday, February 27, 2015 at 3:36:59 PM UTC+2, Simon King wrote: Hi Paul, On 2015-02-27, Paul Royik distan...@gmail.com javascript: wrote: What is the way to consistently simplify square roots of squares?

Re: [sage-support] Re: Simplify square root of square

2015-02-27 Thread Vincent Delecroix
Here is one way... not sure it is the best sage: eq1 = sqrt(cos(4*x)+1) sage: eq2 = eq1.simplify_trig() sage: eq2 sqrt(8*cos(x)^4 - 8*cos(x)^2 + 2) The next step consists in factoring what is inside the sqrt: sage: o = eq2.operands()[0] sage: of = o.factor() sage: o 8*cos(x)^4 - 8*cos(x)^2 + 2

[sage-support] Re: Simplify number

2014-05-29 Thread Simon King
Hi! On 2014-05-29, SiL588 . ch4r...@hotmail.com wrote: Hi, i tried to simplify a number doing this: m1.simplify() but the output is AttributeError: 'sage.rings.real_mpfr.RealNumber' object has no attribute 'simplify' What does it mean? What did I do wrong? I declared m1 like this: m1

Re: [sage-support] Re: Simplify number

2014-05-29 Thread Robert Bradshaw
What exactly do you mean by simplify a real number? On Thu, May 29, 2014 at 8:32 AM, SiL588 . ch4r...@hotmail.com wrote: Unfortunately I don't know the rules of Phyton language, i just started using Sage notebook to do linear algebra computation. I think I did what you said, I assinged m a

Re: [sage-support] Re: Simplify number

2014-05-29 Thread SiL588 .
The output i have is this: 12.0 and I didn't want all those zeroes after the point. Il giorno giovedì 29 maggio 2014 17:46:51 UTC+2, Robert Bradshaw ha scritto: What exactly do you mean by simplify a real number? On Thu, May 29, 2014 at 8:32 AM, SiL588 .

Re: [sage-support] Re: Simplify number

2014-05-29 Thread William Stein
On Thu, May 29, 2014 at 8:59 AM, SiL588 . ch4r...@hotmail.com wrote: The output i have is this: 12.0 and I didn't want all those zeroes after the point. Try doing int(m) or floor(m) William Il giorno giovedì 29 maggio 2014 17:46:51 UTC+2, Robert Bradshaw ha scritto:

[sage-support] Re: Simplify number

2014-05-29 Thread Simon King
Hi, On 2014-05-29, SiL588 . ch4r...@hotmail.com wrote: Unfortunately I don't know the rules of Phyton language, Sage's main language for programming is Python, and also the language for user interaction is close to Python. We believe it is a big plus of Sage that it uses a mainstream language!

[sage-support] Re: Simplify number

2014-05-29 Thread SiL588 .
Il giorno giovedì 29 maggio 2014 18:06:19 UTC+2, Simon King ha scritto: Hence, at least for those variables that you override in the second cell, the first cell is of no use. Oh ok, I didn't understand that's the way it works I don't know what you mean by simplify a real number.

[sage-support] Re: Simplify number

2014-05-29 Thread Dominique Laurain
We get in trouble with your question, because you used simplify verb...which should have been refering to other SAGE simplifying functions (floor, simplify symbolic expression and so on) when you wanted to display only few significant digits of that real number. Function for you is :

Re: [sage-support] Re: Simplify number

2014-05-29 Thread William Stein
If you just want to safely print numbers with the trailing zeros removed, used strip: a = 12.00 b = 0.8 str(a).rstrip('0') str(b).rstrip('0') On Thu, May 29, 2014 at 9:53 AM, Dominique Laurain dominique.laurai...@orange.fr wrote: We get in trouble with your question, because you

[sage-support] Re: Simplify number

2014-05-29 Thread SiL588 .
I'm sorry I wasn't clear, as I said I just started using Sage and I thought that was what the simplify method was for. Thank you very much for your explanation, now I got it :) Il giorno giovedì 29 maggio 2014 18:53:23 UTC+2, Dominique Laurain ha scritto: We get in trouble with your question,

Re: [sage-support] Re: Simplify number

2014-05-29 Thread SiL588 .
Okay, thank you very much! :) Il giorno giovedì 29 maggio 2014 18:57:45 UTC+2, William ha scritto: If you just want to safely print numbers with the trailing zeros removed, used strip: a = 12.00 b = 0.8 str(a).rstrip('0') str(b).rstrip('0') -- You received this

[sage-support] Re: Simplify code generated by sympy for complex expressions

2014-05-22 Thread stuff
Hi, excellent! Thank you very much! Joa Den onsdagen den 21:e maj 2014 kl. 17:12:51 UTC+2 skrev Dima Pasechnik: On 2014-05-21, st...@joa.me.uk javascript: st...@joa.me.ukjavascript: wrote: Hi, it is a system of resitors and capacitors. I can in principle do a bit of math and

[sage-support] Re: Simplify code generated by sympy for complex expressions

2014-05-21 Thread Dima Pasechnik
On 2014-05-21, st...@joa.me.uk st...@joa.me.uk wrote: Hi all, I use sage to solve a system of equations describing and electronical filter. I then use sympy and codegen to generate c code that I use in my main code written in c. This works almost like a charm, expept that it produces

[sage-support] Re: Simplify code generated by sympy for complex expressions

2014-05-21 Thread Harald Schilly
Hi, I haven't looked into that file, but maybe you should try to solve and simplify the equations directly in sympy? There is also a group for sympy, maybe they can help you streamlining this, too. https://groups.google.com/forum/#!forum/sympy Harald -- You received this message because you

[sage-support] Re: Simplify code generated by sympy for complex expressions

2014-05-21 Thread stuff
Den onsdagen den 21:e maj 2014 kl. 13:28:54 UTC+2 skrev Dima Pasechnik: On 2014-05-21, st...@joa.me.uk javascript: st...@joa.me.ukjavascript: wrote: Hi all, I use sage to solve a system of equations describing and electronical filter. I then use sympy and codegen to generate c

[sage-support] Re: Simplify code generated by sympy for complex expressions

2014-05-21 Thread Dima Pasechnik
On 2014-05-21, st...@joa.me.uk st...@joa.me.uk wrote: Den onsdagen den 21:e maj 2014 kl. 13:28:54 UTC+2 skrev Dima Pasechnik: On 2014-05-21, st...@joa.me.uk javascript: st...@joa.me.ukjavascript: wrote: Hi all, I use sage to solve a system of equations describing and electronical

[sage-support] Re: Simplify code generated by sympy for complex expressions

2014-05-21 Thread stuff
Hi, it is a system of resitors and capacitors. I can in principle do a bit of math and calculate Ztotal of my circuit. And calculate Itotal. From this I can get the current I want by repeated current splitting in parallel impedances. I have tried this as well. The results are the same. The

[sage-support] Re: Simplify code generated by sympy for complex expressions

2014-05-21 Thread Dima Pasechnik
On 2014-05-21, st...@joa.me.uk st...@joa.me.uk wrote: Hi, it is a system of resitors and capacitors. I can in principle do a bit of math and calculate Ztotal of my circuit. And calculate Itotal. From this I can get the current I want by repeated current splitting in parallel impedances. I

[sage-support] Re: Simplify expression with hyperbolic functions

2014-03-20 Thread Eric Gourgoulhon
Hi, I do not see any simple way to do this in Sage at the moment. Following this posthttps://doxdrum.wordpress.com/2011/01/23/sage-tip-rewriting-expressions/, a workaround is to use the extension rewrite() written by François Maltey (see here http://wiki.sagemath.org/symbolics/rewrite for

Re: [sage-support] Re: simplify problem

2011-07-08 Thread Francois Maltey
John Cremona describes an use of the algebraic QQbar domain : Then I test a=sqrt(2)-sqrt(3) b=sqrt(3)-sqrt(2) QQbar(a).minpoly() ; QQbar(b).minpoly() # seems right. The same even polynom. But the test and the numerical values are True. I get +0.31 in both cases. QQbar(a)==QQbar(b) This

[sage-support] Re: simplify problem

2011-07-07 Thread John Cremona
With d=c-a, not even d.simplify_radical() gives 0. Simplifying nested radicals is a notoriously hard problem in symbolic computer algebra. As this example shows (unless there are other tricks to try which I do not know about), Sage's symbolic system is not up to examples like this. As an

Re: [sage-support] Re: simplify problem

2011-07-07 Thread robin hankin
Hello John thank you for this. I tried the same thing on mathematica, which managed to simplify 'c' back to 'a'. I don't quite understand the culture of sage-support yet. Is commenting on mathematica's ability to do a particular task a useful thing to say? Or does it just annoy everyone? best

[sage-support] Re: simplify ans sqrt

2011-01-26 Thread luisfe
On Jan 26, 8:42 am, Loïc xl...@free.fr wrote: Hello list, Version: sage 4.6.1 I'm quite a newbie with Sage but I'm really impressed this powerful software. Since an hour, I'm on a stupid problem: sage: sqrt(2)*sqrt(3) sqrt(2)*sqrt(3) sage: sqrt(2)*sqrt(3)-sqrt(6) sqrt(2)*sqrt(3)-sqrt(6)

[sage-support] Re: simplify and sqrt

2011-01-26 Thread Johan Grönqvist
2011-01-26 09:14, Minh Nguyen skrev: On Wed, Jan 26, 2011 at 6:41 PM,xl...@free.fr wrote: sage: sqrt(2)*sqrt(3)-sqrt(6) sqrt(2)*sqrt(3)-sqrt(6) I would expect results sqrt(6) and 0... I try with the command simplify() but it doesn't do anything. In the above Sage session, you declared two

[sage-support] Re: simplify using an assumption

2010-01-22 Thread kcrisman
On Jan 22, 3:48 pm, Michael Beeson profbee...@gmail.com wrote: after declaring variables make these definitions sage: a = Z - Z^-1 sage: b = L - L^-1 sage: c = Z^2L-Z^-2L^-1 sage: f = (p*a + q*b + r *c) *a + (n*a + m *b  + l*c) * a*b Now I can tell it assume(Z^3 * L^2 == -1)    but I

[sage-support] Re: simplify

2009-09-11 Thread Laurent
lastras ha scritto: Sage is unable to simplify the following expression to zero: log( (a-1)/a ) - log(a-1) + log(a) I have tried assuming a1 but that does not work. Help will be appreciated. Tanks! (log( (a-1)/a ) - log(a-1) + log(a)).full_simplify() works for me. By the way, I

[sage-support] Re: simplify

2009-09-11 Thread Tim Lahey
On Sep 11, 2009, at 6:21 PM, Laurent wrote: By the way, I have a question which is far away from Sage : in the sentence Help will be appreciated. Is appreciated a false-friend for the French expression appréciée ? Can one use appreciated in English in that context ? Appreciated

[sage-support] Re: simplify

2009-09-11 Thread John H Palmieri
On Sep 11, 3:21 pm, Laurent moky.m...@gmail.com wrote: lastras ha scritto: Help will be appreciated. Tanks! By the way, I have a question which is far away from Sage : in the sentence Help will be appreciated. Is appreciated a false-friend for the French expression appréciée ? I'm

[sage-support] Re: simplify

2009-09-11 Thread kcrisman
Is appreciated a false-friend for the French expression appréciée ? I'm not sure what false-friend means here. Appreciated is an German has this expression too for the concept. I think that false cognate is the usual English term. - kcrisman

[sage-support] Re: Simplify an expression

2009-07-21 Thread Simon King
Hi Roland, On 21 Jul., 06:33, Rolandb rola...@planet.nl wrote: Hi, How to simplify an expression if you have some known relations (equalities)? Example: relation: 0 = a*x1^2 + b*x2^2 expression = (a*x1^2 + b*x2^2)*y1+b*y2^3 Are all your relations polynomial? Then the standard solution is

[sage-support] Re: Simplify an expression

2009-07-21 Thread Stan Schymanski
Hi Roland, Would this help? sage: var ('a b x1 x2 y1 y2') (a, b, x1, x2, y1, y2) sage: expression = (a*x1^2 + b*x2^2)*y1 + b*y2^2 sage: expression.subs_expr((a*x1^2 + b*x2^2) == 0) b*y2^2 Stan Rolandb wrote: Hi, How to simplify an expression if you have some known relations (equalities)?

[sage-support] Re: Simplify an expression

2009-07-21 Thread Rolandb
Simon, thanks! But in general there is no (Sage) algoritm to simplify expressions given some equalities? Rolandb On 21 jul, 08:05, Simon King simon.k...@uni-jena.de wrote: Hi Roland, On 21 Jul., 06:33, Rolandb rola...@planet.nl wrote: Hi, How to simplify an expression if you have

[sage-support] Re: Simplify

2008-12-25 Thread David Joyner
sage: a = (-2*sqrt(2)*I - 2)/2 sage: a.simpl a.simplify a.simplify_full a.simplify_radical a.simplify_trig a.simplify_exp a.simplify_log a.simplify_rational sage: a.simplify_full() -sqrt(2)*I - 1 On Thu, Dec 25, 2008 at 6:35 AM, H.S.Rai hardeep@gmail.com wrote: