{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $a \\in \\R$, and consider a consistent linear [[finite difference|X7HYEBA5SA]] scheme for the [[transport equation|PVD7VZJZ9B]] $u_t + a u_x = 0$, with mesh sizes $\\Delta x$, $\\Delta t$ and fixed ratio $\\nu = a \\Delta t / \\Delta x$.\nIts modified equation is the partial differential equation that the numerical solution satisfies to higher order in $\\Delta x$.\nIt is found by Taylor expansion of the scheme, with time derivatives replaced by space derivatives.\nSuppose the modified equation has the form\n$$u_t + a u_x = D\\, u_{xx} + \\sum_{k \\ge 3} c_k\\, \\partial_x^k u.$$\nThe coefficient $D$ is the *numerical diffusion* coefficient of the scheme.\nThe scheme is said to have numerical diffusion when $D \u003e 0$.\n\n## Remarks\n\nExample: for the [[upwind scheme|MTCRZC5QKT]] $u_j^{n+1} = u_j^n - \\nu (u_j^n - u_{j-1}^n)$ with $a \u003e 0$, Taylor expansion gives $u_t + \\frac{\\Delta t}{2} u_{tt} + a u_x - \\frac{a \\Delta x}{2} u_{xx} = O(\\Delta x^2)$.\nUsing $u_{tt} = a^2 u_{xx} + O(\\Delta x)$ gives $D = \\frac{a \\Delta x}{2} (1 - \\nu)$, which is positive for $0 \u003c \\nu \u003c 1$.\nFor the [[Lax–Friedrichs method|VY3J2NKGKW]] the same computation gives $D = \\frac{\\Delta x^2}{2 \\Delta t} (1 - \\nu^2)$, which is larger than for upwind when $0 \u003c \\nu \u003c 1$.\nNon-example: for the [[Lax–Wendroff method|YHZ9BCNDRZ]] the coefficient of $u_{xx}$ is zero to this order, so $D = 0$.\nIts leading error is a third-derivative term, which is dispersive (wiggles), not diffusive (smearing).\nA negative $D$ means anti-diffusion, as for the downwind scheme $u_j^{n+1} = u_j^n - \\nu (u_{j+1}^n - u_j^n)$ with $a \u003e 0$, which is unstable.\n\n## Explanations\n\n### L1 human\n\nNumerical diffusion is the hidden diffusion term that a scheme adds to the equation it solves.\nIts coefficient is read off from the modified equation.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "55GVVJTF24",
    "kind": "definition",
    "msc": [
      "65M06",
      "65M15"
    ],
    "name": "Numerical diffusion",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Numerical_diffusion"
      }
    ],
    "tag": "MM0YNN1MJA",
    "uses": [
      "PVD7VZJZ9B",
      "X7HYEBA5SA",
      "MTCRZC5QKT",
      "VY3J2NKGKW",
      "YHZ9BCNDRZ"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/MM0YNN1MJA/",
  "links": [
    {
      "field": "defines",
      "target": "55GVVJTF24"
    },
    {
      "field": "uses",
      "target": "PVD7VZJZ9B"
    },
    {
      "field": "uses",
      "target": "X7HYEBA5SA"
    },
    {
      "field": "uses",
      "target": "MTCRZC5QKT"
    },
    {
      "field": "uses",
      "target": "VY3J2NKGKW"
    },
    {
      "field": "uses",
      "target": "YHZ9BCNDRZ"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/MM0YNN1MJA.md",
  "msc": [
    "65M06",
    "65M15"
  ],
  "name": "Numerical diffusion",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/MM0/MM0YNN1MJA.md",
  "status": null,
  "tag": "MM0YNN1MJA",
  "uri": "m2://MM0YNN1MJA",
  "url": "https://tamnd.github.io/math2/wiki/numerical-diffusion-definition/",
  "writing": {
    "tag": "MM0YNN1MJA",
    "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
      }
    ]
  }
}
