
linspace ( - 10, 4, 21 ) obj = for x3 in x3_guesses : # Solve the constraints to determine x1 and x2 x1, x2 = constraints ( x3 ) # Calculate the store the objective function value obj. solve ( A, b ) x1 = z x2 = z return x1, x2 # Define a lambda function to plot the objective objective = lambda x1, x2, x3 : x1 ** 2 + 2 * x2 ** 2 - x3 # Guess many values of x3. array () # Solve the linear system of equations z = np. Import numpy as np import matplotlib.pyplot as plt def constraints ( x3 ): ''' Solve the linear constraints Args: x3: Value for the decision variable x3 Returns: x1 and x2: Values calculated from the constraints ''' # Define the matrices in the above equations A = np. Total CPU secs in NLP function evaluations = 0.000 Total CPU secs in IPOPT (w/o function evaluations) = 0.002 Number of Lagrangian Hessian evaluations = 6

Number of inequality constraint Jacobian evaluations = 0 Number of equality constraint Jacobian evaluations = 7 Number of inequality constraint evaluations = 0 Number of equality constraint evaluations = 7 Number of objective gradient evaluations = 7 Number of objective function evaluations = 7 Inequality constraints with only upper bounds: 0 Inequality constraints with lower and upper bounds: 0 Inequality constraints with only lower bounds: 0 Total number of inequality constraints.: 0 Number of nonzeros in Lagrangian Hessian.: 2

Number of nonzeros in inequality constraint Jacobian.: 0 Number of nonzeros in equality constraint Jacobian.: 5 This is Ipopt version 3.13.2, running with linear solver ma27.
#Conda install package inequality version code
Ipopt is released as open source code under the Eclipse Public License (EPL). This program contains Ipopt, a library for large-scale nonlinear optimization.
