{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "This section describes the available solvers that can be selected by the 'method' parameter. The default method is the "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "\"Bounded\""
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " Brent method if "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "bounds"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " are passed and unbounded "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "\"Brent\""
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " otherwise."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Method "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "Brent <optimize.minimize_scalar-brent>",
              "domain": null,
              "role": "ref",
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " uses Brent's algorithm "
            },
            {
              "__type": "FootnoteReference",
              "__tag": 4066,
              "label": "1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " to find a local minimum.  The algorithm uses inverse parabolic interpolation when possible to speed up convergence of the golden section method."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Method "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "Golden <optimize.minimize_scalar-golden>",
              "domain": null,
              "role": "ref",
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " uses the golden section search technique "
            },
            {
              "__type": "FootnoteReference",
              "__tag": 4066,
              "label": "1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". It uses analog of the bisection method to decrease the bracketed interval. It is usually preferable to use the "
            },
            {
              "__type": "Emphasis",
              "__tag": 4047,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Brent"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " method."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Method "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "Bounded <optimize.minimize_scalar-bounded>",
              "domain": null,
              "role": "ref",
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " can perform bounded minimization "
            },
            {
              "__type": "FootnoteReference",
              "__tag": 4066,
              "label": "2"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " "
            },
            {
              "__type": "FootnoteReference",
              "__tag": 4066,
              "label": "3"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". It uses the Brent method to find a local minimum in the interval x1 < xopt < x2."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Note that the Brent and Golden methods do not guarantee success unless a valid "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "bracket"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " triple is provided. If a three-point bracket cannot be found, consider "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "scipy.optimize.minimize",
              "reference": {
                "__type": "RefInfo",
                "__tag": 4000,
                "module": "scipy",
                "version": "*",
                "kind": "api",
                "path": "scipy.optimize._minimize:minimize"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". Also, all methods are intended only for local minimization. When the function of interest has more than one local minimum, consider "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "global_optimization",
              "domain": null,
              "role": "ref",
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Strong",
              "__tag": 4048,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Custom minimizers"
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "It may be useful to pass a custom minimization method, for example when using some library frontend to minimize_scalar. You can simply pass a callable as the "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "method"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " parameter."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The callable is called as "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "method(fun, args, **kwargs, **options)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " where "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "kwargs"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " corresponds to any other parameters passed to "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "minimize",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " (such as "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "bracket"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "tol"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", etc.), except the "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "options"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " dict, which has its contents also passed as "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "method"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " parameters pair by pair.  The method shall return an "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "OptimizeResult",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "scipy.optimize._optimize:OptimizeResult"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " object."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The provided "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "method"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " callable must be able to accept (and possibly ignore) arbitrary parameters; the set of parameters accepted by "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "minimize",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " may expand in future versions and then these parameters will be passed to the method. You can find an example in the scipy.optimize tutorial."
            }
          ]
        },
        {
          "__type": "Admonition",
          "__tag": 4056,
          "kind": "versionadded",
          "base_type": "neutral",
          "children": [
            {
              "__type": "AdmonitionTitle",
              "__tag": 4055,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "versionadded 0.11.0"
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Raises": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Yields": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Methods": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Returns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "res",
              "annotation": "OptimizeResult",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The optimization result represented as a "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "OptimizeResult"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " object. Important attributes are: "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "x"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " the solution array, "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "success"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " a Boolean flag indicating if the optimizer exited successfully and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "message"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " which describes the cause of the termination. See "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "OptimizeResult",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "module",
                        "path": "scipy.optimize._optimize:OptimizeResult"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " for a description of other attributes."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Local minimization of scalar function of one variable."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Receives": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warnings": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Attributes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "fun",
              "annotation": "callable",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Objective function. Scalar function, must return a scalar."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Suppose the callable has signature "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "f0(x, *my_args, **my_kwargs)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", where "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "my_args"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "my_kwargs"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " are required positional and keyword arguments. Rather than passing "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "f0"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " as the callable, wrap it to accept only "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "x"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "; e.g., pass "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "fun=lambda x: f0(x, *my_args, **my_kwargs)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " as the callable, where "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "my_args"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " (tuple) and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "my_kwargs"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " (dict) have been gathered before invoking this function."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "bracket",
              "annotation": "sequence, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "For methods 'brent' and 'golden', "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "bracket"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " defines the bracketing interval and is required. Either a triple "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "(xa, xb, xc)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " satisfying "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "xa < xb < xc"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "func(xb) < func(xa) and  func(xb) < func(xc)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", or a pair "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "(xa, xb)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " to be used as initial points for a downhill bracket search (see "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "scipy.optimize.bracket",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": "scipy",
                        "version": "*",
                        "kind": "api",
                        "path": "scipy.optimize._optimize:bracket"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "). The minimizer "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "res.x"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " will not necessarily satisfy "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "xa <= res.x <= xb"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "bounds",
              "annotation": "sequence, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "For method 'bounded', "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "bounds"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is mandatory and must have two finite items corresponding to the optimization bounds."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "args",
              "annotation": "tuple, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Extra arguments passed to the objective function."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "method",
              "annotation": "str or callable, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Type of solver.  Should be one of:"
                    }
                  ]
                },
                {
                  "__type": "BulletList",
                  "__tag": 4053,
                  "ordered": false,
                  "start": 1,
                  "children": [
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineRole",
                              "__tag": 4003,
                              "value": "Brent <optimize.minimize_scalar-brent>",
                              "domain": null,
                              "role": "ref",
                              "inventory": null
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineRole",
                              "__tag": 4003,
                              "value": "Bounded <optimize.minimize_scalar-bounded>",
                              "domain": null,
                              "role": "ref",
                              "inventory": null
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineRole",
                              "__tag": 4003,
                              "value": "Golden <optimize.minimize_scalar-golden>",
                              "domain": null,
                              "role": "ref",
                              "inventory": null
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "custom - a callable object (added in version 0.14.0), see below"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Default is \"Bounded\" if bounds are provided and \"Brent\" otherwise. See the 'Notes' section for details of each solver."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "tol",
              "annotation": "float, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Tolerance for termination. For detailed control, use solver-specific options."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "options",
              "annotation": "dict, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "A dictionary of solver options."
                    }
                  ]
                },
                {
                  "__type": "DefList",
                  "__tag": 4033,
                  "children": [
                    {
                      "__type": "DefListItem",
                      "__tag": 4037,
                      "dt": {
                        "__type": "Paragraph",
                        "__tag": 4045,
                        "children": [
                          {
                            "__type": "Text",
                            "__tag": 4046,
                            "value": "maxiter"
                          }
                        ]
                      },
                      "dd": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "maxiter"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "DefListItem",
                      "__tag": 4037,
                      "dt": {
                        "__type": "Paragraph",
                        "__tag": 4045,
                        "children": [
                          {
                            "__type": "Text",
                            "__tag": 4046,
                            "value": "disp"
                          }
                        ]
                      },
                      "dd": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "disp"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "See "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "show_options()",
                      "domain": null,
                      "role": "func",
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " for solver-specific options."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Other Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    }
  },
  "_ordered_sections": [
    "Summary",
    "Extended Summary",
    "Parameters",
    "Attributes",
    "Methods",
    "Returns",
    "Yields",
    "Receives",
    "Other Parameters",
    "Raises",
    "Warns",
    "Warnings",
    "Notes"
  ],
  "item_file": "/scipy/optimize/_minimize.py",
  "item_line": 831,
  "item_type": "function",
  "aliases": [
    "scipy.optimize.minimize_scalar"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "Consider the problem of minimizing the following function.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "def f(x):\n    return (x - 2) * x * (x + 2)**2\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nUsing the *Brent* method, we find the local minimum as:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "from scipy.optimize import minimize_scalar\nres = minimize_scalar(f)\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "res.fun\n",
        "execution_status": "failure"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nThe minimizer is:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "res.x\n",
        "execution_status": "failure"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nUsing the *Bounded* method, we find a local minimum with specified\nbounds as:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "res = minimize_scalar(f, bounds=(-3, -1), method='bounded')\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "res.fun  # minimum\nres.x  # minimizer\n",
        "execution_status": "failure"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "minimize",
        "reference": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "current-module",
          "version": "current-version",
          "kind": "to-resolve",
          "path": "minimize"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Interface to minimization algorithms for scalar multivariate functions"
            }
          ]
        }
      ],
      "type": null
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "show_options",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.optimize._optimize:show_options"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Additional options accepted by the solvers"
            }
          ]
        }
      ],
      "type": null
    }
  ],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "fun",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "bracket",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "bounds",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "args",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "()"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "method",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "tol",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "options",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "minimize_scalar"
  },
  "references": [
    ".. [1] Press, W., S.A. Teukolsky, W.T. Vetterling, and B.P. Flannery.",
    "       Numerical Recipes in C. Cambridge University Press.",
    ".. [2] Forsythe, G.E., M. A. Malcolm, and C. B. Moler. \"Computer Methods",
    "       for Mathematical Computations.\" Prentice-Hall Series in Automatic",
    "       Computation 259 (1977).",
    ".. [3] Brent, Richard P. Algorithms for Minimization Without Derivatives.",
    "       Courier Corporation, 2013."
  ],
  "qa": "scipy.optimize._minimize:minimize_scalar",
  "arbitrary": [],
  "local_refs": [
    "args",
    "bounds",
    "bracket",
    "fun",
    "method",
    "options",
    "res",
    "tol"
  ]
}