Subsystem with similar functionality as of "Unit Delay"

1 回表示 (過去 30 日間)
Anubhav Routray
Anubhav Routray 2023 年 3 月 12 日
コメント済み: Paul 2023 年 3 月 13 日
I want to replace all the 'UnitDelay ' blocks in a model with a subsystem which would have the functionality of 'UnitDelay' block.
I want such a subsystem because the initial condition to the 'Unit Delay' block should be passed from a custom block(for example a constant block or From workspace block) as the initial conditions are changed frequently. I have the initial conditions stored in an array. Any help is appreciated. I am using MATLAB 2020a.
(Also I can not use the old Unit Delay with IC block because of my requirement limitations)
  6 件のコメント
Paul
Paul 2023 年 3 月 12 日
"I change the value of IC from 5 to 6 and observe some change."
Are you changing the value of the IC from 5 to 6 while the simulation is running, or after the simulation with IC=5 is complete and you want to use IC = 6 for the next simulation?
Anubhav Routray
Anubhav Routray 2023 年 3 月 12 日
I want to use the IC =6 for the next simulation

サインインしてコメントする。

回答 (1 件)

Paul
Paul 2023 年 3 月 12 日
Does the Delay block meet the need? It can accept an IC from an external source and is externally resettable.
  4 件のコメント
Anubhav Routray
Anubhav Routray 2023 年 3 月 13 日
編集済み: Anubhav Routray 2023 年 3 月 13 日
I completely agree with your solution. However the scenario that I explained was an example. I have around 500 UDs in the complete model and it is not a feasible way to change the field of every block. I have already created a script where the value of the new IC is ready to be fed automatically. I need a subsytem to replace the all the UDs in the model with a means to feed the new ICs (which I am thinking to be from a "From Workspace" block, but I am open to any other suggestion).
Paul
Paul 2023 年 3 月 13 日
I still don't understand why the Delay block (doc page link in he original Answer) doesn't fit the need. It can support a delay of 1, i.e., a unit delay and also supports an externally supplied initial condition.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSubsystems についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by