资源简介

控制增益符号已知/未知的MIMO时滞系统的自适应控制

资源截图

代码片段和文件信息

%~~~~~~~~~~~~~~~~~~~~~~~ function for p6main.m ~~~~~~~~~~~~~~~~~~~~~~~~
function f=directp01fun(tx) 
global e1
global u1
%--------------Neural network control tpzhang------ initialize ---------
f=zeros(581);
gama=0.5;
k1=1;
k2=1;
Mf=4;
wm=0.001;
eps=1;
eta1=0.01;eta2=0.01;eta3=0.01;eta=0.01;
xd1=[pi*sin(t)/30pi*cos(t)/30]‘;
x1=[x(1) x(2)]‘;
K1=x(3:5);
W1=x(6:15);
V1=zeros(410);
for i=1:10
   V1(:i)=x(4*i+12:4*i+15);
end
%------------------------- error & swith function ---------------------
e1=xd1-x1;
sigama=k1*e1(2)+k2*e1(1)-pi*sin(t)/30;
%------------------------- fuzzy base function ------------------------
z1=[x(1) x(2) sigama]‘;
zbar1=[z1‘ 1]‘;

ds1=zeros(101);
hats1=zeros(101);
for i=1:10
   ds1(i)=(gama*exp(-gama*V1(:i)‘*zbar1))/(1+exp(-gama*V1(:i)‘*zbar1))^2;
   hats1(i)=1/(1+exp(-gama *V1(:i)‘*zbar1));
end

%//i rules & vector z(j); i=5; j=7// 
ph1=zeros(31);
ph1=[norm(zbar1*W1‘*diag(ds1)‘fro‘) norm(diag(ds1)*V1‘*zbar1) 1]‘;
un=W1‘*hats1;

 
%---------------------------- control law -----------------------------
Fx=15.78+0.0366*x(2)^2;
Dx=1.2;
vbar=4;
bL=1.12;p=[15 5;5 5];
Q=[10 0;0 10];pn=[5 5]‘;
%define sat function
phi1=0.001;
y=e1‘*pn/phi1;
if y<=-1 
    sat1=-1;
elseif abs(y)<=1
    sat1=y;
else 
    sat1=1;
end

ve=e1‘*p*e1;
if ve>2*vbar
   Ivbar=1;
else 
   Ivbar=0;
end
 xtal2=zeros(401);
 xtal=zeros(150001);
 bx=abs(0.3*cos(x(1)));
if t-1-0.5*sin(t)<=0
   delta=0.1*x(1)^2;
   b1x=delta+bx;
else
   for q=1:40 
     for m=(375*(q-1)+1):(375*q);
       b1x=bx+xtal2(q);
     end
   end
end
hmax=0.2;
 uc=(K1‘*ph1+(Dx+x(56)+b1x)/bL)*sat1;
 us=Ivbar*sat1*(abs(un)+(hmax+b1x+Fx+abs(-pi*sin(t)/30)+abs(k1*e1(2)+k2*e1(1)))/bL);
 u1=un+uc+us;
  
%------------------------------ equation ------------------------------
j=1;
f(1)=x(2);
if t-1-0.5*sin(t)<=0
   f(2)=(9.8*sin(x(1))-0.05*x(2)^2*cos(x(1))*sin(x(1))/1.1)/(2/3-0.05*(cos(x(1)))^2/1.1)...
   +((cos(x(1))/1.1)/(2/3-0.05*(cos(x(1)))^2/1.1))*u1+0.3*cos(x(1))+0.1*x(1)^2;
   N=375;
    for i=1:N
        xtal(i)=x(1);
        xtal2(1)=0.05;
        if xtal2(1)<=abs(xtal(i))
            xtal2(1)=abs(xtal(i));
        end
    end
else
   f(2)=(9.8*sin(x(1))-0.05*x(2)^2*cos(x(1))*sin(x(1))/1.1)/(2/3-0.05*(cos(x(1)))^2/1.1)...
   +((cos(x(1))/1.1)/(2/3-0.05*(cos(x(1)))^2/1.1))*u1+0.3*cos(x(1))+0.1*xtal(j)^2;
   j=j+1;
%    for i=1501:40000
%       xtal(i)=x(1);
      for k=1:39;
        for l=(375*k+1):(375*(k+1));
            xtal(l)=x(1);
            xtal2(k+1)=0.05;
            if xtal2(k+1)<=abs(xtal(l))
                xtal2(k+1)=abs(xtal(l));
            end
        end
      end
%     end
end
f(3:5)=eta3*abs(e1‘*pn)*ph1;

norm1=0;
for i=6:15
   norm1=x(i)‘*x(i)+norm1;
end
norm1=sqrt(norm1);

if norm1=0) 
     f(6:15)=eta1*(hats1-diag(ds1)*V1‘*zbar1)*e1‘*pn;
   else  
     f(6:15)=eta1*(hats1-diag(ds1)*V

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       5141  2010-03-26 17:57  p102fun.m

     文件       3198  2010-03-26 18:00  p102main.m

     文件       3188  2008-04-05 09:23  directp01fun.m

     文件       2577  2008-04-04 21:19  directp01main.m

----------- ---------  ---------- -----  ----

                14104                    4


评论

共有 条评论