I'm using the Adaptive MPC block in my model and I run into the following error:
Size mismatch for MATLAB expression 'marshall.coerceToClass'. Expected = 3×3 Actual = 4×4
In my model, I'm sending a state space model as input to the 'Model' port of the Adaptive MPC block, and this model originates from within a MATLAB Function block called 'Time Predictive Model'. This is very similar to one of the examples provided in the MPC Toolbox documentation – https://www.mathworks.com/help/releases/R2018b/mpc/ug/time-varying-mpc-control-of-a-time-varying-linear-system.html
I initially suspected that the error was originating from within the ML Function block. When I reduced the number of poles and zeros in the transfer function (this is in the step before it is discretized and converted to state space), I found the model to run without errors. Therefore, I have the following questions:
– How do I increase the order of their transfer function without running into the above error?
– I'm mainly interested in implementing some version of Adaptive Control as they have a system that is time-varying. I currently use a modified version of the 'Time-Varying Plant' example linked above. Are there any other examples or functionalities I can use, either from the MPC Toolbox, or from the larger Controls Toolbox that would be suitable for a time-varying plant?
Best Answer