# How can initial conditions be taken into account to calculate a system's terminal value using the final value theorem or some other technique

I wish to calculate the Final Value of the following system given initial conditions not at rest, and assuming the X will not change from its initial condition value.

The transfer function is

$$H(z) = \frac{z^{-1} \phi / (1 - \phi z^{-1})}{1 - z^{-1} \psi / (1 - \psi z^{-1})}$$

It arises from the following feedback system

$$Y(z)(1-z^{-1}) = z^{-1}F_{\psi}\cdot Y(z) + z^{-1}F_{\phi}\cdot X(z)$$

where $$F_{\alpha}(z)$$ is a 1st order high pass filter with parameter $$\alpha$$ of the form

$$F_{\alpha}(z) = \frac{\alpha (1 - z^{-1})}{1 - \alpha z^{-1}}$$

When the initial conditions are rest, then the final value of the system response to a step in x from $$0$$ to $$x[0]$$ is readily obtained using the Final Value Theorem:

$$fv = \lim_{z\rightarrow 1} z(1-z^{-1})H(z)\frac{x[0]}{1 - z^{-1}}$$

which in this case resolves to

$$\frac{x[0] \cdot \phi / (1 - \phi )}{1 - \psi / (1 - \psi )}$$

However this is not where the system will settle if initial conditions are non zero.

How does one solve for the final value when initial conditions are not zero?

• i'm gonna have to rewrite your whole question in the language that electrical engineers doing DSP use. then answer it. we say "$x[n]$" instead of "$x_t$" and you'll have to be more explicit about what you mean by "$\Delta y_t$, but i think you mean $y[n]-y[n-1]$. the initial conditions are what we might call "$x[-1]$" and "$y[-1]$". and, i think you might have to define $G(\cdot)$. Nov 19 '20 at 2:35
• i have to say, even with the bounty, i dunno that this is worth my time detangling. there is so much to sort out just expressing the problem in clear, well-defined mathematical terms with notational convention consistent with electrical engineering DSP. Nov 19 '20 at 4:20
• If the system is stable (i.e. not marginally stable or unstable), the final value should not depend on initial conditions. Am I wrong with this assumption?
– Ben
Nov 20 '20 at 15:57
• This particular system's Y will not go to zero even if X eventually goes to zero. But it is stable (with appropriate psi and phi) in the sense that it settles to a finite value so long as X remains constant. The final value depends on the initial conditions. Nov 20 '20 at 19:06
• Your expression for $H(z)$ is not consistent with your description of the problem. In particular, $H(z)$ contains both $\psi$ and $\phi$, yet you do not mention $\phi$ in your problem statement -- it just crops up at the very end. Moreover, I went to the effort to try a couple of guesses about what $F_\phi$ and $G_\psi$ really were, and neither ended up with the same $H(z)$. Stackexchange wants us to give answers to the question that was actually asked, and I can't tell what that is at the moment. Try clarifying your question, preferably by simplifying it. Nov 21 '20 at 17:01

Ah ha! There's a lot of obfuscation in the problem as stated, plus a bit of over-emphasis on the final value theorem.

$$H(z) = \frac{z^{-1} \phi / (1 - \phi z^{-1})}{1 - z^{-1} \psi / (1 - \psi z^{-1})} \tag 0$$

OK, so far so good.

It arises from the following feedback system

$$Y(z)(1-z^{-1}) = z^{-1}F_{\psi}\cdot Y(z) + z^{-1}F_{\phi}\cdot X(z) \tag{1}$$

where $$F_{\alpha}(z)$$ is a 1st order high pass filter with parameter $$\alpha$$ of the form

$$F_{\alpha}(z) = \frac{\alpha (1 - z^{-1})}{1 - \alpha z^{-1}} \tag{2}$$

This was bothering me yesterday, but I didn't notice the essential problem. The general form of the filter described in (2) is first-order, and the delay operators ($$z^{-1}$$) on the right side of (1) potentially add a second pole.

The original transfer function (0) is in a screwy form, but it appears to be second-order. So the whole problem manages to worm its way through the pole-zero cancellation check by virtue of being stated in such a non-standard way. This question deserves to be an extra-credit problem in a control systems class, or problem 10 out of 10 in a final by a particularly sadistic teacher, or perhaps a routine problem if the instructor believes in homework sets that no one will be able to fully solve.

The problem is that there's a pole-zero cancellation that snuck right by me and everyone else. It's evident in the left-hand side of (1), where the derivative of $$y_k$$ is the subject of the equation.

So the reason that you can't solve this problem as stated using the final value theorem is that you cannot adequately represent the system using a transfer function. There may be some way to save this within transfer function notation, but I just tried and failed at the first step, so I'm going to do it in state-space.

So, first, shine some light on this obfuscated* problem. I'll do that by substituting (2) into (1):

$$Y(z)(1-z^{-1}) = z^{-1}\frac{\psi(1-z^{-1})}{1 - \psi z^{-1}}Y(z) + z^{-1}\frac{\phi(1-z^{-1})}{1 - \phi z^{-1}}X(z) \tag 3$$

