-
大小: 1KB文件類型: .zip金幣: 2下載: 0 次發(fā)布日期: 2021-05-18
- 語言: Matlab
- 標(biāo)簽: matlab??backstepping??反步法??反演法??
資源簡介
一個(gè)簡單的matlab的backstepping例程,適合新手學(xué)習(xí)入手

代碼片段和文件信息
%這個(gè)程序可以通過反向命令來實(shí)現(xiàn)stabils
clear?all;close?all;clc;
t0=0;tf=10;h=0.01;n=(tf-t0)/h;xe=[];ue=[];Te=[];te=[];x=[0?0?1?0?0]‘;u=[0?0];
global?a1?a2?a3?a4?a5?a6?a7?b?c
Rs=0.18;Rr=0.15;p=1;
Ls=0.0699;Lr=0.0699;Lm=0.068;
J=0.0586;TL=0;
sigma=1-Lm^2/(Ls*Lr);?%k11=60;k22=30;k33=150;k44=30;?flux=1;
alpha=Rr/Lr;
beta=Lm/(sigma*Ls*Lr);
gama=Lm^2*Rr/(sigma*Ls*Lr^2)+Rs/(sigma*Ls);
miou=p*Lm/Lr;k11=60;k22=3;k33=150;k44=3;
a1=miou/J;a2=gama;a3=-beta*p;a4=-p;a5=-alpha*Lm;
a6=-alpha;a7=alpha*beta;b=1/(sigma*Ls);c=TL/J;
x1d=100;x3d=2;t=0;tau1=25;tau2=25;
for?i=0:n
???k1=h*syst(xu);
???k2=h*syst(x+(k1/2)u);
???k3=h*syst(x+(k2/2)u);
???k4=h*syst(x+k3u);
???x=x+(k1+2*k2+2*k3+k4)/6;
???e1=x1d-x(1);
???e3=x3d-x(3);
???x2x3d=(1/a1)*(c+k11*e1);
???x4d=(1/a5)*(a6*x(3)-k33*e3);
???e2=x2x3d-x(2)*x(3);
???e4=x4d-x(4);
???phi1=(1/a1)*k11*(-k11*e1+a1*e2)-x(3)*(-a2*x(2)+a3*x(1)*x(3)+a4*x(1)*x(4)+a5*x(2)*x(4)/x(3))-x(2)*(a6*x(3)-a5*x(4));
???phi2=(1/a5)*(a6*(a6*x(3)-a5*x(4))-k33*(-k33*e3-a5*e4))-(-a2*x(4)+a7*x(3)-a4*x(1)*x(2)-a5*(x(2)^2)/x(3));
???u(1)=(1/(b*x(3)))*(a1*e1+k22*e2+phi1-tau1*sign(e2));
???u(2)=(1/b)*(-a5*e3+k44*e4+phi2-tau2*sign(e4));
???U=[cos(x(5))?-sin(x(5));sin(x(5))?cos(x(5))]*[u(2)?u(1)]‘;
???xe=[xe?x];
???ue=[ue?U];
???te=[te?t];
???home
???t=t0+i*h;
end
plot(texe(1:))
grid
figure(2)
plot(texe(3:))
grid
figure(3)
plot(teue(1:))
figure(4)
plot(teue(2:)‘m‘)
grid
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-08-06?17:59??25505492BS\
?????文件????????1444??2018-08-06?18:01??25505492BS\BackStepping.m
?????文件?????????900??2018-08-06?18:02??25505492BS\syst.m
評(píng)論
共有 條評(píng)論