反步法设计步骤及仿真验证(非线性系统)

考虑以下单输入,单输出非线性系统:

\begin{cases} \dot{x}_{1}=x_{2}+\sin{x_{1}}\\ \dot{x}_{2}=u+x^{2}_{1}+x_{2}\\ \end{cases}

反步法的设计思想是每一个子系统  \dot{x}_{1}=x_{2}+\sin{x_{1}} 中 x_{2} 为虚拟控制,通过适当的虚拟反馈x_{2} = \alpha_{1},使得系统的前面状态达到渐进稳定。但是系统的解一般不满足x_{2} = \alpha_{1},因此我们引入误差变量,期望通过控制作用,使得 x_{2} 与虚拟反馈 \alpha_{1} 间具有某种渐进特性,从而实现整个系统的渐进稳定。

定义以下误差坐标变换(反步法的坐标变换)

\begin{cases} e_{1}=x_{1}\\ e_{2}=x_{2}-\alpha_{1} \end{cases}

\alpha_{1} 代表虚拟控制器

反步法设计步骤如下(不断构造李雅普诺夫函数使系统稳定):

Step1:

定义李雅普诺夫函数为:

V_{1} = \frac{1}{2}e^{2}_{1}

显而易见   V_{1} >0,  对 V_{1} 求导得:

\dot{V}_{1}=x_{1}\dot{x}_{1}

将  \dot{x}_{1} = x_{2} + \sin{x}_{1}  带入 \dot{V}_{1}得:

\dot{V}_{1} = e_{1}(- e_{1}+x_{1}+x_{2} + \sin{x}_{1} )

根据  坐标变换  e_{2}=x_{2}-\alpha_{1}  可知,x_{2}=e_{2}+\alpha_{1}

\dot{V}_{1} = e_{1}( -e_{1}+x_{1}+e_{2}+\alpha_{1} + \sin{x}_{1} )

为了使系统稳定,让  \alpha_{1} = -\sin{x}_{1}

即:\dot{V}_{1} = -e^{2}_{1} + e_{1}e_{2}

显然,如果 z_{2} = 0,(即:\alpha_{1} = -\sin{x}_{1}),由\dot{V}_{1} = -e^{2}_{1} + e_{1}e_{2}可知,e_{1}渐进稳定。但是一般情况e_{2}\neq 0,此时我们再引入虚拟控制 \alpha_{2} 使得误差 e_{2}=x_{2}-\alpha_{1}具有期望的渐进性态。为此,我们进行下一步设计

Step2:

定义李雅普诺夫函数为:

V_{2} = \frac{1}{2}e^{2}_{2}+V_{1}

显而易见   V_{2} >0,  对 V_{2}求导得:

\dot{V}_{2} = \dot{e}_{2}e_{2}-e^{2}_{1} + e_{1}e_{2}

将 \dot{e}_{2}=\dot{x}_{2}-\dot{\alpha}_{1}  带入上式可得:

\dot{V}_{2} =e_{2}(\dot{x}_{2}-\dot{\alpha}_{1})-e^{2}_{1} + e_{1}e_{2}

\dot{x}_{2}=u+x^{2}_{1}+x_{2}带入上式可得:

\dot{V}_{2} =e_{2}(u+x^{2}_{1}+x_{2}-\dot{\alpha}_{1})-e^{2}_{1} + e_{1}e_{2}

为了使得\dot{V}_{2}<0,设计控制器如下:

u=-e_{1} -m*e_{2}-x^{2}_{1}-x_{2}+\dot{\alpha}_{1}

其中m为正参数 将 u 带入 \dot{V}_{2}得:

\dot{V}_{2}=-m*e^{2}_{2}\leqslant 0

仿真验证:

设置初始值为:x_{1} = 0.1; x_{2} = 0.1;参数设置为:m = 25;

x_{1} 和 x_{2}趋于稳定如图所示:

反步法设计步骤及仿真验证(非线性系统)_第1张图片

控制器如图所示:

反步法设计步骤及仿真验证(非线性系统)_第2张图片

代码如下:

stepLength = 0.002;                               
N = 100000;                                        
timeStart = 0;                                     
timeEnd = N * stepLength;                          
t = timeStart:stepLength:timeEnd ;               
k = 1;  % 迭代起始步数
% 参数
m = 25;
x1 = zeros(size(t));
x2 = zeros(size(t));
x1(:,1) = 0.1;
x2(:,1) = 0.1;
for tt = timeStart : stepLength: (N-1)*stepLength
    k
    e1 = x1(:,k);
    alpha1 = -sin(x1(:,k));
    e2 = x2(:,k) - alpha1;
    u(:,k) = -e1-m*e2 -x1(:,k)^2-x2(:,k);
    % 非线性系统
    dx1 = x2(:,k) + sin(x1(:,k));
    dx2 = u(:,k) + x1(:,k)^2 + x2(:,k);
    % 更新坐标
    x1(:,k+1) = x1(:,k) + dx1 * stepLength;                                            
    x2(:,k+1) = x2(:,k) + dx2 * stepLength;  
    k = k+1;  
end
figure
plot(t,x1,'linewidth',1.5)
hold on
plot(t,x2,'linewidth',1.5)
legend('x1','x2')
xlabel('Time(Sec)')

figure
plot(timeStart:stepLength:(N-1)*stepLength,u,'linewidth',1.5);
legend('u')
xlabel('Time(Sec)')

你可能感兴趣的:(matlab)