Hello everybody!
Can I do calculations with complex numbers that are defined only by
symbols? Let's say I'd like to do the following:

sage: var("R1 X1 R2 X2")
sage: Z1 = R1 + X1*i
sage: Z2 = R2 + X2*i
sage: Z = Z1 + Z2
sage: print Z
sage: Z.imag()
R1 + R2 + I*X1 + I*X2
real_part(X1) + real_part(X2) + imag_part(R1) + imag_part(R2)

Now the imaginary part delivered by Z.imag() should be (X1 + X2)I.

How can I define my complex "number" in a way to achive this result?


Thanks,
tontaube

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to