Say I have an expression that I know is quadratic in u1, u2, u3: expr = k00*u1**2 + k01*u1*u2 + k02*u1*u3 + k10*u1*u2 + k11*u2**2 + k12*u2*u3 + k20*u1*u3 + k21*u2*u3 + k22*u3**2
Is there a simple way to transform this into: expr = u^T * K * u Where u = [u1, u2, u3]^T and K is a 3 x 3 matrix? I know I can expand the expression with respect to the u variables and pick off coefficients, but I was wondering if we happened to have anything implemented that doe this. Jason moorepants.info +01 530-601-9791 -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAP7f1AiYi1CeE%3D2yFX1GMfNmvi56PksinPYcN5AX%2B%2BEccFiHxg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
