当分子和分母的长度相等时,为什么 simulink 传递函数具有直接馈通?
我想了解 Simulink(连续)传递函数。在传递函数块的文档中,它表明它当分子和分母具有相同长度时,具有直接馈通特性。
根据文档,直接馈通特性,表示输出直接由输入控制(而不是由状态变量)。
我不明白如何在不使用状态变量或先前的输入/输出值来计算相关导数的情况下实现分子和分母具有相同次数(大于零)的传递函数。
背景
以下是导致我提出这个问题的思路:
我想实现一个 C++ 代码来表示具有传递函数的线性系统。对于此实现,我将使用输入 x(t) 并计算输出 y(t)。假设该系统的传递函数为G(s)
。我可以将其写为Y(s) = G(s) * X(s)
。
此外,我会说 G(s) = 分子 / 分母 ,其中 分子 是拉普拉斯域变量的多项式M 度的 s
,其系数为 c_{M}, c_{M-1}, ..., c_{1}, ..., c_{0}
。分母是另一个多项式,但次数为 N
,系数为 d_{N}, ..., d_{0}
。
为了解决这个系统,我将其重写为分母(s) * Y(s) = 分子(s) * X(s)
。使用拉普拉斯变换属性并假设所有导数的初始条件均为零,我得到
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
其中 y^{k}
是y(t)
的 k 导数,与 x
类似。
我用数值积分器(为了简单起见,假设为欧拉)求解这个方程,它让我可以使用 N-1
状态变量计算 y
及其导数。对于 x
的 k 导数,我使用输入的最后一个 k+1
值粗略地近似它(例如 x^{1} = (x( t2) - x(t1)) / (t2-t1)
简而言之,我需要跟踪 Y
和 N-1
状态变量。 code>M+1 之前的值x
然后我想起当 M==N
时 simulink 会在没有任何先前值的情况下执行此操作,这怎么可能?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在分母和分子大小相同的情况下,输出将取决于输入值,但也取决于状态值。因此该模块将具有直接馈通,但它还需要 N - 1 个状态,其中 N 是分母的长度。
请参阅这篇 wiki 文章,了解输出为的传递函数示例直接依赖于输入(以及状态)。
我查看了您指出的文档,我同意它令人困惑。这似乎表明输出要么仅取决于状态,要么仅取决于输入。实际上,输出可能取决于输入、状态和参数的组合。直接馈通仅询问输出是否依赖于输入值,它不关心输出是否也依赖于状态。
我希望这有帮助。
In the case that the denominator and numerator have the same size, the output will depend on the input values, but it will also depend on the values of the states. So the block will have direct feedthrough, but it also needs N - 1 states where N is the length of the denominator.
See this wiki article for an example of a transfer function where the output is directly dependent on the input (and also the states).
I took a look at the documentation you pointed to, and I agree that it is confusing. It seems to indicate that the output is either only dependent on the states, or only dependent on the inputs. In reality, the output can be dependent on a combination of inputs, states and parameters. Direct feedthrough only asks if the output is dependent on the input values, it doesn't care if the otuput is also dependent on states.
I hope this helps.