Demux and State Space Dimension errors

Hi,
I am trying to run this sim, and I keep getting these errors "Invalid setting for input port dimensions of 'Feedback_Control_System/Demux'. The dimensions are being set to [-1]. This is not valid because the total number of input and output elements are not the same" and "Error in port widths or dimensions. Invalid dimension has been specified for 'Output Port 1' of 'Feedback_Control_System/State-Space'."
I am not sure how to solve this issue. Any help would be much appreciated!

Answers (2)

Paul
Paul on 1 Jun 2021
If the output of the State Space block has four elements, then set the "Number of outputs" parameter of the Demux block to 4.

7 Comments

I have that set to 4, and I still get the same error.
What are the dimensions of A,B,C,D in the State Space block?
I've done 1 1 1 1, 1 2 3 4, and 4 4 4 4. None of those worked.
I'm not sure what those numbers mean. From the diagram, it looks like B and D should both have four columns. I'm going to guess that C and D should both have 4 rows. Do the B, C, and D parameters of the State Space model have these characteristics?
If each sensor measurement is a scalar quantity (which is what would make sense), then the input to the State Space block is a 4-dimensional vector of error signals. In this case, B and D both must have four columns. Similarly, it looks like the output of the State Space block should be a four dimensional vector of meausrements, so the C and D matrices both must have four rows. The A matrix, of course, must be square and B has the number of rows of A and C has the same number of columns. So you can't just put A = B = C = D = 1 as the parameters. I have no idea what you want to put in that State Space block. But just to get things connnected properly, try A = B = C = D = eye(4).
Paul
Paul on 2 Jun 2021
Edited: Paul on 3 Jun 2021
In response to this comment: "Oh! I didn't realize we could create a matrix for the values of A,B,C, and D in the parameters. That makes so much more sense! Thanks for the help."
What are the values of A, B, C, D supposed to be? Is a State Space block is what should be used for this application?

Sign in to comment.

Oh! I didn't realize we could create a matrix for the values of A,B,C, and D in the parameters. That makes so much more sense! Thanks for the help.

Categories

Products

Release

R2021a

Asked:

on 1 Jun 2021

Edited:

on 3 Jun 2021

Community Treasure Hunt

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

Start Hunting!