%% Second-Order Transfer Function from Damping Ratio and Natural Frequency
% For this example, consider a transfer function model that represents a second-order system with known natural frequency and damping ratio.
% The transfer function of a second-order system, expressed in terms of its damping ratio \zeta and natural frequency \omega_0, is:
% sys\left( s \right) = \frac{{\omega _0^2}}{{{s^2} + 2\zeta {\omega _0}s + \omega _0^2}}.
% Assuming a damping ratio, \zeta = 0.25 and natural frequency, \omega_0 = 3 rad/s, create the second order transfer function.

zeta = 0.25;
w0 = 3;
numerator = w0^2;
denominator = [1,2*zeta*w0,w0^2];
sys = tf(numerator,denominator)

%
% Examine the response of this transfer function to a step input.

stepplot(sys)

% The plot shows the ringdown expected of a second-order system with a low damping ratio.
% Copyright 2015 The MathWorks, Inc.