sympy printing inverse

11 views
Skip to first unread message

andreic...@gmail.com

unread,
Oct 5, 2017, 10:46:36 AM10/5/17
to sympy
Dear all,

First of all, hello, since I'm new here and congratulations for making the best Python CAS a reality!

My question is,
If I define
expr = sym.Mul(sym.Pow(sym.Symbol('u1'), sym.Integer(-1)), sym.Symbol('u2'), sym.Symbol('u3'))

then str(expr) will return 'u2*u3/u1'

However, since I need to plug expr into PHCpy, a nonlinear equation solver, I need it to be in the form
u1**(-1)*u2*u3, ie division is not accepted, only negative exponents.

Is there a sympy printer that would return what I want, or if not, how can I go about this?

Thanks,
Andrei
Reply all
Reply to author
Forward
0 new messages