{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $L$ be a linear differential operator on an interval or a box $\\Omega$, and consider $L u = f$ with boundary or periodicity conditions.\nFix a family of smooth functions $\\varphi_k$ on all of $\\Omega$, each nonzero on most of $\\Omega$.\nTypical choices are $e^{ikx}$ for periodic problems, [[Chebyshev polynomials|M6EAR1JHPP]] or [[Legendre polynomials|QFYGJVA996]] otherwise.\nLet $I_N$ be a finite set of $n$ indices.\nA *spectral method* seeks $u_N = \\sum_{k \\in I_N} a_k \\varphi_k$ and fixes the $a_k$ by one of three conditions:\n\n1. Galerkin: $\\ip{L u_N - f}{\\varphi_j} = 0$ for all $j \\in I_N$, with the $\\varphi_k$ satisfying the boundary conditions;\n2. tau: the same equations for all but $m$ indices $j$, plus the $m$ boundary conditions written as equations on the $a_k$;\n3. collocation: $L u_N(x_j) = f(x_j)$ at chosen points $x_j$, together with the boundary conditions, with $n$ equations in all.\n\nHere $\\ip{\\cdot}{\\cdot}$ is the $L^2$ inner product, with the weight of the chosen polynomial family.\n\n## Remarks\n\nExample: on $[0, 2\\pi]$ with periodic conditions, solve $-u'' + u = f$ with the Fourier basis $e^{ikx}$, $\\abs{k} \\le N$.\nThe Galerkin condition gives $(k^2 + 1) a_k = \\hat f_k$, where $\\hat f_k$ are the [[Fourier coefficients|G12KXDHPPS]] of $f$.\nSo $u_N$ is the truncation of the exact Fourier series of $u$.\nIf $f$ is analytic, $\\hat f_k$ decays like $e^{-c \\abs{k}}$, and so does the error of $u_N$.\n\nNon-example: the finite element method with hat functions uses basis functions that vanish outside two mesh cells.\nThese are not global functions, so it is not a spectral method; its error for smooth $u$ decreases only like a fixed power of $1/N$.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "MYV657YRDW",
    "kind": "definition",
    "msc": [
      "65N35",
      "65M70"
    ],
    "name": "Spectral method",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Spectral_method"
      }
    ],
    "tag": "QFJEFGR171",
    "uses": [
      "G12KXDHPPS",
      "M6EAR1JHPP",
      "QFYGJVA996",
      "Y5B0PEBKE8"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/QFJEFGR171/",
  "links": [
    {
      "field": "defines",
      "target": "MYV657YRDW"
    },
    {
      "field": "uses",
      "target": "G12KXDHPPS"
    },
    {
      "field": "uses",
      "target": "M6EAR1JHPP"
    },
    {
      "field": "uses",
      "target": "QFYGJVA996"
    },
    {
      "field": "uses",
      "target": "Y5B0PEBKE8"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/QFJEFGR171.md",
  "msc": [
    "65N35",
    "65M70"
  ],
  "name": "Spectral method",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/QFJ/QFJEFGR171.md",
  "status": null,
  "tag": "QFJEFGR171",
  "uri": "m2://QFJEFGR171",
  "url": "https://tamnd.github.io/math2/wiki/spectral-method-definition/",
  "writing": {
    "tag": "QFJEFGR171",
    "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
      }
    ]
  }
}
