find open loop transfer function from feedback system in matlab

To find the open loop transfer function of a feedback system in MATLAB, the first step is to create the transfer function of the feedback system using the “feedback” command. This command takes two input arguments: the transfer function of the forward path and the transfer function of the feedback path.

main.m
% Define transfer function of forward path
num = [1];
den = [1 2];
G = tf(num, den);

% Define transfer function of feedback path
H = tf([1], [1]);

% Create transfer function of feedback system
G_feedback = feedback(G, H);

%Find the open loop transfer function
G_open_loop = G * H;
284 chars
14 lines

In the code above, the transfer function of the forward path is defined as a first-order system with a numerator of 1 and a denominator of [1 2]. The transfer function of the feedback path is defined as a unity gain system (i.e., H(s) = 1).

The “feedback” command is then used to create the transfer function of the feedback system by connecting the forward path and feedback path transfer functions. The resulting transfer function, G_feedback, represents the closed-loop transfer function of the feedback system.

Finally, the open-loop transfer function, G_open_loop, is found by multiplying the transfer functions of the forward path and feedback path, G and H.

gistlibby LogSnag