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 indica

[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 group

[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, Dece

[sage-support] Re: simplify trigonomtric problem

2016-09-25 Thread slelievre
2016-09-25 13:33:52 UTC+2, Joan Pujol: > > hello, i was trying to simplify a trigonometric expression > and it didn’t work, can you help me please? my computer > uses the last IOS version > > > A=cos(x)^5+sin(x)^4+2*cos(x)^2-2*sin(x)^2-cos(2*x) > A.simplify_full() > > > Traceback (click to

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 insi

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 s

[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 > wrote: > > What is the way to consistently simplify square roots of squares? > > > > Examples: > > > >

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 cho

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

2015-02-27 Thread Simon King
Hi Paul, On 2015-02-27, Paul Royik 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 to x. Even under

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

[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 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 wrote: > We get in trouble with your question, because you used "simplify" > verb...whi

[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 : n

Re: [sage-support] Re: Simplify number

2014-05-29 Thread SiL588 .
Yes, but it works if i work with int numbers, if i have something like 0.80 I want it to be 0.8 and not 1 Il giorno giovedì 29 maggio 2014 18:04:06 UTC+2, William ha scritto: > > On Thu, May 29, 2014 at 8:59 AM, SiL588 . > > wrote: > > The output i have is this: > > > > 12.0

[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 num

[sage-support] Re: Simplify number

2014-05-29 Thread Simon King
Hi, On 2014-05-29, SiL588 . 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! I don't think it i

Re: [sage-support] Re: Simplify number

2014-05-29 Thread William Stein
On Thu, May 29, 2014 at 8:59 AM, SiL588 . 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: >> >> What exactl

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 . > > wrote: > >

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 . 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 value that was the

[sage-support] Re: Simplify number

2014-05-29 Thread SiL588 .
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 value that was the result of multiplication between real numbers. So, if a real number have no simplify methods, how can I simp

[sage-support] Re: Simplify number

2014-05-29 Thread Simon King
Hi! On 2014-05-29, SiL588 . 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 = var('m

[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 > > wrote: > > Hi, > > > > it is a system of resitors and capacitors. I can in principle do a bit > of > > math and calculate Ztotal of my cir

[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 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 have trie

[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 pro

[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 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 > >> wrote: >> > Hi all, >> > >> > I use sage to solve a system of equations describing and electronical >> > filter. I then use sympy and

[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 > > 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 > > m

[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 ar

[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 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 files that are

[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 post, a workaround is to use the extension rewrite() written by François Maltey (see here 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 me

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 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 algeb

[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, 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 symbolic expr

[sage-support] Re: simplify ans sqrt

2011-01-26 Thread luisfe
On Jan 26, 8:42 am, Loïc 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 using an assumption

2010-01-22 Thread kcrisman
On Jan 22, 3:48 pm, Michael Beeson 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 can't get it to

[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

2009-09-11 Thread John H Palmieri
On Sep 11, 3:21 pm, Laurent 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 no

[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

[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 a>1 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

[sage-support] Re: Simplify an expression

2009-07-21 Thread Simon King
Hi Roland, On 21 Jul., 14:54, Rolandb wrote: > Simon, thanks! You're welcome! > But in general there is no (Sage) algoritm to simplify expressions > given some equalities? If I remember correctly: If the equations are not polynomial but anything (e.g. "sin(x)*y=cos (z)" and so on) then one ca

[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 wrote: > Hi Roland, > > On 21 Jul., 06:33, Rolandb wrote: > > > Hi, > > How to simplify an expression if you have some known relations > > (equalitie

[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-20 Thread Simon King
Hi Roland, On 21 Jul., 06:33, Rolandb 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 to use Gröbn

[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 wrote: > > Can't simplify((-