So I know there have been plenty of questions/answers on this topic, but I haven't been able to locate exactly what is going wrong in my attempts. I have two nonlinear function f(x,y)
and g(x,y)
and I am trying to solve the system
f(x,y) - g(x,y) = 0
f(x,y) + g(x,y) = c
where c
is some positive constant. I have been using the snippet described in the answer to this question: How to solve a pair of nonlinear equations using Python?, but I am facing issues. If I run that snippet for my code, it returns the x
and y
values such that only the second equation in the system is satisfied, i.e. it returns x
and y
such that f(x,y) + g(x,y) = c
, while for the other equation it holds that f(x,y) - g(x,y) != 0
. I get the exact same issues when using the scipy.optimize.root
function. I'm quite lost as to what could be causing this issue. Could it mean that there do not exist x, y
such that both equations are satisfied?
Thanks in advance for any help!