| 1 | initial version |
I'm not getting access to rectform as part of the object A here. This is a maxima command so you might have some other code that is giving you that access. Anyhow, the following works for me:
var('A x')
assume(A,"complex")
ar=real_part(A)+I*imag_part(A)
ar.subs(real_part(A)==x)
x + I*imag_part(A)
Also, the substitution with a dictionary works for me.
ar.subs({real_part(A):x})
x + I*imag_part(A)
| 2 | update to reflect different sage versions |
In Sage 5.0, I'm not getting access to rectform as part of the object A here. This is a maxima command so you might have some other code that is giving you that access. Anyhow, the The following works for me:
var('A x')
assume(A,"complex")
ar=real_part(A)+I*imag_part(A)
ar.subs(real_part(A)==x)
x + I*imag_part(A)
Also, the substitution with a dictionary works for me.
ar.subs({real_part(A):x})
x + I*imag_part(A)
In Sage 5.3, I'm getting access to rectform, and I have the difficulty you are having with realpart. I think it's got to be the difference between realpart and real_part.
Perhaps someone here as insight into the differences.
| 3 | No.3 Revision |
In Sage 5.0, I'm not getting access to rectform as part of the object A here. The following works for me:
var('A x')
assume(A,"complex")
ar=real_part(A)+I*imag_part(A)
ar.subs(real_part(A)==x)
x + I*imag_part(A)
Also, the substitution with a dictionary works for me.
ar.subs({real_part(A):x})
x + I*imag_part(A)
In Sage 5.3, I'm getting access to rectform, and I have the difficulty you are having with realpart. I think it's got to be the difference between realpart and real_part.
Perhaps someone here as has insight into the differences.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.