资源简介
模型预测控制学习(适合基础学习,主要包括DMC,MPC),内容有程序及建模。

代码片段和文件信息
function p=dmc(p)
% DMC Dynamic Matrix Control
% P=DMC(P) determines the dynamic matrix control (input change) based on
% the plant model (step response) and current measurement stored in the
% structure P.
% Input:
% P.sr - unit step response data
% P.u - current input initially 0
% P.v - past input initially empty
% P.G - dynamic matrix set by the initial call
% P.F - matrix to calculate free response set by the initial call
% P.k - DMC gain set by the initial call
% P.r - reference (set point)
% P.a - reference smooth factor
% P.p - prediction horizon
% P.m - moving horizon
% P.y - current mrasurement
% P.la - performance criterion weight i.e. J = ||r-y|| + p.la*||du||
% where du is the input change
% Output:
% P.u - new input for next step
% P.f - updated free response
% P.G - dynamic matrix if it is the first step.
% P.k - DMC gain if it is the first step
%
% See Also: mpc
% Version 1.0 created by Yi Cao at Cranfield University on 6th April 2008.
% Example:
%{
p.sr=filter([0 0 0.2713][1 -0.8351]ones(501));
p.p=10;
p.m=5;
p.y=0;
p.v=[];
u=zeros(13);
N=120;
Y=zeros(N1);
U=zeros(N1);
R=zeros(N1);
R([1:30 61:90])=1;
p.la=1;
for k=1:120
p.a=0;
p.r=R(k:min(Nk+p.p));
if k>60
p.a=0.7;
end
p=dmc(p);
Y(k)=p.y;
U(k)=p.u;
u=[u(2:3) p.u];
p.y=0.8351*p.y+0.2713*u(1);
end
subplot(211)
plot(1:NY‘b-‘1:NR‘r--‘[60 60][-0.5 1.5]‘:‘‘linewidth‘2)
title(‘solid: output dashed: reference‘)
text(351‘\alpha=0‘)
text(951‘\alpha=0.7‘)
axis([0 120 -0.5 1.5])
subplot(212)
[xxyy]=stairs(1:NU);
plot(xxyy‘-‘[60 60][-0.5 1.5]‘:‘‘linewidth‘2)
axis([0 120 -0.5 1.5])
title(‘input‘)
xlabel(‘time min‘)
%}
% Input and output check
error(nargchk(11nargin));
error(nargoutchk(01nargout));
% length of step response
N=numel(p.sr);
P=p.p;
% initial setup
if isempty(p.v)
% number of past inputs to keep
n=N-P;
% storage for past input
p.v=zeros(n1);
% matrix to calculate free response from past input
x=p.sr(1:n);
p.F=hankel(p.sr(2:P+1)p.sr(P+1:N))-repmat(x(:)‘P1);
% dynamic matrix
p.G=toeplitz(p.sr(1:P)p.sr(1)*eye(1p.m));
% calculate DMC gain
R=chol(p.G‘*p.G+p.la*eye(p.m));
K=R\(R‘\p.G‘);
% only the first input will be used
p.k=K(1:);
p.u=0;
end
% free response
f=p.F*p.v+p.y;
% smooth reference
nr=numel(p.r);
if nr>=P
ref=p.r(1:P);
else
ref=[p.r(:);p.r(end)+zeros(P-nr1)];
end
w=filter([0 (1-p.a)][1 -p.a]refp.y);
% DMC input change
u=p.k*(w-f);
% past input change for next step
p.v=[u;p.v(1:end-1)];
% next input
p.u=p.u+u(1);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-08-16 13:39 MPC程序\
目录 0 2018-09-24 13:42 MPC程序\无约束\
文件 1416 2014-02-23 14:41 MPC程序\无约束\noise.m
文件 280 2018-09-25 19:46 MPC程序\无约束\step_model.m
文件 2403161 2014-02-23 14:42 MPC程序\无约束\step_model.mat
文件 1169443 2014-02-23 14:42 MPC程序\无约束\unconstrained_MPC.mat
文件 1912 2014-02-23 14:42 MPC程序\无约束\unconstrained_m.m
文件 1935 2014-02-23 14:42 MPC程序\无约束\unconstrained_p.m
文件 1888 2014-02-23 14:42 MPC程序\无约束\unconstrained_uw.m
文件 1916 2014-02-23 14:42 MPC程序\无约束\unconstrained_yw.m
目录 0 2018-08-16 13:39 MPC程序\约束\
文件 1782 2014-02-23 14:42 MPC程序\约束\cmpcQP.m
文件 1758 2014-02-23 14:42 MPC程序\约束\cmpcQP_m.m
文件 1735 2014-02-23 14:42 MPC程序\约束\cmpcQP_yw.m
文件 1910 2014-02-23 14:42 MPC程序\约束\cmpcQPnoise.m
文件 2393 2014-02-23 14:42 MPC程序\约束\compare.m
文件 2327554 2014-02-23 14:43 MPC程序\约束\dstatespace.mat
文件 1410 2014-02-23 14:42 MPC程序\约束\genQP.m
文件 392 2014-02-23 14:42 MPC程序\约束\get_F.m
文件 243 2014-02-23 14:42 MPC程序\约束\state_model_c2d.m
文件 939731 2014-02-23 14:43 MPC程序\约束\step_model.mat
目录 0 2018-08-16 13:55 dmc\
文件 2766 2008-04-08 09:18 dmc\dmc.m
文件 28477 2018-08-16 13:48 dmc\dmc.zip
文件 4862 2008-04-08 09:21 dmc\dmctutorial.m
文件 1306 2014-02-12 12:35 dmc\license.txt
目录 0 2018-09-24 13:05 先进控制算法MPC和DMC\
文件 526 2018-03-20 11:06 先进控制算法MPC和DMC\MAC1.m
文件 370 2018-03-20 11:29 先进控制算法MPC和DMC\MAC2.m
文件 310 2018-03-20 17:37 先进控制算法MPC和DMC\MAC3.m
文件 426 2018-03-20 17:22 先进控制算法MPC和DMC\MAC4.m
............此处省略3个文件信息
- 上一篇:思量QQ亮钻大师 v2.0.zip
- 下一篇:计算机网络打作业实现QQ.zip
相关资源
- 2018西门子杯中国智能制造挑战赛逻辑
- AsyncTask文件控制暂停和继续,在状态
- DV泵加罗茨泵独立控制系统PID.smart
- F28335无刷直流电机开闭环控制
- 模糊PID控制 c
- 基于MSP430G2553的蓝牙控制小车
- Verilog FPGA UART串口控制器
- SG3525频率PWM控制均可调模块
- 51单片机控制舵机程序
- Qt Creator opengl实现四元数鼠标控制轨迹
- 机器人单机械臂滑模控制程序
- ply格式文件的读写程序
- [免费]msp430f149控制PS2键盘并用1602显示
- STM32F103RBT6驱动UC1698控制芯片的160160黑
- vhdl与lcd1602实现的多控制电子钟
- 欧姆龙控制2个伺服
- LPC线性预测分析及编码
- 远程桌面(带C 源码)
- 8259A中断控制实验
- nVidia 控制面板 API
- 单片机 DS18B20 温度控制系统
- 单片机AT89s52控制GSM模块TC35i发短信,
- 课程设计蔬菜大棚自动控制系统,包
- 基于proteus的单片机仿真--交通灯控制
- 带时间温度显示的室内灯光控制系统
- 单片机控制的步进电机正反转和加速
- 单片机控制74ls164程序
- 张力控制变频收卷程序
- 基于EWB软件的数码管显示控制器
- 学生成绩管理系统C 源码(很完整)
评论
共有 条评论