FUNCTION REFERENCE
review
Review an MPC controller with bounded text and numerical diagnostics, without plots or changing the controller or estimator mode.
Review an MPC controller with bounded text and numerical diagnostics, without plots or changing the controller or estimator mode.
Syntax
review(c)Syntax
report = review(c)Zero outputs prints the report even with a semicolon. One output returns a scalar struct silently. No GUI is opened. The text is also report.Text (at most 32768 bytes, subject to host limits). Long vectors show their first eight column-major entries with an explicit ellipsis; report.Weights retains the complete shared weight matrices.
Example
c=mpc(ss(.8,.2,1,0,.1),.1,6,2); r=review(c); r.NominalStability.MaxAbsEigenvalueExample
c=mpc(ss(.8,.2,1,0,.1)); review(c);Fields: Plant (States, Inputs, Outputs, MV, MD, UD, MO, UO, Ts), PredictionHorizon, ControlHorizon, Weights, InternalStability, NominalStability, SteadyState, BaselineError, HessianMatrix, Regularization, HardConstraints and Text. Each check contains numeric Assessed and Pass (0/1), Reason and numeric results. Pass=0 with Assessed=0 means not assessed; an unavailable numeric result is NaN and its Matrix is empty. HardConstraints has IssueCount, FiniteBoundEntries and bounded Details. FiniteBoundEntries counts stored finite profile entries, not repeated horizon values.
InternalStability.MaxAbsEigenvalue and Matrix describe Ac, the unconstrained controller alone, with state z=[augmented observer prior; previous scaled MV]. Its pole test allows max |eig(Ac)| <= 1+1e-9, including the default integral controller's unit pole; this is not a claim of asymptotic stability. NominalStability.MaxAbsEigenvalue and Matrix describe Acl, the physical plant connected to that controller, with state [physical plant deviation; z]. Strict nominal stability requires max |eig(Acl)| < 1-1e-9. Neither matrix is the open-loop plant A.
Conventions: signals use scaled deviations internally; plant states stay in engineering units. Prediction rows are internally MO then UO; public OV properties, output weights/scales, bounds and references use physical plant output order. Report steady-state error rows/columns follow physical plant output/reference order. MD and UD stay at nominal, with zero stochastic inputs. References are constant physical values. Nominal U, Y, X, discretized DX, scale factors and MV targets enter the same move objective as mpcmove. Constraints are ignored for stability and offset analysis.
Exact realization: let the first-move law from the actual QP be u=Kx*x_corrected+Kl*u_previous+Kr*r_deviation+k0. Let A, B=Bu, Cm, M and L be the prediction/estimator matrices; x_corrected=(I-M*Cm)*prior+M*ym_deviation, apart from the nominal affine term. Define U=[Kx*(I-M*Cm), Kl], D=Kx*M, Ac=[A-L*Cm,0]+[B;I]*U (the first bracket has a zero bottom row), By=[L+B*D;D], Br=[B*Kr;Kr]. For physical plant Ap, scaled MV matrix Bp, and measured plant rows Cp divided by their output scales, Acl=[Ap+Bp*D*Cp, Bp*U; By*Cp, Ac], Bref=[Bp*Kr;Br]. Matrix dimensions and a bounded Schur iteration are checked before the eigensolve. Custom supplied L/M gains are used as supplied; custom external state estimation is not assessed.
SteadyState.Matrix is Error=I-Ccl*((I-Acl)\Bref), where Ccl=[physical plant C,0]. BaselineError=-Ccl*((I-Acl)\b) also includes the nominal affine term b. No inverse is formed. MaxAbsOffset is the maximum absolute baseline error and unit-step error over positive-output-weight rows/references; zero-weight outputs are excluded from the verdict. Pass requires <=1e-6 engineering units. This tests separate unit steps and the baseline, not all combined reference amplitudes. A non-strictly-stable nominal loop, a rank-deficient I-Acl (smallest singular value <=1e-12*max(1,largest)), a solve residual above 1e-10, or no controlled outputs produces an explicit not-assessed reason.
HessianMatrix.Matrix is the exact condensed solver H in 0.5*z'*H*z+f'*z, z=[scaled MV increments at block starts; ECR slack]. It includes the 2*Weights.ECR slack diagonal and any mpcmove regularization. ConditionNumber=max eig(H)/min eig(H) for SPD H, Inf otherwise. Healthy requires SPD, condition <=1e12 and zero added regularization. Regularization reports the diagonal actually added to move coordinates; a regularized singular objective is never advertised healthy. The Hessian is assembled by the same helper used by mpcmove; it is not the plant, estimator covariance or an uncondensed surrogate.
HardConstraints checks hard MV/rate interval reachability starting at nominal LastMove across the horizon, including held increments, and contradictory hard OV Min/Max. Soft bounds (positive ECR) do not restrict these hard intervals. Details identify the channel and first conflicting step. A pass means no contradiction found by these checks; it does not guarantee plant/output reachability or closed-loop feasibility. Ordinary finite bounds are listed without being declared invalid. Profiles hold their final row as in mpcmove.
Limits: numerical analysis supports up to 32 plant/augmented states, 16 physical inputs/outputs, prediction horizon 128 and 64 QP variables including slack, subject to existing prediction/QP and host memory limits. Blocking vectors and time-varying weight rows retain the actual Hessian check but give explicit not-assessed stability/offset results. Oversized models, construction failures and singular steady-state systems also carry explicit reasons. Cancellation is checked throughout; dense eigensolves have bounded iteration counts. These nominal unconstrained diagnostics are not a safety guarantee for arbitrary constrained trajectories.
Differences from MATLAB: documented numeric nested structs and text only; no GUI, memory-size test, mixed-constraint feasibility proof or soft-weight balance recommendation. The internal pole criterion and strict nominal criterion are stated above. Nonlinear, adaptive, explicit MPC and code generation remain unsupported.
Reference: https://www.mathworks.com/help/mpc/ref/mpc.review.html
Reference: https://www.mathworks.com/help/mpc/ug/optimization-problem.html
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.