I am trying to simultaneously solve a system of equations. The equations themselves are found by calculating the gradient of a function with some variables. I am using sympy and here is the code:
from sympy import *
m = Matrix(symbols('a b c', positive = True))
y = 4*log(m[0]) + 4*log(m[1]) + 4*log(m[2]) - 2*log(m[1] + m[2]) \
- 2*log(m[0] + m[2]) - 2*log(m[0] + m[1]) - 6*log(m[0] + m[1] + m[2])
s = [diff(y, i) for i in m]
solve(s,m)
However I am getting the following error: "raise NotImplementedError('could not solve %s' % eq2)"
Can somebody please help me in solving this. Or there some other way in which I can calculate a bunch of gradients and then solve the system of equations obtained? I am fine with getting a numerical approximation and if multiple solutions are present, even one solution will be sufficient.
EDIT I understand that he objective that I have in the code shown above will have symmetric gradients. So here I am looking for a solution like (1,1,1) or (2,2,2). But in actual implementation, my objective function will have gradients that are not symmetric. So in a way I need to know the ratio between them.