stars83clouds
stars83clouds

Reputation: 836

Solving a system of non-linear equations

I am attempting to solve a system of non-linear equations of the form below, using numpy:

a(y-2.7)(1-exp(-a*z)) = (x-2.7)(1-exp(-z)) 
b(w-2.7)(1-exp(-b*z)) = (x-2.7)(1-exp(-z)) 
c(w-2.7)(1-exp(-b*z)) = (y-2.7)(1-exp(-a*z)
d([y+w]/2-2.7)(1-exp(-d*z)) = (x-2.7)(1-exp(-z))

Obviously there are as many equations as unknowns in the system. The values a,b,c,d are constants for the system above. This is the simplest system, there will be more equations in other cases. The solutions to these equations have a similar order of magnitude and so I am aware that the Levenberg-Marquardt algorithm can be used to solve the system given a set of initial values for the unknown values. I am sure that scipy.optimize can be used with default values all 1s for the unknowns w,x,y,z.

Upvotes: 0

Views: 436

Answers (1)

philE
philE

Reputation: 1703

SciPy has a set of nonlinear solvers that would probably work for your application. They are part of scipy.optimize and are specifically designed for nonlinear systems. The documentation can be found here. For an in-depth discussion of how to use the solvers, see the previous S.O. discussion on the topic here.

Upvotes: 1

Related Questions