Package: pysolnp
See full documentation onhttp://solnp.readthedocs.io.pysolnp - Nonlinear optimization with the augmented Lagrange methodDescriptionSOLNP solves the general nonlinear optimization problem on the form:minimize f(x)
      subject to
       g(x) = e_x
   l_h <= h(x) <= u_h
   l_x <   x   < u_Xwhere f(x), g(x) and h(x) are smooth functions.CompatibilityPrecompiled Wheels are available for CPython:Windows: Python 3.6+Linux: Python 3.6+Mac OS: Python 3.6+For other systems, or to have BLAS and LAPACK support, please build the wheels manually.
Note: For best results, building it from source is recommended, as BLAS and LAPACK will make a difference.InstallationSimply install the package through PyPi with:pip install pysolnpWhen compiling from source code you will need CMake.See theREADME for the C++ codefor details.UsageBelow is the Box example, for the complete example see/python_examples/example_box.py.importpysolnpdeff_objective_function(x):return-1*x[0]*x[1]*x[2]defg_equality_constraint_function(x):return[4*x[0]*x[1]+2*x[1]*x[2]+2*x[2]*x[0]]x_starting_point=[1.1,1.1,9.0]x_l=[1.0,1.0,1.0]x_u=[10.0,10.0,10.0]e_x=[100]result=pysolnp.solve(obj_func=f_objective_function,par_start_value=x_starting_point,par_lower_limit=x_l,par_upper_limit=x_u,eq_func=g_equality_constraint_function,eq_values=e_x)result.solve_valueresult.optimumresult.callbacksresult.convergedOutput:>>> result.solve_value
-48.11252206814995
>>> result.optimum
[2.8867750707815447, 2.8867750713194273, 5.773407748939196]
>>> result.callbacks
118
>>> result.converged
TrueParametersThe basic signature is:solve(obj_func:function,par_start_value:List,par_lower_limit:object=None,par_upper_limit:object=None,eq_func:object=None,eq_values:object=None,ineq_func:object=None,ineq_lower_bounds:object=None,ineq_upper_bounds:object=None,rho:float=1.0,max_major_iter:int=10,max_minor_iter:int=10,delta:float=1e-05,tolerance:float=0.0001,debug:bool=False)->pysolnp.ResultInputs:ParameterTypeDefault value*Descriptionobj_funcCallable[List, float]-The objective function f(x) to minimize.par_start_valueList-The starting parameter x_0.par_lower_limitListNoneThe parameter lower limit x_l.par_upper_limitListNoneThe parameter upper limit x_u.eq_funcCallable[List, float]NoneThe equality constraint function h(x).eq_valuesListNoneThe equality constraint values e_x.ineq_funcCallable[List, float]NoneThe inequality constraint function g(x).ineq_lower_boundsListNoneThe inequality constraint lower limit g_l.ineq_upper_boundsListNoneThe inequality constraint upper limit g_l.rhofloat1.0Penalty weighting scalar for infeasability in the augmented objective function.**max_major_iterint400Maximum number of outer iterations.max_minor_iterint800Maximum number of inner iterations.deltafloat1e-07Step-size for forward differentiation.tolerancefloat1e-08Relative tolerance on optimality.debugboolFalseIf set to true some debug output will be printed.*Defaults for configuration parameters are based on the defaults for Rsolnp.**Higher values means the solution will bring the solution into the feasible region with higher weight. Very high values might lead to numerical ill conditioning or slow down convergence.Output:
The function returns thepysolnp.Resultwith the below properties.PropertyTypeDescriptionsolve_valuefloatThe value of the objective function at optimum f(x*).optimumList[float]A list of parameters for the optimum x*.callbacksintNumber of callbacks done to find this optimum.convergedbooleanIndicates if the algorithm converged or not.hessian_matrixList[List[float]]The final Hessian Matrix used by pysolnp.Use-cases and ApplicationsNMPC - Nonlinear model predictive controls-case studies using Matlab, REXYGEN and pysolnp NLP solver under Python environment by Štěpán Ožana.
[NMPC Overhead Crane (PDF)]
[GitHub Source Code]
[Štěpán's Homepage]AuthorsKrister S Jakobsson-Implementation-krister.s.jakobsson@gmail.comLicenseThis project is licensed under the Boost License - see thelicensefile for details.AcknowledgmentsYinyu Ye-  Publisher and mastermind behind the original SOLNP algorithm,Original SourcesAlexios Ghalanos and Stefan Theussl- The people behind RSOLNP,Github repositoryDavis King- The mastermind behind Dlib, check out his blog!Blog