Berikut ini adalah script MATLAB untuk Bode plot diagram state space.
clear all, close all, clc;
%% Define the system
A = [1 0 2;
2 1 3;
4 2 1]
% state matrix
B = [1; 0; 0]
% input vector
C = [1 0 0]
% output
D = zeros(size(C,1),size(B,2))
% feedforward
%% Verify the controllability and observability
Cm = rank(ctrb(A,B))
% controllability matrix
Om = rank(obsv(A,C))
% observability matrix
if Cm == size(A,1)
'It is controllable'
else
'It is not controllable'
end
if Om == size(A,1)
'It is observable'
else
'It is not observable'
end
%% Bode plot diagram
sys = ss(A,B,C,D)
% state space system
margin(sys)
%% Define the system
A = [1 0 2;
2 1 3;
4 2 1]
% state matrix
B = [1; 0; 0]
% input vector
C = [1 0 0]
% output
D = zeros(size(C,1),size(B,2))
% feedforward
%% Verify the controllability and observability
Cm = rank(ctrb(A,B))
% controllability matrix
Om = rank(obsv(A,C))
% observability matrix
if Cm == size(A,1)
'It is controllable'
else
'It is not controllable'
end
if Om == size(A,1)
'It is observable'
else
'It is not observable'
end
%% Bode plot diagram
sys = ss(A,B,C,D)
% state space system
margin(sys)
Berikut ini ialah Bode plot diagram.
Lihat juga tentang.
Kendali state space MATLAB.
- State space controlability and observability.
- State space to transfer function.
- Pole-placement.
- Linear-Quadratic Regulator.
Untuk penjelasan tentang Bode plot dapat dilihat pada artikel berikut.