class_docstr: Test SLSQP algorithm using Example 14.4 from Numerical Methods for
  Engineers by Steven Chapra and Raymond Canale.
  This example maximizes the function f(x) = 2*x*y + 2*x - x**2 - 2*y**2,
  which has a maximum at x=2, y=1.
class_docstr_tok: ["Test","SLSQP","algorithm","using","Example","14.4","from","Numerical","Methods","for","Engineers","by","Steven","Chapra","and","Raymond","Canale",".","This","example","maximizes","the","function","f","(","x",")","=","2","*","x","*","y","+","2","*","x","-","x","*","*","2","-","2","*","y","*","*","2",",","which","has","a","maximum","at","x=2",",","y=1","."]
code: def test_minimize_bounded_constraint(self):
      # when the constraint makes the solver go up against a parameter
      # bound make sure that the numerical differentiation of the
      # jacobian doesn't try to exceed that bound using a finite difference.
      # gh11403
      def c(x):
          assert 0 <= x[0] <= 1 and 0 <= x[1] <= 1, x
          return x[0] ** 0.5 + x[1]
  
      def f(x):
          assert 0 <= x[0] <= 1 and 0 <= x[1] <= 1, x
          return -x[0] ** 2 + x[1] ** 2
  
      cns = [NonlinearConstraint(c, 0, 1.5)]
      x0 = np.asarray([0.9, 0.5])
      bnd = Bounds([0.0, 0.0], [1.0, 1.0])
      minimize(f, x0, method="SLSQP", bounds=bnd, constraints=cns)
  
imports: from numpy.testing import assert_, assert_array_almost_equal, assert_allclose, assert_equal
  from pytest import raises
  import pytest
  import numpy
  from scipy.optimize import fmin_slsqp, minimize, Bounds, NonlinearConstraint
label_desc: Use image node_id 23 for calling the TestSLSQP obj's underlying member method code with example usage: obj.test_minimize_bounded_constraint() and returns: unknown, unknown