Set the first input signal as a manipulated variable and the second input as an unmeasured disturbance.
plant = setmpcsignals(plant,'MV',[1],'ud',[2]);
为已定义的工厂创建MPC控制器。
MPCobj = mpc(plant,0.1);
-->The "PredictionHorizon" property of "mpc" object is empty. Trying PredictionHorizon = 10. -->The "ControlHorizon" property of the "mpc" object is empty. Assuming 2. -->The "Weights.ManipulatedVariables" property of "mpc" object is empty. Assuming default 0.00000. -->The "Weights.ManipulatedVariablesRate" property of "mpc" object is empty. Assuming default 0.10000. -->The "Weights.OutputVariables" property of "mpc" object is empty. Assuming default 1.00000.
Extract the input disturbance model.
indist = getindist(MPCobj);
-->Converting model to discrete time. -->The "Model.Disturbance" property of "mpc" object is empty: Assuming unmeasured input disturbance #2 is integrated white noise. Assuming no disturbance added to measured output channel #1. -->The "Model.Noise" property of the "mpc" object is empty. Assuming white noise on each measured output channel.
Retrieve Input Disturbance Model Channels with Default Integrated White Noise
-->The "PredictionHorizon" property of "mpc" object is empty. Trying PredictionHorizon = 10. -->The "ControlHorizon" property of the "mpc" object is empty. Assuming 2. -->The "Weights.ManipulatedVariables" property of "mpc" object is empty. Assuming default 0.00000. -->The "Weights.ManipulatedVariablesRate" property of "mpc" object is empty. Assuming default 0.10000. -->The "Weights.OutputVariables" property of "mpc" object is empty. Assuming default 1.00000.
提取默认输出干扰模型。
[indist,channels] = getindist(MPCobj);
-->Converting model to discrete time. -->The "Model.Disturbance" property of "mpc" object is empty: Assuming unmeasured input disturbance #2 is integrated white noise. Assuming unmeasured input disturbance #3 is white noise. Assuming no disturbance added to measured output channel #1. -->The "Model.Noise" property of the "mpc" object is empty. Assuming white noise on each measured output channel.
Check which input disturbance channels have integrated white noise added by default.
channels
channels = 1
An integrator has been added only to the first unmeasured input disturbance. The other input disturbance uses a static unity gain to preserve state observability.
ndoutputs, wherendis the number of unmeasured disturbance inputs defined inmpcobj.model.plant.. Each disturbance model output is sent to the corresponding plant unmeasured disturbance input.
IfMPCobjdoes not have any unmeasured disturbance,indistis returned as an empty state-space model.
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.