{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $L \\colon \\R^d \\times \\R^d \\to \\R$, $(q, \\dot q) \\mapsto L(q, \\dot q)$, be a smooth Lagrangian, and fix a step size $h \u003e 0$.\nA discrete Lagrangian is a smooth function $L_h \\colon \\R^d \\times \\R^d \\to \\R$ that approximates the action:\n$$L_h(q_0, q_1) \\approx \\int_0^h L(q(t), \\dot q(t))\\, dt.$$\nHere $q$ is the solution of the [[Euler–Lagrange equation|PS0VV149ET]] with $q(0) = q_0$ and $q(h) = q_1$.\nThe discrete action of a sequence $q_0, \\ldots, q_N$ is $S_h = \\sum_{k=0}^{N-1} L_h(q_k, q_{k+1})$.\nThe *variational integrator* defined by $L_h$ is the map $(q_{k-1}, q_k) \\mapsto (q_k, q_{k+1})$ given by the discrete Euler–Lagrange equations:\n$$D_2 L_h(q_{k-1}, q_k) + D_1 L_h(q_k, q_{k+1}) = 0.$$\nHere $D_1$ and $D_2$ denote the gradients with respect to the first and the second argument.\nThese are the equations $\\partial S_h / \\partial q_k = 0$ for $1 \\le k \\le N - 1$, with $q_0$ and $q_N$ fixed.\n\n## Remarks\n\nExample: take $L(q, \\dot q) = \\frac12 \\abs{\\dot q}^2 - V(q)$ and\n$$L_h(q_0, q_1) = \\frac{h}{2} \\abs{\\frac{q_1 - q_0}{h}}^2 - \\frac{h}{2} \\left( V(q_0) + V(q_1) \\right).$$\nThen $D_2 L_h(q_{k-1}, q_k) = \\frac{q_k - q_{k-1}}{h} - \\frac{h}{2} \\nabla V(q_k)$ and $D_1 L_h(q_k, q_{k+1}) = -\\frac{q_{k+1} - q_k}{h} - \\frac{h}{2} \\nabla V(q_k)$.\nTheir sum vanishes exactly when $q_{k+1} - 2 q_k + q_{k-1} = -h^2 \\nabla V(q_k)$, which is the [[Störmer–Verlet method|ESWE8Y3JD4]].\nEvery variational integrator is symplectic in the variables $(q_k, p_k)$ with $p_k = -D_1 L_h(q_k, q_{k+1})$, when $L_h$ is regular, that is, when this relation can be solved for $q_{k+1}$.\nSo variational integrators are [[geometric integrators|VQ2BTYFST4]] for symplecticity.\nIf $L_h$ approximates the exact action to order $r$, then the method has order at least $r$.\n\n## Explanations\n\n### L1 human\n\nInstead of discretising the equation of motion, one discretises the action and asks it to be stationary.\nThe equations that come out are the numerical method.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "4KZ458T2QA",
    "kind": "definition",
    "msc": [
      "65P10",
      "37M15"
    ],
    "name": "Variational integrator",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Variational_integrator"
      }
    ],
    "tag": "FWRW7BYX6T",
    "uses": [
      "PS0VV149ET",
      "VQ2BTYFST4",
      "ESWE8Y3JD4"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/FWRW7BYX6T/",
  "links": [
    {
      "field": "defines",
      "target": "4KZ458T2QA"
    },
    {
      "field": "uses",
      "target": "PS0VV149ET"
    },
    {
      "field": "uses",
      "target": "VQ2BTYFST4"
    },
    {
      "field": "uses",
      "target": "ESWE8Y3JD4"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/FWRW7BYX6T.md",
  "msc": [
    "65P10",
    "37M15"
  ],
  "name": "Variational integrator",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/FWR/FWRW7BYX6T.md",
  "status": null,
  "tag": "FWRW7BYX6T",
  "uri": "m2://FWRW7BYX6T",
  "url": "https://tamnd.github.io/math2/wiki/variational-integrator-definition/",
  "writing": {
    "tag": "FWRW7BYX6T",
    "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
      }
    ]
  }
}
