State space simulink modularize

3 次查看(过去 30 天)
Waqas Syed
Waqas Syed 2017-3-14
Hi,
In the attached image, it is visible that I am trying to implement a state space representation in simulink. What I want to achieve is to do it for multiple sets of inputs. My input signal for state space is based on 2 elements. But the input in the shown diagram has 12 elements. I want to make groups of 2 and input them to the gain. Is there an efficient way of doing this without implementing multiple gain blocks?

回答(1 个)

Kushagr Gupta
Kushagr Gupta 2017-3-16
If I understand the question correctly, you want to modify the input (1x12 vector) into a (2x6 matrix) for the down stream elements to process at one given instant of time. Some of the ways in which this can be done are as follows:
1. Use the ' reshape ' block to reshape the vector input into a matrix. To understand further, go through the documentation provided at the link. Note: As the output of reshape would be a matrix, all the downstream components have to match the size accordingly. For example, if you want scalar multiplication for the group of 2 inputs, then the gain block would become a vector of length 6, so that it can be effectively multiplied.
2. Use a MIMO State Space model to avoid complicating the design using the previous approach, as you will just have to figure out the A,B,C and D matrices once. Documentation for using State Space Block in simulink is available in the embedded link.

类别

Help CenterFile Exchange 中查找有关 Modeling 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by