Error in port widths or dimensions.

11 visualizzazioni (ultimi 30 giorni)
Mounira
Mounira il 13 Dic 2023
Risposto: Gowtham il 20 Dic 2023
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

Risposta accettata

Gowtham
Gowtham il 20 Dic 2023
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

Più risposte (0)

Categorie

Scopri di più su Linear Plant Specification in Help Center e File Exchange

Prodotti


Release

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by