Why do I get a "marshall.coerceToClass" error when simulating model containing Adaptive MPC block?

4 Ansichten (letzte 30 Tage)
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 = 3x3 Actual = 4x4
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 - "Time-Varying MPC Control of a Time-Varying Plant".
Please run the below command in the MATLAB R2018b command window to get the release specific documentation which discusses the mentioned example.
web(fullfile(docroot, '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?
Please follow the below link to search for the required information regarding the current release:

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 18 Jan. 2024
Bearbeitet: MathWorks Support Team am 4 Mär. 2024
  1.  In the Adaptive MPC block, the plant model is being specified by "mpcobj", which has 3 states, 1 input and 1 output. Therefore, the model provided to the Adaptive MPC block should also have 3 states, 1 input and 1 output. When the order of transfer function is increased within the 'Time Varying Predictive Model' block, the number of states after converting to state space becomes 4, and an error is thrown because mpcobj expects an order of 3. There are some ways to update the plant model and the predictive model during simulation. To explain this in more detail, I am including a couple of documentation links below:
    Please run the below in the command window of installed MATLAB R2018b version to get release specific documentation.
    web(fullfile(docroot, 'mpc/ref/mpc.mpcmoveadaptive.html#buik3vp-1-Plant'))
    Please run the below in the command window of installed MATLAB R2018b version to get release specific documentation\n
    web(fullfile(docroot, 'mpc/ref/adaptivempccontroller.html#bugls7u-7'))
    To avoid the error, please ensure that the Plant model for mpcobj and the model inports for Adaptive MPC controller are always consistent with each other.
  2. Regarding resources on implementing Adaptive Control, please find below some examples on Adaptive MPC design:
    Please run the below in the command window of installed MATLAB R2018b version to get release specific documentation
    web(fullfile(docroot, 'mpc/examples.html?category=adaptive-mpc-design&s_tid=CRUX_gn_example'))
    The LPV (linear parameter varying) block in Control System Toolbox may also be helpful. See the link below:
    Please run the below in the command window of installed MATLAB R2018b version to get release specific documentation
    web(fullfile(docroot, 'mpc/ug/adaptive-mpc-control-of-nonlinear-chemical-reactor-using-linear-parameter-varying-system.html'))
    Please follow the below link to search for the required information regarding the current release:https://www.mathworks.com/help/

Weitere Antworten (0)

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by