Skip to main content

Backward difference equation with step input

Short answer

Take z-transform, solve for X(z). Poles at z=1 and 0.5±j0.5. Solution: x(k) = 1 + (1/√2)^{k+1} sin((k−1)π/4), k ≥ 0; overshoot 1.25, settles to 1.

Solve the following difference equation: 2x(k)-2x(k-1)+x(k-2)=u(k); where x(k)=0 for k<0 and u(k) is unit step function.

Solve by z-transform with x(k)=0x(k) = 0 for k<0k < 0 and U(z)=11−z−1U(z) = \dfrac{1}{1-z^{-1}}.

Step 1: Z-transform

Since x(−1)=x(−2)=0x(-1) = x(-2) = 0, the delay theorem gives Z[x(k−n)]=z−nX(z)\mathcal{Z}[x(k-n)] = z^{-n}X(z):

(2−2z−1+z−2)X(z)=11−z−1(2 - 2z^{-1} + z^{-2})X(z) = \frac{1}{1 - z^{-1}} X(z)=1(1−z−1)(2−2z−1+z−2)=z3(z−1)(2z2−2z+1)X(z) = \frac{1}{(1-z^{-1})(2 - 2z^{-1} + z^{-2})} = \frac{z^3}{(z-1)(2z^2 - 2z + 1)}

Step 2: Poles

2z2−2z+1=0  ⇒  z=2±4−84=0.5±j0.5=12e±jπ/42z^2 - 2z + 1 = 0 \;\Rightarrow\; z = \frac{2 \pm \sqrt{4 - 8}}{4} = 0.5 \pm j0.5 = \frac{1}{\sqrt2}e^{\pm j\pi/4}

So r=12=0.7071r = \dfrac{1}{\sqrt2} = 0.7071 and Ω=π4\Omega = \dfrac{\pi}{4}. Both complex poles are inside the unit circle.

Step 3: Form of the solution

The pole at z=1z = 1 gives a constant, and the complex pair gives a damped sinusoid:

x(k)=A0+rk(Acos⁡kπ4+Bsin⁡kπ4)x(k) = A_0 + r^k\left(A\cos\frac{k\pi}{4} + B\sin\frac{k\pi}{4}\right)
  • Steady state: A0=lim⁡z→1(1−z−1)X(z)=12−2+1=1A_0 = \lim_{z\to1}(1-z^{-1})X(z) = \dfrac{1}{2 - 2 + 1} = 1
  • Initial values from the equation: k=0k = 0 gives 2x(0)=12x(0) = 1, so x(0)=0.5x(0) = 0.5. k=1k = 1 gives 2x(1)−2(0.5)=12x(1) - 2(0.5) = 1, so x(1)=1x(1) = 1.
k=0:1+A=0.5  ⇒  A=−0.5k=1:1+0.7071(−0.5×0.7071+B×0.7071)=1  ⇒  B=0.5\begin{aligned} k = 0:&\quad 1 + A = 0.5 \;\Rightarrow\; A = -0.5 \\ k = 1:&\quad 1 + 0.7071\left(-0.5\times0.7071 + B\times0.7071\right) = 1 \;\Rightarrow\; B = 0.5 \end{aligned}

Step 4: Closed-form solution

x(k)=1+(12)k[−0.5cos⁡kπ4+0.5sin⁡kπ4],k≥0x(k) = 1 + \left(\frac{1}{\sqrt2}\right)^k\left[-0.5\cos\frac{k\pi}{4} + 0.5\sin\frac{k\pi}{4}\right], \quad k \ge 0

Since −0.5cos⁡θ+0.5sin⁡θ=12sin⁡(θ−π4)-0.5\cos\theta + 0.5\sin\theta = \frac{1}{\sqrt2}\sin\left(\theta - \frac{\pi}{4}\right), this simplifies to

x(k)=1+(12)k+1sin⁡(k−1)π4x(k) = 1 + \left(\frac{1}{\sqrt2}\right)^{k+1}\sin\frac{(k-1)\pi}{4}

Step 5: Check with the recursion x(k)=12[1+2x(k−1)−x(k−2)]x(k) = \frac12\left[1 + 2x(k-1) - x(k-2)\right]

kk0123456789
x(k)x(k)0.511.251.251.12510.93750.93750.96881

The formula gives the same values. For example, k=2k = 2: 1+(0.7071)3sin⁡(π/4)=1+0.3536×0.7071=1.251 + (0.7071)^3\sin(\pi/4) = 1 + 0.3536\times0.7071 = 1.25.

The output overshoots to 1.25 and settles at 1 with a decaying oscillation.

Answer: x(k)=1+(12)k+1sin⁡(k−1)π4x(k) = 1 + \left(\dfrac{1}{\sqrt2}\right)^{k+1}\sin\dfrac{(k-1)\pi}{4}, with x(∞)=1x(\infty) = 1.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Digital Control System chapter 2 questions →