Delay - bus as initial condition and bus propagation

7 visualizaciones (últimos 30 días)
Augusto Dufloth
Augusto Dufloth el 19 de Feb. de 2025
Comentada: Fangjun Jiang el 20 de Feb. de 2025
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:

Respuestas (1)

Fangjun Jiang
Fangjun Jiang el 19 de Feb. de 2025
Editada: Fangjun Jiang el 19 de Feb. de 2025
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 comentarios
Augusto Dufloth
Augusto Dufloth el 20 de Feb. de 2025
Hmm, it seems to do the trick.
But it would be more "intuitive" to not depend on a matlab workspace variable. Actually, in my specific case, I control the delay initial conditions through top model inputs.
I would expect that if you provide two buses with the exact same structure, then the output should be propagated.
I'm making a suggestion through the official channel.
Fangjun Jiang
Fangjun Jiang el 20 de Feb. de 2025
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.

Iniciar sesión para comentar.

Categorías

Más información sobre Composite Interfaces en Help Center y File Exchange.

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by