Jumat, 22 Juni 2018

Matlab: State Space Transfer Function

Berikut ini ialah script MATLAB untuk merancang transfer function suatu plant dari model state space.



clear all, close all, clc;

%% The transfer function

A = [1 2; 0 3]
% state matrix

B = [1; 2]
% input vector

C = [1 0]
% output vector

D = zeros(size(C,1),size(B,2))
% feedforward

%% Verify observability and controllability

Om = obsv(A,C)

Cm = ctrb(A,B)

if rank(Om) == size(A,1)
    'It is observable'
else
    'It is not observable'
end
 
if rank(Cm) == size(A,1)
    'It is controllable'
else
    'It is not controllable'
end

%% The transfer function

[num,den] = ss2tf(A,B,C,D)

sys = tf(num,den)

eigenValues = eig(A)
% The eigen values are 3 and 1

poles = pole(sys)
% 3 and 1

Lihat juga tentang.
Kendali state space MATLAB.

Sumber http://lang8088.blogspot.com


EmoticonEmoticon