Apr-21-2020, 10:24 PM
I'm a beginner and trying to solve this system of non-linear equations, would appreciate any guidance. The attached image shows the system of equations I want to solve:
Image of equations
This is the code I tried:
from scipy.optimize import fsolve import math as m import numpy as np
def equations(p): x, y = p return ((3*(x2+y2))-1*(x*(x2+y2+2.25)*np.sinh((4*m.piym.e4)/466)+3*x*m.cosh((4*m.piym.e4)/466)+y*(x2+y2-2.25)*m.sin((4*m.pixm.e4)/466)+3*y*m.cos((4*m.pixm.e4)/466))-31.176, 6*(x2+y2)-1*((1+x2+y2)*((x2+y2+2.25)*m.cosh((4*m.piym.e4)/466)+3*x*m.sinh((4*m.piym.e4)/466))+(1-x2-y2)*((x2+y2-2.25)*m.cos((4*m.pixm.e4)/466)-3*y*m.sin((4*m.pixm.e4)/466))-42.35)
(x,y) = fsolve(equations,(1, 1))
print (equations((x, y)))
Image of equations
This is the code I tried:
from scipy.optimize import fsolve import math as m import numpy as np
def equations(p): x, y = p return ((3*(x2+y2))-1*(x*(x2+y2+2.25)*np.sinh((4*m.piym.e4)/466)+3*x*m.cosh((4*m.piym.e4)/466)+y*(x2+y2-2.25)*m.sin((4*m.pixm.e4)/466)+3*y*m.cos((4*m.pixm.e4)/466))-31.176, 6*(x2+y2)-1*((1+x2+y2)*((x2+y2+2.25)*m.cosh((4*m.piym.e4)/466)+3*x*m.sinh((4*m.piym.e4)/466))+(1-x2-y2)*((x2+y2-2.25)*m.cos((4*m.pixm.e4)/466)-3*y*m.sin((4*m.pixm.e4)/466))-42.35)
(x,y) = fsolve(equations,(1, 1))
print (equations((x, y)))