Hello. Indeed, I just want to define complex number via the algebraic form z=a+i*b.
expr.simplify_real() will be a great tool. I will be patient... *Christophe BAL* *Enseignant de mathématiques en Lycée **et développeur Python amateur* *---* *French math teacher in a "Lycée" **and **Python **amateur developer* 2015-01-29 23:50 GMT+01:00 Michael Orlitzky <mich...@orlitzky.com>: > On 01/28/2015 03:56 PM, Christophe Bal wrote: > > Hello. > > > > How can I define a symbolic variable that is a real number ? Therer is an > > optional argument real in the latest versions of Sympy but this not work > in > > Sage. > > > > There isn't much support for declaring a variable real in Sage. By > default every variable is complex, but there are some operations that > will treat them as real. > > We have three ways to "declare" a variable real but they're all weird: > > * assume(x, 'real') > * x = SR.var('x', domain='real') > * Set the maxima simplification domain to real through some backdoor > > I don't know what (if anything) the second one does. The first allows > Maxima to make some simplifications it otherwise couldn't. The third > lets sqrt(x^2) be equal to abs(x) but there's no easy way to do it. And > even though #1 and #3 both use Maxima, #3 doesn't imply #1. > > In the next release you'll be able to do expr.simplify_real() and have > it do #1 #2 and #3 all at once along with simplify_log(). > > So really what we need to know is, why do you want to declare a real > variable? You might be better served by a polynomial ring or some linear > algebra thing. > > -- > You received this message because you are subscribed to the Google Groups > "sage-support" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-support+unsubscr...@googlegroups.com. > To post to this group, send email to sage-support@googlegroups.com. > Visit this group at http://groups.google.com/group/sage-support. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.