MATLAB: Bode State Space


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)

Berikut ini ialah Bode plot diagram.

Lihat juga tentang.
Kendali state space MATLAB.

Untuk penjelasan tentang Bode plot dapat dilihat pada artikel berikut.