Maxima: replace conjugate product by squared absolute value -
i have expression several products like: a*conjugate(a). how ask maxima replace them cabs(a)^2 ?
thanks in advance
one way switch polarform
. adjust p(e)
declare([a, b, c], complex); e: a*conjugate(a) + b^2*conjugate(b)^2 + c; /* apply `polarform' if `p(e)' true */ p(e):=member(e, ['a, 'b]); polarform0(e):=if p(e) polarform(e) else e; scanmap(polarform0, e);
ouputs:
c+abs(b)^4+abs(a)^2$
Comments
Post a Comment