{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $k \\ge 1$, let $a_0, \\ldots, a_k$ be complex numbers with $a_0 \\ne 0$, let $(f_n)_{n \\ge 0}$ be a sequence with a [[unilateral Z-transform|EPG6JPVJE7]] $F$, and let $c_0, \\ldots, c_{k-1}$ be complex numbers.\nConsider the [[linear recurrence with constant coefficients|0NDVHBVBXB]]\n$$a_0 y_{n+k} + a_1 y_{n+k-1} + \\cdots + a_k y_n = f_n \\quad (n \\ge 0), \\qquad y_j = c_j \\ (0 \\le j \u003c k).$$\nThe *Z-transform method* solves it in three steps.\n\n1. Apply the unilateral Z-transform and the [[shift property|JWH2KYCGBQ]], $\\mathcal{Z}\\{(y_{n+m})_{n \\ge 0}\\} = z^m \\left( Y(z) - \\sum_{j\u003cm} y_j z^{-j} \\right)$, to get $P(z) Y(z) = F(z) + Q(z)$, where $P(z) = \\sum_{m=0}^{k} a_{k-m} z^m$ and $Q$ is a polynomial built from $c_0, \\ldots, c_{k-1}$.\n2. Solve: $Y(z) = (F(z) + Q(z)) / P(z)$.\n3. Recover $(y_n)$ from $Y$ by the [[inverse Z-transform|PH61T3B7W7]], in practice by a [[partial fraction decomposition|030VFEREKG]] and known transform pairs.\n\n## Remarks\n\nExample: the Fibonacci recurrence $y_{n+2} = y_{n+1} + y_n$ with $y_0 = 0$, $y_1 = 1$.\nStep 1 gives $z^2 (Y - z^{-1}) = z Y + Y$, so $Y(z) = z/(z^2 - z - 1)$.\nWith $\\varphi = (1 + \\sqrt 5)/2$ and $\\psi = (1 - \\sqrt 5)/2$, one has $Y(z) = \\frac{1}{\\sqrt 5}\\left( \\frac{z}{z - \\varphi} - \\frac{z}{z - \\psi} \\right)$, and the pair $a^n \\leftrightarrow z/(z - a)$ gives $y_n = (\\varphi^n - \\psi^n)/\\sqrt 5$.\nNon-example: the recurrence $y_{n+1} = y_n^2$ is not linear; the transform of $(y_n^2)$ is not a function of $Y(z)$ alone, so step 1 gives no algebraic equation for $Y$.\nThe polynomial $P$ is the characteristic polynomial of the recurrence, so the poles of $Y$ that do not come from $F$ lie among its roots.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "DAVT2ZWAF7",
    "kind": "definition",
    "msc": [
      "39A06",
      "44A55"
    ],
    "name": "Solving linear difference equations by the Z-transform",
    "sources": [
      {
        "locator": "Linear constant-coefficient difference equation",
        "url": "https://en.wikipedia.org/wiki/Z-transform"
      }
    ],
    "tag": "8QQ7BF5BM0",
    "uses": [
      "0NDVHBVBXB",
      "EPG6JPVJE7",
      "JWH2KYCGBQ",
      "PH61T3B7W7",
      "030VFEREKG"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/8QQ7BF5BM0/",
  "links": [
    {
      "field": "defines",
      "target": "DAVT2ZWAF7"
    },
    {
      "field": "uses",
      "target": "0NDVHBVBXB"
    },
    {
      "field": "uses",
      "target": "EPG6JPVJE7"
    },
    {
      "field": "uses",
      "target": "JWH2KYCGBQ"
    },
    {
      "field": "uses",
      "target": "PH61T3B7W7"
    },
    {
      "field": "uses",
      "target": "030VFEREKG"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/8QQ7BF5BM0.md",
  "msc": [
    "39A06",
    "44A55"
  ],
  "name": "Solving linear difference equations by the Z-transform",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/8QQ/8QQ7BF5BM0.md",
  "status": null,
  "tag": "8QQ7BF5BM0",
  "uri": "m2://8QQ7BF5BM0",
  "url": "https://tamnd.github.io/math2/wiki/solving-linear-difference-equations-by-the-z-transform-definition/",
  "writing": {
    "tag": "8QQ7BF5BM0",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
