資源簡介
相當(dāng)不錯,迭代次數(shù)為20次,希望多多好評
代碼片段和文件信息
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;
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????841??2011-04-13?19:16??ILC_openedloop\ctrl.m
?????文件????????599??2011-04-13?15:21??ILC_openedloop\input.m
?????文件????????720??2011-04-16?19:31??ILC_openedloop\main.m
?????文件??????22230??2011-04-14?20:02??ILC_openedloop\simulation.mdl
?????目錄??????????0??2011-04-14?20:02??ILC_openedloop
-----------?---------??----------?-----??----
????????????????24390????????????????????5
評論
共有 條評論