I am trying to understand the Simulink (continuous) transfer function. In the documentation for the transfer function block, it indicates that it has a direct feedthrough characteristic when the numerator and denominator have the same length.
The direct the feedthrough characteristic, according to the documentation, indicates that the output is controlled directly by the input (and not by state variables).
I do not understand how is it possible to implement a transfer function whose numerator and denominator have the same degree (greater than zero) without using state variables or previous input/output values to calculate the associated derivatives.
Background
Here is the line of thought that led me to this question:
I would like to implement a C++ code that represents a linear system with a transfer function. For this implementation I will use an input x(t)
and calculate an output y(t)
. Let's say that the transfer function of this system is G(s)
. I can the write it as Y(s) = G(s) * X(s)
.
Moreover, I'll say that G(s) = numerator(s) / denominator(s)
, where numerator(s)
is a polynomial of the laplace-domain variable s
of degree M and whose coefficients are c_{M}, c_{M-1}, ..., c_{1}, ..., c_{0}
. The denominator is another polynomial but of degree N
and coefficients d_{N}, ..., d_{0}
.
To solve this system, I rewrite it as denominator(s) * Y(s) = numerator(s) * X(s)
. Using Laplace transform properties and assuming that initial conditions are zero for all derivatives, I get
d_{N}*y^{N} + d_{N-1}*y^{N-1} + ... + d_{0}*y = c_{M}*x^{M} + c_{M-1}*x^{M-1} + ... + c_{0}*x
Where y^{k}
is the k-derivative of y(t)
and similarly for x
.
I solve this equation with a numerical integrator (let's say euler, for simplicity), which lets me calculate y
and its derivatives using N-1
state variables. For the k-derivatives of x
, I approximate it roughly using the last k+1
values of the input (e.g. x^{1} = (x(t2) - x(t1)) / (t2-t1)
.
In brief, I need keep track of N-1
state variables for Y
and M+1
previous values of x
. I then remembered that simulink does this without any previous value when M==N
. How can this be possible?