Error in port widths or dimensions.

13 次查看(过去 30 天)
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