Matlab MPC
Matlab MPC
Kmpc = mpccon(model,ywt,uwt,M,P)
model : Step response coefficient matrix of model. ywt,uwt : output and input weighting matrices. M : control horizons. P : prediction horizon. Kmpc : Controller gain matrix
Output:
model = tfd2step(tfinal,delt,nout,g1,...,g25)
tfinal: truncation time for step response model. delt: sampling interval for step response model. nout: number of outputs, ny. g1, g2,...: SISO transfer function ordered to be read in columnwise (by input). The number of transfer functions required is ny*nu. (nu=number of inputs). Limited to ny*nu <= 25. plant: step response coefficient matrix in MPC step format.
46
Output:
g = poly2tfd(num,den,delt,delay)
g: transfer function.
num : Coefficients of the transfer function numerator. den : Coefficients of the transfer function denominator. delt : Sampling time. Can be 0 (for continuous-time system) or > 0 (for discrete-time system). delay : Pure time delay (dead time). Can be >= 0.
Output:
47
OPTIONAL INPUTS:
usat: the matrix of manipulated variable constraints.It is a vector of the lower limits (Ulow), upper limits (Uhigh) and rate of change limits (DelU) on the manipulated variables. tfilter: time constants for noise filter and unmeasured disturbance lags. dplant: step response coefficient matrix for the disturbance generated by the function tfd2step. dmodel: step response coefficient matrix for the measured disturbance effect on the model output generated by the function tfd2step. dstep: matrix of disturbances to the plant.
OUTPUT:
48
[yp,u,ym] = cmpc(plant,model,ywt,uwt,M,P,tend,r,ulim,ylim...
REQUIRED INPUTS:
OPTIONAL INPUTS:
ulim: matrix of manipulated variable constraints. It is a trajectory of lower limits (Ulow), upper limits (Uhigh) and rate of change (DelU). ylim: matrix of output variable constraints. It is a trajectory of lower (Ylow) and upper limits (Yhigh) on the output variables. tfilter, dplant, dmodel, dstep
OUTPUT:
49