{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet a [[one-step method|558XADG64M]] for $y' = f(t, y)$ come with an error estimator.\nFrom $t_n$, $y_n$ and a trial step $h$ it computes $y_{n+1}$ and a number $\\mathrm{err}_n \\ge 0$.\nThis number estimates the norm of the [[local truncation error|T220HF0562]] of the step, which behaves like $C h^{q+1}$ for some integer $q \\ge 1$.\nLet $\\mathrm{tol} \u003e 0$ be a tolerance, $0 \u003c \\rho \u003c 1$ a safety factor, and $0 \u003c \\alpha_{\\min} \u003c 1 \u003c \\alpha_{\\max}$ bounds.\n*Adaptive step size control* runs the method with steps chosen as follows.\n\n1. If $\\mathrm{err}_n \\le \\mathrm{tol}$, the step is accepted: $t_{n+1} = t_n + h$, and $y_{n+1}$ is kept.\n2. If $\\mathrm{err}_n \u003e \\mathrm{tol}$, the step is rejected and repeated from $t_n$.\n3. In both cases the next trial step is\n$$h_{\\mathrm{new}} = h \\cdot \\min\\Big(\\alpha_{\\max}, \\max\\Big(\\alpha_{\\min}, \\; \\rho \\, \\Big(\\frac{\\mathrm{tol}}{\\mathrm{err}_n}\\Big)^{1/(q+1)}\\Big)\\Big).$$\n\n## Remarks\n\nThe formula of clause 3 comes from $\\mathrm{err} \\approx C h^{q+1}$: the step $h'$ with $C h'^{q+1} = \\mathrm{tol}$ is $h (\\mathrm{tol}/\\mathrm{err})^{1/(q+1)}$, and $\\rho$, $\\alpha_{\\min}$, $\\alpha_{\\max}$ protect against a poor estimate.\nExample: with an embedded pair of orders $4$ and $5$ such as the [[Runge–Kutta–Fehlberg method|6D73FFD9DC]], $\\mathrm{err}_n = \\norm{\\hat y_{n+1} - y_{n+1}}$ and $q = 4$; if $\\mathrm{err}_n = 32\\,\\mathrm{tol}$ the step is rejected and, with $\\rho = 0.9$, retried with $h_{\\mathrm{new}} = 0.9 \\cdot 32^{-1/5} h = 0.45 h$.\nOther estimators use step doubling: compare one step of size $h$ with two steps of size $h/2$, as in [[Richardson extrapolation|WMTZG71K2Y]].\nNon-example: a schedule fixed in advance, such as $h_n = 2^{-n}$, varies the step but is not adaptive, since it ignores the error estimate.\nThe tolerance controls the local error per step; the global error is usually of a similar size but is not guaranteed to be below $\\mathrm{tol}$.\n\n## Explanations\n\n### L1 human\n\nAfter each step, the solver estimates how much error it just made.\nIf the error is too big, it throws the step away and tries again with a smaller one.\nIf it is small, it accepts the step and tries a larger one next time.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "6MREWBZR7R",
    "kind": "definition",
    "msc": [
      "65L50",
      "65L05",
      "65L06"
    ],
    "name": "Adaptive step size",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Adaptive_step_size"
      }
    ],
    "tag": "F7H4H711MY",
    "uses": [
      "558XADG64M",
      "T220HF0562"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/F7H4H711MY/",
  "links": [
    {
      "field": "defines",
      "target": "6MREWBZR7R"
    },
    {
      "field": "uses",
      "target": "558XADG64M"
    },
    {
      "field": "uses",
      "target": "T220HF0562"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/F7H4H711MY.md",
  "msc": [
    "65L50",
    "65L05",
    "65L06"
  ],
  "name": "Adaptive step size",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/F7H/F7H4H711MY.md",
  "status": null,
  "tag": "F7H4H711MY",
  "uri": "m2://F7H4H711MY",
  "url": "https://tamnd.github.io/math2/wiki/adaptive-step-size-definition/",
  "writing": {
    "tag": "F7H4H711MY",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
