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!

답변 (2개)

Paul
Paul 2021년 6월 1일

0 개 추천

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

Ryan DiTullio
Ryan DiTullio 2021년 6월 1일
I have that set to 4, and I still get the same error.
Paul
Paul 2021년 6월 1일
What are the dimensions of A,B,C,D in the State Space block?
Ryan DiTullio
Ryan DiTullio 2021년 6월 1일
I've done 1 1 1 1, 1 2 3 4, and 4 4 4 4. None of those worked.
Paul
Paul 2021년 6월 1일
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?
Ryan DiTullio
Ryan DiTullio 2021년 6월 1일
Paul
Paul 2021년 6월 1일
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 2021년 6월 2일
편집: Paul 2021년 6월 3일
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?

댓글을 달려면 로그인하십시오.

Ryan DiTullio
Ryan DiTullio 2021년 6월 2일

0 개 추천

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.

카테고리

도움말 센터File Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

제품

릴리스

R2021a

질문:

2021년 6월 1일

편집:

2021년 6월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by