0% found this document useful (0 votes)
61 views

Ransfer Unction Epresentation: Objectives

The document discusses transfer function representation in Laplace domain using MATLAB. It describes how to represent transfer functions as tf objects in MATLAB and use them to analyze the impulse and step responses of systems. Examples are provided to demonstrate creating transfer function models and obtaining impulse responses using MATLAB commands like tf and impulse.

Uploaded by

Sohaib Sajid
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views

Ransfer Unction Epresentation: Objectives

The document discusses transfer function representation in Laplace domain using MATLAB. It describes how to represent transfer functions as tf objects in MATLAB and use them to analyze the impulse and step responses of systems. Examples are provided to demonstrate creating transfer function models and obtaining impulse responses using MATLAB commands like tf and impulse.

Uploaded by

Sohaib Sajid
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

University of Engineering and Technology, Lahore Fall 2016

TRANSFER FUNCTION REPRESENTATION


Name : Date :
Regd-No :

OBJECTIVES:
 Learning about Transfer Function Representation in Laplace domain.
 Representing Transfer Functions using MATLAB.
 Simulating the response of a system to standard inputs with transfer
function.
SUGGESTED READING:
 Chapter 4: “Transfer Function approach to Modeling Physical Systems”, from book
“System Dynamics”, by Ogata.
 http://www.electrical4u.com/transfer-function/
 https://en.wikibooks.org/wiki/Control_Systems/Transfer_Functions
 ftp://ftp.dca.fee.unicamp.br/pub/docs/vonzuben/ea619_2s12/transfer_function_block_dia
gram.pdf

Please read through all the suggested reading before you come to lab.

SOFTWARE REQUIRED
 MATLAB
---------------------------------------------------------------------------------------------------------------------
Introduction
A control system consists of an output as well as an input signal. The output is
related to the input through a function call transfer function. This function is
represented by a block and the complete diagram of control system using these
blocks which represent transfer function and arrows which represent various
signals, is collectively known as block diagram of a control system. For any
control system there exists a reference input termed as excitation or cause which
operates through a transfer operation termed as transfer function and produces an
effect resulting in controlled output or response. Thus the cause and effect
relationship between the output and input is related to each other through a transfer
function.

MCT-304: Modeling and Simulation 1


Department of Mechatronics and Control Engineering, U.E.T Lahore
University of Engineering and Technology, Lahore Fall 2016
In Laplace Transform, if the input is represented by X(s) and output is represented
by Y(s), then the transfer function (G(s)) will be given as:

Y ( s)
G ( s )= ⇒ X ( s ) . G ( s ) =Y ( s)
X (s)

That is, transfer function of the system multiplied by input function gives the
output function of the system.
Thus, the transfer function of a control system is defined as the ratio of the
Laplace transform of the output variable to Laplace transform of the input
variable assuming all initial conditions to be zero.

Transfer Function using MATLAB


The Control System Toolbox™ provides functions for creating basic
representations of linear time-invariant (LTI) models. Some of the ways we can
represent our system model in MATLAB are:
 Transfer function (TF) models
 Zero-pole-gain (ZPK) models
 State-space (SS) models

Since transfer functions (TF) are frequency-domain representations of LTI


systems, a SISO (Single Input Single Output) transfer function is a ratio of
polynomials (as shown in the general equation above).
In MATLAB, a polynomial is represented by the vector of its coefficients, for
example, the polynomial s2 +2 s +10 is specified as [1 2 10]

To create a TF object representing the transfer function, we can use the ‘tf’
command from MATLAB.

MCT-304: Modeling and Simulation 2


Department of Mechatronics and Control Engineering, U.E.T Lahore
University of Engineering and Technology, Lahore Fall 2016
sys = tf(num,den)
Where num and den represent the numerator and the denominator polynomial
respectively.

To look at more variants of the syntax, you can visit the MATLAB help

Example 1:
Create the MATLAB representation of the following transfer function:
s
G ( s )= 2
s + 2 s+10
Solution:
1. specify the numerator and denominator polynomials and use tf to construct
the TF object:

num = [ 1 0 ]; % Numerator: s
den = [ 1 2 10 ]; % Denominator: s^2 + 2 s + 10
G = tf(num,den)

Result:
G=
s
--------------
s^2 + 2 s + 10
Continuous-time transfer function.

2. Alternatively, we can specify this model as a rational expression of the


Laplace variable s:

