pysolver_view.optimization.problems.constrained_rosenbrock module#
- class pysolver_view.optimization.problems.constrained_rosenbrock.RosenbrockProblemConstrained(dim)[source]#
Bases:
OptimizationProblemImplementation of the Chained Rosenbrock function with trigonometric-exponential constraints.
This problem is also referred to as Example 5.1 in the report by Luksan and Vlcek. The optimization problem is described as:
\[\begin{split}\begin{align} \text{minimize} \quad & \sum_{i=1}^{n-1}\left[100\left(x_i^2-x_{i+1}\right)^2 + \left(x_i-1\right)^2\right] \\ \text{s.t.} \quad & 3x_{k+1}^3 + 2x_{k+2} - 5 + \sin(x_{k+1}-x_{k+2})\sin(x_{k+1}+x_{k+2}) + \\ & + 4x_{k+1} - x_k \exp(x_k-x_{k+1}) - 3 = 0, \; \forall k=1,...,n-2 \\ & -5 \le x_i \le 5, \forall i=1,...,n \end{align}\end{split}\]Methods
evaluate_problem(x):
Compute objective, equality, and inequality constraint.
get_bounds():
Return variable bounds.
get_n_eq():
Get number of equality constraints.
get_n_ineq():
Get number of inequality constraints.
References
Luksan, L., and Jan Vlcek. “Sparse and partially separable test problems for unconstrained and equality constrained optimization.” (1999). doi: link provided.
- fitness(x)[source]#
Evaluate the objective function and constraints for given decision variables.
- Parameters:
- xarray-like
Vector of independent variables (i.e., degrees of freedom).
- Returns:
- array_like
Vector containing the objective function, equality constraints, and inequality constraints.
- get_bounds()[source]#
Get the bounds for each decision variable (Pygmo format)
- Returns:
- boundstuple of lists
A tuple of two items where the first item is the list of lower bounds and the second item of the list of upper bounds for the vector of decision variables. For example, ([-2 -1], [2, 1]) indicates that the first decision variable has bounds between -2 and 2, and the second has bounds between -1 and 1.
- get_nec()[source]#
Return the number of equality constraints associated with the problem.
- Returns:
- neqint
Number of equality constraints.