{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $H \\colon \\R^{2d} \\to \\R$ be smooth, and consider the [[Hamiltonian system|0EDKGA2FAK]] $y' = J \\nabla H(y)$, where $J = \\begin{pmatrix} 0 \u0026 I \\\\ -I \u0026 0 \\end{pmatrix}$; its exact solutions satisfy $H(y(t)) = H(y(0))$.\nLet a numerical method with fixed step size $h \u003e 0$ produce the sequence $y_0, y_1, y_2, \\ldots$ from $y_0$.\nThe energy error at step $n$ is $e_n = H(y_n) - H(y_0)$.\nThe method shows *energy drift* on this problem if the energy error has a systematic trend in time.\nThis means that $\\abs{e_n}$ is not bounded uniformly in $n$ but grows with the time $t_n = n h$.\n\n## Remarks\n\nExample: for $H(q, p) = \\frac12 (q^2 + p^2)$, the explicit Euler method $q_{n+1} = q_n + h p_n$, $p_{n+1} = p_n - h q_n$ gives $q_{n+1}^2 + p_{n+1}^2 = (1 + h^2)(q_n^2 + p_n^2)$.\nSo $H(y_n) = (1 + h^2)^n H(y_0)$, and the energy error grows exponentially in $n$: the method has energy drift.\nNon-example: the symplectic Euler method $p_{n+1} = p_n - h q_n$, $q_{n+1} = q_n + h p_{n+1}$ is a linear map of determinant $1$ and trace $2 - h^2$.\nFor $0 \u003c h \u003c 2$ its eigenvalues are distinct and of modulus $1$, so the sequence $y_n$ is bounded and so is $e_n$.\nThere is no drift, only a bounded oscillation of size $O(h)$.\nMore generally, let $H$ be analytic and use a [[symplectic integrator|B4C25SXFRE]] of order $p$.\nIf the numerical solution stays in a compact set, backward error analysis gives $e_n = O(h^p)$ over times exponentially long in $1/h$.\nIn floating-point arithmetic, round-off adds a slow random-walk drift even to such methods.\n\n## Explanations\n\n### L1 human\n\nEnergy drift means that the computed energy wanders away from its true constant value with a trend over time, not just with small bounded wiggles.\nIt is the usual way to judge whether an integrator is fit for long simulations of conservative systems.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "BDVF3BPJEB",
    "kind": "definition",
    "msc": [
      "65P10",
      "65L20"
    ],
    "name": "Energy drift",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Energy_drift"
      }
    ],
    "tag": "M8DEV2YM2S",
    "uses": [
      "0EDKGA2FAK",
      "B4C25SXFRE"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/M8DEV2YM2S/",
  "links": [
    {
      "field": "defines",
      "target": "BDVF3BPJEB"
    },
    {
      "field": "uses",
      "target": "0EDKGA2FAK"
    },
    {
      "field": "uses",
      "target": "B4C25SXFRE"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/M8DEV2YM2S.md",
  "msc": [
    "65P10",
    "65L20"
  ],
  "name": "Energy drift",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/M8D/M8DEV2YM2S.md",
  "status": null,
  "tag": "M8DEV2YM2S",
  "uri": "m2://M8DEV2YM2S",
  "url": "https://tamnd.github.io/math2/wiki/energy-drift-definition/",
  "writing": {
    "tag": "M8DEV2YM2S",
    "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
      }
    ]
  }
}
