
Delay - bus as initial condition and bus propagation
22 ビュー (過去 30 日間)
古いコメントを表示
Hi
I want to use the delay block with initial condition through input port. I read the documentation (source: Delay) and it seems both u and x0 can be set to a bus, but if I try to do this, then I can't get the bus names on the output.
If I set the initial condition option to Dialog, then everything works. But the issue is that I need to set the initial condition through the bus, with values that I need. Is it even possible?
Here's an example:

0 件のコメント
回答 (1 件)
Fangjun Jiang
2025 年 2 月 19 日 15:53
編集済み: Fangjun Jiang
2025 年 2 月 19 日 15:58
I am intested in this question so I made an example.
According to the document, 'The initial condition x0 port accepts nonvirtual bus signals.'
So I made it a nonvirtual bus but there is still a model error at the Bus Selector block.
The error disappeared only after I made the data input u also a nonvirtual bus.
Thus it seems that if you want to utilize "input port" to do initilization of a bus, then the bus input also needs to be a nonvirtual bus. I think this makes sense. Please contact tech support to confirm this.
To make a nonvirtual bus, basically you need to create a Simulink.Bus object and then specify the data type as this bus object. The bus signal line displayed below is nonvirtual bus.

2 件のコメント
Fangjun Jiang
2025 年 2 月 20 日 15:07
It is not depend on a matlab workspace variable. The Simulink.Bus object is just used to "define" the nonvirtual bus. The initial condition could come from top model inputs. Specify the data type of that Inport block as this bus type.
When you say "two buses with the exact same structure", it implies nonvirtual bus. Virtual bus does not map to a fixed structure.
参考
カテゴリ
Help Center および File Exchange で Composite Interfaces についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!