Now the pole-zero cancellation becomes painfully evident: we're expressing a filter of the form $$1 - z^{-1}$$ on the left-hand side, but when we divide through by $$1 - z^{-1}$$, it no longer appears in the equation.

Oh joy.

So, drawing this out as a feedback loop (and changing from $$z^{-1}$$ to $$z$$ notation, because I'm a control systems guy):

Notation is going to get a bit awkward here. Bear with me. The transfer function in (2) can be realized as a state-space system (where $$x$$ is a state variable, not the system input):

\begin{aligned} x_k = \alpha x_{k-1} + (\alpha - 1)u_k \\ y_k = -x_k + u_k \end{aligned} \tag 4

So (awkwardly) noting that $$x_{1,k}$$ is the first element of the state vector $$\mathbf{x}$$ at time $$k$$, but is not the system input $$x_k$$, then the 'top' input to the summing junction is (4) with $$\alpha = \phi$$ and an extra delay:

\begin{aligned} \begin{bmatrix}x_{1,k} \\ x_{2,k}\end{bmatrix} = \begin{bmatrix} \phi & 0 \\ 0 & 0\end{bmatrix} \begin{bmatrix}x_{1,k-1} \\ x_{2,k-1}\end{bmatrix} + \begin{bmatrix}\phi - 1 \\ 1\end{bmatrix} x_k \\ u_{1,k} = x_{2, k-1} - x_{1,k-1} \end{aligned} \tag 5

The output of the system, $$y_k$$, is itself just a state variable (oh joy -- not sarcastically this time). So just let $$y_k = x_{3, k} \tag 6$$.

The filter in the feedback path is again described by (4), with $$\alpha = \psi$$ and an extra delay:

\begin{aligned} x_{4,k} = \psi x_{4,k-1} + (\psi - 1)x_{3, k} \\ u_{2,k} = x_{4,k-1} - x_{3, k-1} \end{aligned} \tag 7

Finally, the integrator in the forward portion of the loop is:

$$x_{2,k} = x_{2,k-1} + u_{1,k} - u_{2,k} \tag 8$$

This goes together into a fourth-order system:

\begin{aligned} \mathbf{x}_k = \begin{bmatrix} \phi & 0 & 0 & 0\\ 0 & 0 & 0 & 0 \\ -1 & 1 & 0 & -1 \\ 0 & 0 & \psi - 1 & \psi \end{bmatrix} \mathbf{x}_{k-1} + \begin{bmatrix}\phi - 1 \\ 1 \\ 0 \\ 0\end{bmatrix}x_k \\ y_k = \begin{bmatrix}0 & 0 & 1 & 0\end{bmatrix} \end{aligned} \tag 9

Recast that into $$\mathbf{x}_k = A \mathbf{x}_{k-1} + B\,u_k,\,y_k = C\mathbf{x}_k$$, and you can test the $$A$$ and $$C$$ matrices to see that it is observable, at least for some combinations of $$\phi$$ and $$\psi$$ (it is, I checked). Since there's pole-zero cancellation, we can assume that it isn't controllable (you can check that for yourself).

Because it's observable, we can consider the system $$\mathbf{x}_k = A \mathbf{x}_{k-1} + \mathbf{x}_0 \delta(k)$$

The response of this system to any given $$\mathbf{x}_0$$ is $$Y(z) = C(\mathbf{I}z - A)^{-1}\mathbf{x}_0$$ Now you can find the system response for each initial value in $$\mathbf{x}$$ using the final value theorem.

* I looked it up -- "obfuscate" literally means "to darken, to put into shadow". So shining a light on the thing really is the antonym of "obfuscate".

• //This question deserves to be an extra-credit problem in a control systems class, or problem 10 out of 10 in a final by a particularly sadistic teacher, or perhaps a routine problem if the instructor believes in homework sets that no one will be able to fully solve// ---------- "Obfuscate" is the correct term. I decided it was too much work to de-obfuscate it. Nov 22 '20 at 21:07
• I heartily concur -- it took me hours. I should have stopped at "there's obviously a pole-zero cancellation, don't try". Nov 22 '20 at 21:19
• well, you deserve the bounty, Tim. Nov 22 '20 at 21:22
• @TimWescott. Boom! Thanks so much. I'll need to carve out some time to follow this and check it matches simulation but I'm impressed. Upvoted already. Nov 23 '20 at 10:26
• Don't be surprised at arithmetic errors (and feel free to edit to correct) -- but the conclusion that you've got a hidden pole is obvious when you spell out the $F\phi$ and $G\psi$, and doubly-so when it's in block diagram form. And I think the method of finding the end answer is correct (you could also try to find $\lim_{k \to \infty} A^k$ and then just use $A^\infty \mathbf{x_0}$ -- it'd be absurd to do it that way by hand, but a snap with a math package). Nov 23 '20 at 16:13

After taking some more time to think about it, I think the problem is finally solved. I haven't digested Tim's answer yet, but from what I can see his approach is different. Furthermore, I thought it would be nice to give a closed-form expression for the final value the system's response will reach given values for $$x[-1]$$ and $$y[-1]$$.