s = tf('s'); % Create Laplace variable


G = s / (s^2 + 2*s + 10)
Result:
G=
s
--------------
s^2 + 2 s + 10
Continuous-time transfer function.

MCT-304: Modeling and Simulation 3


Department of Mechatronics and Control Engineering, U.E.T Lahore
University of Engineering and Technology, Lahore Fall 2016

TASK 1:
Create the MATLAB representation of the following function and add/write the
result in the space below:
2 s3 + s2 +8
G s= 2
( )
s + 4 s+5
Solution:
Code:

Output:

MCT-304: Modeling and Simulation 4


Department of Mechatronics and Control Engineering, U.E.T Lahore
University of Engineering and Technology, Lahore Fall 2016

Transient Response Analysis using MATLAB


I most cases we are interested in finding out the response of a system when given
certain standard inputs. In this lab we will focus on checking the response of the
system by giving it some standard time-domain inputs such as:
 Impulse input
 Step Input

Impulse Response:
The resulting response of the system when the applied input is unit impulse
signal/input is known as the impulse response (assuming initial conditions to be
zero).

The Impulse Function, denoted with δ(t) is a special function defined piece-wise as
follows:

The unit impulse function has zero width,


infinite height and an integral (area) of one.
We plot it as an arrow with the height of the
arrow showing the area of the impulse.

The Laplace Transform of unit impulse function is 1.

1. Since the transfer function is a ratio of the output to the input of the system
in laplace domain, X ( s ) .G ( s )=Y (s);
2. And the laplace of the unit impulse signal is 1;
3. The response of the system to a unit impulse is actually equal to the system
itself (X(s) = 1)
Y ( s )=G ( s )

MCT-304: Modeling and Simulation 5


Department of Mechatronics and Control Engineering, U.E.T Lahore
University of Engineering and Technology, Lahore Fall 2016
The inverse Laplace transform of the output given by yields the impulse response
of the system and is called the impulse response function or the weighing
function of the system.

Impulse Response using MATLAB:


If the transfer function of a system is known, the impulse response can be
calculated by using the ‘impulse’ command.
impulse(sys)
where ‘sys’ is the model of the system. The duration of simulation is determined
automatically to display the transient behavior of the response.

To look at more variants of the syntax, you can visit the MATLAB help

Example 2:
Find the impulse response of the following transfer function:
1
G ( s )= 2
s + 2 s+10
Solution:
1. specify the numerator and denominator polynomials and use tf to construct
the TF object:
2. Use the impulse command to generate the impulse response.

num = [ 1 0 ]; % Numerator: s
den = [ 1 2 10 ]; % Denominator: s^2 + 2 s + 10
G = tf(num,den);
impulse(G); %plot the impulse response

Result:

MCT-304: Modeling and Simulation 6


Department of Mechatronics and Control Engineering, U.E.T Lahore
University of Engineering and Technology, Lahore Fall 2016
TASK 2:
Create the MATLAB representation of the following function, compute the
impulse response and add/write the result in the space below:
1
G ( s )=
s +4
Solution:

Question 2.1: What would be the inverse laplace (impulse-response function) of


the system in TASK2?

Question 2.2: Describe what will happen to the impulse response of system if the
denominator is changed to (s+10) instead of (s+4)?

MCT-304: Modeling and Simulation 7


Department of Mechatronics and Control Engineering, U.E.T Lahore
University of Engineering and Technology, Lahore Fall 2016
Question 2.3: Give a real life example of a system that would follow such
behavior to a unit impulse input.

Step Response:
The step response of the system is it’s response to a unit step input (assuming zero
initial conditions).

From a practical standpoint, knowing how the system responds to a sudden input is
important because large and possibly fast deviations from the long term steady
state may have extreme effects on the component itself and on other portions of the
overall system dependent on this component. In addition, the overall system cannot
act until the component's output settles down to some vicinity of its final state,
delaying the overall system response

Step Response using MATLAB:


If the transfer function of a system is known, the impulse response can be
calculated by using the ‘step’ command.
step(sys)
where ‘sys’ is the model of the system. The computation interval at and the time
span of the response are determined by MATLAB.
If we wish MATLAB to compute the response every at seconds and plot the
response curve for 0 ≤ t ≤T (where T is an integer multiple of ∆ t), we enter the
statement
t=0 :∆ t :T ;
in the program and use the command

step(sys, t) or step(num,den,t)

