To cancel the controllable poles and zeros of the control system and eliminate unnecessary states, the minreal() function can be used for this processing.
% System minimal realization
% minreal()
% ss2tf()
%%%%%%%%%%%
clear all;
clc;
close all;
%%%%%%%%%%%%%
%%%% Example 1
A1=[-3.9 -1.303 0 0
1.304 0 0 0
1.0 2.608 -11.22 -5.503
0 0 5.503 0];
B1=[1; 0; 0; 0];
C1=[1.0 2.6 -1.2 -1.0];
D1=0;
[A2,B2,C2,D2]=minreal(A1,B1,C1,D1,1.0e-5);
disp(‘ Original system transfer function: A1=’)
disp(A1)
disp(‘ New system transfer function: A2=’)
disp(A2)
%%%% Example 2
num1=[1.0 10.2 33.47 35.19];
den1=[1.0 12.1 48.781 75.586 35.035];
[num2,den2]=minreal(num1,den1,1.0e-3);
disp(‘ Original system transfer function: G1=’)
printsys(num1,den1);
disp(‘ New system transfer function: G2=’)
printsys(num2,den2);
%%%%%%%%
disp(‘ End.’);