{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "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": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Explicit Runge-Kutta method of order 3(2)."
            }
          ]
        }
      ],
      "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": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "n",
              "annotation": "int",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Number of equations."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "status",
              "annotation": "str",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Current status of the solver: 'running', 'finished' or 'failed'."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "t_bound",
              "annotation": "float",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Boundary time."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "direction",
              "annotation": "float",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Integration direction: +1 or -1."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "t",
              "annotation": "float",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Current time."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "y",
              "annotation": "ndarray",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Current state."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "t_old",
              "annotation": "float",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Previous time. None if no steps were made yet."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "step_size",
              "annotation": "float",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Size of the last successful step. None if no steps were made yet."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "nfev",
              "annotation": "int",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Number evaluations of the system's right-hand side."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "njev",
              "annotation": "int",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Number of evaluations of the Jacobian. Is always 0 for this solver as it does not use the Jacobian."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "nlu",
              "annotation": "int",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Number of LU decompositions. Is always 0 for this solver."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "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": "Right-hand side of the system: the time derivative of the state "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "y"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " at time "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "t"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". The calling signature is "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "fun(t, y)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", where "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "t"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is a scalar and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "y"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is an ndarray with "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "len(y) = len(y0)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "fun"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " must return an array of the same shape as "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "y"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". See "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "vectorized"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " for more information."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "t0",
              "annotation": "float",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Initial time."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "y0",
              "annotation": "array_like, shape (n,)",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Initial state."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "t_bound",
              "annotation": "float",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Boundary time - the integration won't continue beyond it. It also determines the direction of the integration."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "max_step",
              "annotation": "float, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Maximum allowed step size. Default is np.inf, i.e., the step size is not bounded and determined solely by the solver."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "rtol, atol",
              "annotation": "float and array_like, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Relative and absolute tolerances. The solver keeps the local error estimates less than "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "atol + rtol * abs(y)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". Here "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "rtol"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " controls a relative accuracy (number of correct digits), while "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "atol"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " controls absolute accuracy (number of correct decimal places). To achieve the desired "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "rtol"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", set "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "atol"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " to be smaller than the smallest value that can be expected from "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "rtol * abs(y)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " so that "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "rtol"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " dominates the allowable error. If "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "atol"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is larger than "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "rtol * abs(y)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " the number of correct digits is not guaranteed. Conversely, to achieve the desired "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "atol"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " set "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "rtol"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " such that "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "rtol * abs(y)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is always smaller than "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "atol"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". If components of y have different scales, it might be beneficial to set different "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "atol"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " values for different components by passing array_like with shape (n,) for "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "atol"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". Default values are 1e-3 for "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "rtol"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and 1e-6 for "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "atol"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "vectorized",
              "annotation": "bool, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Whether "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "fun"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " may be called in a vectorized fashion. False (default) is recommended for this solver."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "vectorized"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is False, "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "fun"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " will always be called with "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "y"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " of shape "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "(n,)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", where "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "n = len(y0)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "vectorized"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is True, "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "fun"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " may be called with "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "y"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " of shape "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "(n, k)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", where "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "k"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is an integer. In this case, "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "fun"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " must behave such that "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "fun(t, y)[:, i] == fun(t, y[:, i])"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " (i.e. each column of the returned array is the time derivative of the state corresponding with a column of "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "y"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ")."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Setting "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "vectorized=True"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " allows for faster finite difference approximation of the Jacobian by methods 'Radau' and 'BDF', but will result in slower execution for this solver."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "first_step",
              "annotation": "float or None, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Initial step size. Default is "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "None"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " which means that the algorithm should choose."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "**extraneous",
              "annotation": "",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Any additional keyword arguments will be ignored."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "This uses the Bogacki-Shampine pair of formulas "
            },
            {
              "__type": "FootnoteReference",
              "__tag": 4066,
              "label": "1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". The error is controlled assuming accuracy of the second-order method, but steps are taken using the third-order accurate formula (local extrapolation is done). A cubic Hermite polynomial is used for the dense output."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Can be applied in the complex domain."
            }
          ]
        }
      ],
      "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": "build-install/usr/lib/python3.14/site-packages/scipy/integrate/_ivp/rk.py",
  "item_line": 183,
  "item_type": "class",
  "aliases": [
    "scipy.integrate.RK23"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "This example demonstrates how to compute one period of a periodic\norbit in a two-dimensional dynamical system.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import numpy as np\nimport scipy.integrate as itg\nimport matplotlib.pylab as plt\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nDefine a function that returns the right-hand side of a dynamical\nsystem with a stable periodic orbit.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "def dynam_sys(t, x):\n    dx1_dt = 5*(1-x[1]**2)*x[0] - x[1]\n    dx2_dt = x[0]\n    return [dx1_dt, dx2_dt]\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nThe system has an equilibrium at the origin. Create a solver\nobject with an initial state slightly away from the\nequilibrium.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "solver = itg.RK45(dynam_sys, 0, [0.25,0.25], 1E200, max_step=0.05)\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nCreate an array in which to store the estimated solution.\nTo allow for concatenation of future states, initialize the array\nby reshaping the initial state.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "soly = solver.y.reshape(1, 2)\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nTo find a point on the periodic orbit, run the solver\nfor ``2000`` integration steps. Store the estimated states in\n``soly``.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "for i in range(2000):\n    solver.step()\n    solyn = solver.y.reshape(1, 2)\n    soly = np.concatenate((soly, solyn))\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nPlot ``soly`` with its first element in green and its final\nelement in magenta.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "plt.plot(soly[:,0], soly[:,1])\nplt.plot(soly[0,0], soly[0,1], \"go\")\nplt.plot(soly[-1,0], soly[-1,1], \"mo\")\n",
        "execution_status": "failure",
        "out": "[<matplotlib.lines.Line2D object at 0x7f3f687cae40>]\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "plt.show()\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Figure",
        "__tag": 4024,
        "value": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "scipy",
          "version": "2.0.0.dev0+git20260907.41eeb59",
          "kind": "assets",
          "path": "fig-dba818670c2cd6ee.png"
        }
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nThe plot shows that the last element in ``soly`` is located on a\nsegment of the periodic orbit where there is relatively little\nvariation in the estimated states. Create another solver and\ninitialize it with the last element in ``soly``.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "init = np.array([soly[-1,0], soly[-1,1]])\nPOsolver = itg.RK23(dynam_sys, 0, init, 5000, max_step=0.05)\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nCreate a variable that tracks the distance of the current\nestimated state from the initial state. Run ``POsolver`` until\nthe current estimated state is within ``0.005`` units of the last\nestimated state.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "dist_init = 1\nPOsoly = POsolver.y.reshape(1, 2)\nwhile dist_init > 0.005:\n    POsolver.step()\n    POsolyn = POsolver.y.reshape(1, 2)\n    POsoly = np.concatenate((POsoly, POsolyn))\n    dist_init = np.linalg.norm(init-POsolyn)\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nPlot ``POsoly`` with its initial element in green and its final\nelement in magenta.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "plt.plot(POsoly[:,0], POsoly[:,1])\nplt.plot(POsoly[0,0], POsoly[0,1], \"go\")\nplt.plot(POsoly[-1,0], POsoly[-1,1], \"mo\")\n",
        "execution_status": "failure",
        "out": "[<matplotlib.lines.Line2D object at 0x7f3f68ed3cb0>]\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "plt.show()\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Figure",
        "__tag": 4024,
        "value": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "scipy",
          "version": "2.0.0.dev0+git20260907.41eeb59",
          "kind": "assets",
          "path": "fig-e33aad381e18a367.png"
        }
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nThe plot shows approximately one period of the orbit.\nThe final and initial states are so close that the final\nstate marker obscures the initial state marker."
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "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": "t0",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "y0",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "t_bound",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "max_step",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "inf"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "rtol",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "0.001"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "atol",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "1e-06"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "vectorized",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "False"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "first_step",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "extraneous",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "VAR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "RK23"
  },
  "references": [
    ".. [1] P. Bogacki, L.F. Shampine, \"A 3(2) Pair of Runge-Kutta Formulas\",",
    "       Appl. Math. Lett. Vol. 2, No. 4. pp. 321-325, 1989."
  ],
  "qa": "scipy.integrate._ivp.rk:RK23",
  "arbitrary": [],
  "local_refs": [
    "**extraneous",
    "atol",
    "direction",
    "first_step",
    "fun",
    "max_step",
    "n",
    "nfev",
    "njev",
    "nlu",
    "rtol",
    "status",
    "step_size",
    "t",
    "t0",
    "t_bound",
    "t_old",
    "vectorized",
    "y",
    "y0"
  ]
}