• 大小: 13KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-27
  • 语言: 其他
  • 标签:

资源简介

关于迭代学习控制的仿真,里面还没有输入系统输入,适合初学者

资源截图

代码片段和文件信息

function [sysx0strts] = spacemodel(txuflag)
switch flag
case 0
    [sysx0strts]=mdlInitializeSizes;
case 3
    sys=mdlOutputs(txu);
case {249}
    sys=[];
otherwise
    error([‘Unhandled flag = ‘num2str(flag)]);
end
function [sysx0strts]=mdlInitializeSizes
sizes = simsizes;
sizes.NumContStates  = 0;
sizes.NumDiscStates  = 0;
sizes.NumOutputs     = 1;
sizes.NumInputs      = 4;
sizes.DirFeedthrough = 1;
sizes.NumSampleTimes = 1;
sys = simsizes(sizes);
x0  = [];
str = [];
ts  = [0 0];
function sys=mdlOutputs(txu)
q1d=u(1);dq1d=u(2);

q1=u(3);dq1=u(4);

e1=q1d-q1;
de1=dq1d-dq1;

%Kp=2;临界震荡
Kp=0.5;
Kd=0;

M=2;
if M==1
    Tol=Kd*de1;       %D Type
elseif M==2
    Tol=Kp*e1+Kd*de1;  %PD Type
elseif M==3
    Tol=Kd*exp(0.8*t)*de1;  %Exponential Gain D Type
end
sys=Tol;

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-03-23 09:30  ILC_openedloop\
     文件         841  2011-04-13 19:16  ILC_openedloop\ctrl.m
     文件         599  2011-04-13 15:21  ILC_openedloop\input.m
     文件         702  2019-03-20 10:38  ILC_openedloop\main.m
     文件       22230  2011-04-14 20:02  ILC_openedloop\simulation.mdl
     文件        4501  2019-03-17 13:39  ILC_openedloop\simulation.slxc
     目录           0  2019-03-17 13:39  ILC_openedloop\slprj\
     目录           0  2019-03-17 13:39  ILC_openedloop\slprj\sim\
     目录           0  2019-03-17 13:39  ILC_openedloop\slprj\sim\varcache\
     目录           0  2019-03-17 13:39  ILC_openedloop\slprj\sim\varcache\simulation\
     文件         392  2019-03-17 13:39  ILC_openedloop\slprj\sim\varcache\simulation\checksumOfCache.mat
     目录           0  2019-03-17 13:39  ILC_openedloop\slprj\sim\varcache\simulation\tmwinternal\
     文件         249  2019-03-17 13:39  ILC_openedloop\slprj\sim\varcache\simulation\tmwinternal\simulink_cache.xml
     文件        1696  2019-03-17 13:39  ILC_openedloop\slprj\sim\varcache\simulation\varInfo.mat

评论

共有 条评论

相关资源