python - Sympy factor out from a matrix -
i have matrix
dk =matrix([[op],[0],[-o]]) dk*2
i cannot factor out factor 2
using factor(dk*2)
or simplify(dk*2)
no luck.
i not quite sure in context using these expressions. greater problem trying solve? looking along lines of:
>>> op,o = symbols('op o') >>> dk =matrix([[2*op],[o+op**2],[-op/o]]) >>> print([[cell.as_coeff_exponent(op) cell in row] row in dk.tolist()]) [[(2, 1)], [(o + op**2, 0)], [(-1/o, 1)]]
i assume not trying achieve, maybe it's start?
Comments
Post a Comment