概述
文章目录
- 1. DirFeedthrough的设置
- 2. DirFeedthrough的帮助文档
- 3. 参考链接:
1. DirFeedthrough的设置
sizes.DirFeedthrough = 0/1
简而言之,只要在mdlOutputs函数或者mdlSampleNextTime函数中,使用到了输入 u (包括使用 u的任意元素),则DirFeedthrough = 1
2. DirFeedthrough的帮助文档
在matlab中打开了DirectFeedthrough
的 help 文档,原文及翻译如下:
Direct Feedthrough means that the output (or the variable sample time for variable sample time blocks) is controlled directly by the value of an input port signal.
DirFeedthrough 是指输入端口的信号直接控制输出(或者是控制可变采样时间块的可变采样时间)。
Typically, an S-function input port has direct feedthrough if the output function (mdlOutputs) is a function of the input u.
通常情况下,如果输出函数(mdlOutputs)是有关输入 u 的函数。那么该 s 函数的输入端口是 DirFeedthrough 的,即令 DirFeedthrough = 1
That is, there is direct feedthrough if the input u is accessed by mdlOutputs.
也就是说若 mdlOutputs 含有输入 u ,则设置DirFeedthrough = 1。
Outputs can also include graphical outputs, as in the case of an XY Graph scope.
通常,输出也包括图形输出,比如 XY 图形示波器。
The "time of next hit" function (mdlGetTimeOfNextVarHit) of a variable sample time S-function accesses the input u.
可变采样时间函数 mdlGetTimeOfNextVarHit 也与输入 u 有关。
An example of a system that requires its inputs (that is, has direct feedthrough) is the operation
y
=
k
×
u
y=k×u
y=k×uwhere u is the input, k is the gain, and y is the output.
举例来说,在 y=k×u 系统中,u 是输入,k 是增益,y 是输出,则这个系统需要对输入 u 进行操作(意味着 DirFeedthrough = 1)。
An example of a system that does not require its inputs (that is, does not have direct feedthrough) is the simple integration algorithm
y
=
x
x
˙
=
u
y=x\ dot x = u
y=xx˙=uwhere x is the state,
x
˙
dot x
x˙ is the state derivative with respect to time, u is the input, and y is the output. Simulink® integrates the variable
x
˙
dot x
x˙.
相对而言,举个简单的系统不需要输入 u 的例子(意味着 DirFeedthrough = 0)。在
y
=
x
x
˙
=
u
y=x\ dot x = u
y=xx˙=u系统中,x 是状态变量,
x
˙
dot x
x˙是状态变量相对与时间的导数,u 是输入,y 是输出,Simulink®对变量
x
˙
dot x
x˙进行操作。
It is very important to set the direct feedthrough flag correctly because it affects the execution order of the blocks in your model and is used to detect algebraic loops (see Algebraic Loops in Using Simulink).
DirFeedthrough 会影响模型中程序块的执行顺序,并且它被用与检测代数循环(查看代数循环在 simulink 中的使用),因此 DirFeedthrough 标志是否设置正确是十分重要的。
If the simulation results for a model containing your S-function do not converge, or the simulation fails, you may have the direct feedthrough flag set incorrectly.
对于包含 s 函数的模型,如果仿真结果没有收敛,或者仿真失败,可能的原因是 DirFeedthrough 没有正确的被设置。
Try turning on the direct feedthrough flag and setting the Algebraic loop solver diagnostic to warning (see the Algebraic loop option on the Diagnostics Pane: Solver reference page in Simulink Graphical User Interface).
试着将 DirFeedthrough 的值取反,并把代数循环求解器的诊断
设置为警告模式(具体步骤查看代数循环诊断章节:Solver
reference page in Simulink Graphical User Interface)。
Subsequently running the simulation displays any algebraic loops in the model and shows if the engine has placed your S-function within an algebraic loop.
随后执行仿真,在模型中观察任一代数循环,确定 s 函数
被执行器放置在代数循环中。
3. 参考链接:
S函数初始化中DirFeedthrough 该如何设置
请问matlab s函数中的Dirfeedthrough怎么设定?
Matlab——如何判断某个函数为直通(Dirfeedthrough = 1)
最后
以上就是冷艳棉花糖为你收集整理的matlab入门4-mdlInitializeSizes解析的全部内容,希望文章能够帮你解决matlab入门4-mdlInitializeSizes解析所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复