python system of nonlinear equations

Solutions on MaxInterview for python system of nonlinear equations by the best coders in the world

showing results for - "python system of nonlinear equations"
Rafael
16 Aug 2016
1import scipy.optimize as opt
2from numpy import exp
3
4def f(variables) :
5    (x,y) = variables
6    first_eq = x + y**2 - 4
7    second_eq = exp(x) + x*y - 3
8    return [first_eq, second_eq]
9
10solution = opt.fsolve(f, (0.1, 1)) # fsolve(equations, X_0)
11print(solution)
12
13# [ 0.62034452  1.83838393]