I would like to transform a set of symbolic linear equations in to a form like: {0} = [M]*{v} where {0} is vector of zeros, [M] is the matrix of variables and {v} is the vector of coefficients.
Just for the sake of presenting you my problem, I would like if anyone could help me to write my example in the desired form:
from sympy import*
init_printing()
a_0, a_1, a_2, x = symbols('a_0, a_1, a_2, x')
a_0 + a_1*x + a_2 * x**2
NOTE: I use LaTeX form, so in case you haven't got LaTeX installed, you should remove the init_printing().
So what I would like is to make a form like:
{a_0
{0} = [1 x x^2] * a_1
a_2}
In my case there will be a set of similar linear equations, but I would like to learn the idea or the functions that would allow me to transform a set of linear equations in to matrix form.