资源简介
基于状态空间的模型预测MPC控制器的设计,附带例子(MATLAB)
代码片段和文件信息
function f=mpcsetup(ABCDpmQRx0u0)
% MPCSETUP Set-up State Space MPC controller
%
% SSMPC=MPCSETUP(ABCDPMQRX0U0) returns a function handle for a
% state space model predictive control for the state space model
% x(k+1) = Ax(k) + Bu(k)
% y(k) = Cx(k) + Du(k)
% with predictive horizon P and moving horizon M performance weights of
% output Q and of input R initial state X0 and initial control U0.
%
% SSMPC is the online controller which can be called as follows
%
% U = SSMPC(YREF) returns the control input U (nu by 1) according to
% current measured output Y (1 by ny) and future reference REF (nr by
% ny nr>=1).
%
% The MPC minimize the following performance criterion:
%
% J = min Y‘QY + U‘RU
%
% The online controller is implemented as a nested function so that the
% state of the internal model can be kept inside of the function. This
% simplifies the input and output interface of the online controller.
%
% See also: mpc dmc
% Version 1.0 by Yi Cao at Cranfield University on 20 April 2008
% Example: 2-CSTR model
%{
% Six-state model
A=[ 0.1555 -13.7665 -0.0604 0 0 0
0.0010 1.0008 0.0068 0 0 0
0 0.0374 0.9232 0 0 0
0.0015 -0.1024 -0.0003 0.1587 -13.6705 -0.0506
0 0.0061 0 0.0006 0.9929 0.0057
0 0.0001 0 0 0.0366 0.9398];
Bu=[0.0001 0
0 0
-0.0036 0
0 0.0001
0 0
0 -0.0028];
Bd=[ 0 0
0 0
0.0013 0
0 0
0 0
0 0.0008];
C=[0 362.995 0 0 0 0
0 0 0 0 362.995 0];
D=zeros(22);
% Prediction horizon and moving horizon
p=10;
m=3;
% Performance wights
Q=1.5*eye(2*p);
R=eye(2*m);
% MPC set-up
ssmpc=mpcsetup(ABuCDpmQR);
% Simulation length and variables for results
N=1500;
x0=zeros(61);
Y=zeros(N2);
U=zeros(N2);
% Predefined reference
T=zeros(N2);
T(10:N:)=1;
T(351:N:)=3;
T(600:N:)=5;
T(1100:N:)=3;
% Simulation
for k=1:N
% Process disturbances
w=Bd*(rand(21)-0.5)*2;
% Measurements noise
v=0.01*randn(21);
% actual measurement
y=C*x0+v;
% online controller
u=ssmpc(yT(k:end:));
% plant update
x0=A*x0+Bu*u+w;
% save results
Y(k:)=y‘;
U(k:)=u‘;
end
t=(0:N-1)*0.1;
subplot(211)
plot(tYtT‘r--‘‘linewidth‘2)
title(‘output and setpoint‘)
ylabel(‘temp C^\circ‘)
legend(‘T_1‘‘T_2‘‘Ref‘‘location‘‘southeast‘)
subplot(212)
stairs(tU‘linewidth‘2)
legend(‘u_1‘‘u_2‘‘location‘‘southeast‘)
title(‘input‘)
ylabel(‘flow rate m^3/s‘)
xlabel(‘time s‘)
%}
% Input and output check
error(nargchk(810nargin));
error(nargoutchk(11nargout));
% dimension of the system
nx=size(A1);
[nynu]=size(D);
%
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-11-13 11:04 基于状态空间的模型预测控制ssmpc\
文件 1327 2009-05-20 16:16 基于状态空间的模型预测控制ssmpc\license.txt
文件 4696 2008-04-22 00:12 基于状态空间的模型预测控制ssmpc\mpcsetup.m
文件 3819 2008-04-22 00:11 基于状态空间的模型预测控制ssmpc\ssmpctutorial.m
- 上一篇:hopfield神经网络matlab实现
- 下一篇:多变量广义预测控制
相关资源
- MPC路径跟踪
- 基于模型预测控制的车辆轨迹跟踪问
- 分布式预测控制程序
- Model Predictive Control System Design using M
- Model Predictive Control System Design and Imp
- matlab预测控制工具箱使用手册
-
simuli
nk中mpc模块的详细说明 - 模型预测控制系统的Matlab设计和实施
- MPC程序总结MATLAB
- MPC_MATLAB_Book.pdf
- 模型预测控制MPC程序
- MATLAB环境下的MPC源代码
- ACC_Vehicle_MPC-20191104.zip
- 多线性主成分分析MPCA
- MPC-test.zip
- matlab模型预测控制
- PMSM_MPCC+MPTC+MRAC+SMC.zip
- mpc预测控制算法
- LQR路径跟踪.rar
-
simuli
nk中mpc模块 - 自适应MPC算法
-
自适应MPC的simuli
nk - 模型预测控制MPC模型预测电流控制,
- 非线性模型预测控制算法程序
- MPC相关
-
MPC预测控制算法中的DMC算法simuli
n -
模型预测simuli
nk - mpc MATLAB 代码
-
simuli
nk 使用mpc来控制 - 非线性模型预测控制的matlab参考代码
评论
共有 条评论