已知系统状态方程,设置滑膜面和趋近律,导出状态反馈控制率,导出系统状态的图像matlab代码
时间: 2024-06-07 16:09:55 浏览: 98
假设系统状态方程为:
x_dot = Ax + Bu
其中,A是系统矩阵,B是输入矩阵,u是控制输入,x是状态向量。
滑膜面可以设置为:
S(x) = x'Px + Q
其中,P和Q是待求的滑膜面参数。
趋近律可以设置为:
u = -kx
其中,k是待求的状态反馈增益。
将滑膜面和趋近律代入系统状态方程中,得到:
x_dot = (A - BK)x - BPx'Px - BQ
为了使系统状态能够收敛到滑膜面上,并保持在滑膜面上,需要滑膜面的时间导数沿着滑膜面的方向始终为负:
S_dot = x'PB(A - BK)x < 0
根据这个条件,可以得到待求的滑膜面参数P和Q:
P = C'C
Q = λI
其中,C是系统的可控性矩阵,λ是一个正常数,I是单位矩阵。
然后,可以使用matlab代码求解状态反馈控制率和系统状态的图像,代码如下:
%% 系统状态方程
A = [1 2; 3 4];
B = [5; 6];
%% 求解可控性矩阵
C = ctrb(A, B);
%% 求解滑膜面参数
lambda = 1;
P = C'*C;
Q = lambda * eye(size(A));
%% 求解状态反馈增益
K = place(A, B, [-1, -2]);
%% 绘制系统状态图像
t = 0:0.1:10;
x0 = [1; 1];
[t, x] = ode45(@(t, x) (A - B*K)*x - B*P*x'*P*x - B*Q, t, x0);
plot(t, x(:,1), 'r', t, x(:,2), 'b');
xlabel('Time');
ylabel('State');
legend('x_1', 'x_2');
阅读全文
相关推荐


















