Error in port widths or dimensions.

조회 수: 13 (최근 30일)
Mounira
Mounira 2023년 12월 13일
답변: Gowtham 2023년 12월 20일
Hello,
so i have a model; dx'= Ax+ B*u; and y=Cx+Du; with one input and one output, and output=state;
this model is represented with state space representation in simulink, and i want to connect this to Model predictive controller, but I kepp getting this error that : "The signal connected to the "mo" port of the "statespacerepresentation/MPC Controller" block must be a scalar signal."
so the question is why?
thanks in advance for the answer

채택된 답변

Gowtham
Gowtham 2023년 12월 20일
Hello Kawsar,
It is my understanding that you are trying to connect the output of a Simulink model to the mo port of the MPC Controller from the Model Predictive Controller Toolbox.
I tried to reproduce the issue at my end, and it ran smoothly. Your approach and the model appear to be aligned with the specified equation. However, the error indicates that the output from your state-space model, which you're feeding into the MPC, isn't a scalar as required by the MPC block. The signal should have a dimensionality of 1, since the MPC is intended to accept only a single scalar value for its measured output.
I suggest you take the following precautions to resolve the issue:
  • Check the dimensions of C and D: Their dimensions must be such that their sum of product with x and u should be a scalar.
  • Signal dimensions in Simulink: Make sure that the actual signal being output from your state-space block is a scalar. You can use the Signal Specification block to enforce a signal to be a scalar if necessary.
  • MPC Controller Block: Double-check the MPC Controller block settings. Ensure that the Measured output (mo) port is configured to accept a scalar signal. The MPC block should be set up to match the dimensions of your system.
Kindly refer to the following MATLAB Documentation(s) for further information on MPC Controller Block and Signal Specification Block:
Hope this helps.
Best Regards,
Gowtham

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear Plant Specification에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by