The final value is given by

\bbox[#f8f1ea, 0.6em, border: 0.15em solid #fd8105]{\begin{align}y[\infty]&=\frac{\phi(1-\psi)x[-1]+y[-1]}{(1-\phi)(1-2\psi)},\quad x[-1]\neq 0,\phi\neq 0,\psi\neq 0\\ y[\infty]&=\frac{y[-1]}{1-2\psi},\quad x[-1]=0\textrm{ or }\phi=0\\y[\infty]&=y[-1]+\frac{\phi x[-1]}{1-\phi},\quad\psi=0\end{align}}\tag{1}

As pointed out in Tim's answer and in some comments, the problem is the pole-zero cancellation for $$z=1$$. The transfer function given in the OP correctly describes the system as an LTI system, i.e., with zero initial conditions, but - due to pole-zero cancellation - it doesn't correctly represent the underlying difference equation if initial conditions are non-zero.

Starting from

$$Y(z)(1-z^{-1})=Y(z)z^{-1}\frac{\psi(1-z^{-1})}{1-\psi z^{-1}}+X(z)z^{-1}\frac{\phi(1-z^{-1})}{1-\phi z^{-1}}\tag{2}$$

we can derive the corresponding difference equation without canceling the zero at $$z=1$$:

$$y[n]=b_1x[n-1]+b_2x[n-2]+b_3x[n-3]-\ldots\\\ldots -a_1y[n-1]-a_2y[n-2]-a_3y[n-3]\tag{3}$$

where the coefficients $$b_k$$ and $$a_k$$ depend on the chosen constants $$\phi$$ and $$\psi$$.

Now we can transform $$(3)$$ back to the $$\mathcal{Z}$$-domain, using the unilateral $$\mathcal{Z}$$-transform, which takes the initial conditions into account via the rule

\begin{align}\mathcal{Z}\big\{y[n-1]\big\}=z^{-1}Y(z)+y[-1]\end{align}\tag{4}

This gives an expression for $$Y(z)$$, the $$\mathcal{Z}$$-transform of the output signal resulting from a step at the input with initial conditions $$x[-1]$$ and $$y[-1]$$.

Now we can use the final value theorem

$$y[\infty]=\lim_{z\to 1}(1-z^{-1})Y(z)\tag{5}$$

which, after expressing the coefficients $$a_k$$ and $$b_k$$ in terms of $$\phi$$ and $$\psi$$ and after cancelling the common factor $$(1-z^{-1})$$ in the numerator and denominator of $$(1-z^{-1})Y(z)$$ results in Eq. $$(1)$$ for the final value. Note that $$(1)$$ is only valid if there actually exists a finite final value. This is not always the case because the system can become unstable even though both high-pass filters are stable.

I've run several simulations of the system confirming Eq. $$(1)$$. I give one example here: $$\phi=0.8$$, $$\psi=0.4$$, $$x[-1]=1$$, $$y[-1]=1$$. Eq. $$(1)$$ predicts a final value of $$y[\infty]=37$$, which is also the result of the simulation:

• Thanks for pitching in Matt. I am grateful. I am sure we can get a working answer. I think we are getting hung up on the "if the system is stable" mantra. If you look at the transfer function you will see that this system has memory. The inputs leave a indelible mark on the output that never decays. Simulate it and you'll see. It's a quick exercise in excel, python or whatever your favorite mock up tool. The answer is not $H(1)x[0]$ Nov 22 '20 at 0:23
• well, Mark, we tried. "you can lead a horse to water..." Nov 22 '20 at 0:27
• @Matt An easy way to see that the system has memory is to write it in the time domain. For the simple case where $\psi = 0$ then $\Delta y[n] = \phi \cdot F_{\phi}$'s infinite sum. So Y is just a converging integral. Convergence is guaranteed by the nature of $F$, which I've specified. And just like any proper integral,I can change its value through the integration constant c or in this case y's initial value $y[-1]$. Ergo. initial conditions do affect the final state of this system. The question is how to calculate that in a systematic general way Nov 22 '20 at 0:54
• @Matt I think the time domain to z domain conversion destroys the information we need as a result of the unilateral z transform assuming all is 0 prior to $n=0$. The very simplified system's time domain specification is $y[n] = y[n-1] + F_{\phi}(x[n-1])$ which, given the specified form of $F$, is clearly a convergent infinite sum, which of course depends on initial values $x[-1]$ and $y[-1]$. However when you transform that into the z domain $Y = X \cdot \frac{ \phi z^{-1} }{1 - \phi z^{-1}}$ and then back to the time domain, you get $y[n] = \phi \cdot (y[n-1] + x[n-1])$ Nov 22 '20 at 1:52
• @Matt which is only the same thing if $x[-1] = y[-n] = 0$. My initial question had time domain notation aiming to make that clear (unsuccessfully). I was persuaded to transform into the z domain but in retrospect that hides the problem. Where do we go from here? Nov 22 '20 at 1:52