MCT-304: Modeling and Simulation 8


Department of Mechatronics and Control Engineering, U.E.T Lahore
University of Engineering and Technology, Lahore Fall 2016

If step commands have left-hand arguments, such as

y = step(sys,t) or y = step(num,den,t)
and
[y,t] = step(sys,t) or [y,t] = step(num,den,t)

MATLAB produces the unit-step response of the system, but displays no plot on
the screen. It is necessary to use a plot command to see response curves.

To look at more variants of the syntax, you can visit the MATLAB help

Example 3:
Find the step response of the following transfer function:
1
G ( s )= 2
s + 2 s+10
Solution:
1. specify the numerator and denominator polynomials and use tf to construct
the TF object:
2. Use the step command to generate the impulse response

num = [ 1 0 ]; % Numerator: s
den = [ 1 2 10 ]; % Denominator: s^2 + 2 s + 10
G = tf(num,den);
step(G); %plot the step response

Result: Step Response


0.14

0.12

0.1
Amplitude

0.08

0.06

0.04

0.02

0
0 1 2 3 4 5 6
Time (seconds)

MCT-304: Modeling and Simulation 9


Department of Mechatronics and Control Engineering, U.E.T Lahore
University of Engineering and Technology, Lahore Fall 2016
TASK 3:
Create the MATLAB representation of the following function, compute the step
response and add/write the result in the space below:
1
G ( s )=
s +4
Solution:

Computing Transient Responses of Real Systems


1. Water Tank Filling System

MCT-304: Modeling and Simulation 10


Department of Mechatronics and Control Engineering, U.E.T Lahore
University of Engineering and Technology, Lahore Fall 2016

Consider a water tank and the following parameters used for modeling the system:
 h : the current height of the fluid in the tank (m)
 d : diameter of the tank (m)
 Qin : The input flow rate of fluid in the tank (m3/sec)
 Qout : The output flow rate of the fluid (m3/sec)
 R : The restriction to the flow of fluid at output (or a valve) (N.sec/m5)
 ρ : Density of the fluid (kg/m3)
 g : Acceleration due to gravity (9.8 m/s2)
 A : Base Area of the tank (m2)

The tank above is filled at a flow rate of Q in (m3/sec) which is the input to the
system.  The output is the discharge flowrate, Qout (m3/sec).  If Qin = Qout, the level,
h, remains constant.  If Qin > Qout, the level, h, rises.  If Qin < Qout, the level, h, falls. 

The underlying differential equation that governs the system is given as *:


AR dh R
+h=Q ¿
ρg dt ρg
Or
1

* for details on modeling visit: http://eleceng.dit.ie/gavin/Control/Modeling/Filling%20a%20Tank.htm


AR π d2 R
Where; τ=
ρg
=
4 ρg
and

MCT-304: Modeling and Simulation 11


Department of Mechatronics and Control Engineering, U.E.T Lahore
University of Engineering and Technology, Lahore Fall 2016
R
K=
ρg

TASK 4.1:
Compute the Laplace transform of equation 1 and write it in the transfer
function form (assuming zero initial conditions, i.e the tank is empty).
Also write the order of the system.

TASK 4.2:
Create the MATLAB representation of the above computed transfer function with
the parameters given and write your code below showing the output.
 d = 1m.
 R = 9500 (N.sec/m5)
 ρ = 1000 (kg/m3) (i.e. water)
 g = 9.8 (m/s2)

MCT-304: Modeling and Simulation 12


Department of Mechatronics and Control Engineering, U.E.T Lahore
University of Engineering and Technology, Lahore Fall 2016

TASK 4.3:
Use MATLAB to compute the impulse response and attach it below. Imagine the
impulse response in this case as suddenly dumping a bucket of fluid (not strictly a
bucket) into the tank and observing the change in the fluid height with time.

TASK 4.4:
Use MATLAB to compute the step response and attach it below. Imagine the step
response in this case as steadily letting the fluid in the tank (Qin = constant) and
seeing how the height of the fluid settles.

Question 4.1: What would happen to the time it takes to reach the
required height if the diameter of the tank is doubled?

MCT-304: Modeling and Simulation 13


Department of Mechatronics and Control Engineering, U.E.T Lahore
University of Engineering and Technology, Lahore Fall 2016

MCT-304: Modeling and Simulation 14


Department of Mechatronics and Control Engineering, U.E.T Lahore

You might also like