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_equality_approximated(self):
      # Minimize with method='SLSQP': equality constraint, approx. jacobian.
      jacs = [None, False, "2-point", "3-point"]
      for jac in jacs:
          res = minimize(
              self.fun,
              [-1.0, 1.0],
              args=(-1.0,),
              jac=jac,
              constraints={
                  "type": "eq",
                  "fun": self.f_eqcon,
                  "args": (-1.0,),
              },
              method="SLSQP",
              options=self.opts,
          )
          assert_(res["success"], res["message"])
          assert_allclose(res.x, [1, 1])
  
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 17 for calling the TestSLSQP obj's underlying member method code with example usage: obj.test_minimize_equality_approximated() without return types