nass-simscape/Control/cl_tf.m
2018-06-16 22:57:54 +02:00

24 lines
452 B
Matlab

%%
clear; close all; clc;
%% Load Plant
load('./mat/G_xg_to_d.mat', 'G_xg_to_d');
load('./mat/G_f_to_d.mat', 'G_f_to_d');
load('./mat/controller.mat', 'K');
%%
S = minreal(inv(tf(eye(6))+G_f_to_d*K));
T = minreal((tf(eye(6))+G_f_to_d*K)\G_f_to_d*K);
bodeFig({S(1,1), T(1,1)})
legend({'$S_x$', '$T_x$'})
bodeFig({S(2,2), T(2,2)})
legend({'$S_y$', '$T_y$'})
bodeFig({S(3,3), T(3,3)})
legend({'$S_z$', '$T_z$'})
%%
save('./mat/T_S.mat', 'S', 'T');