You are on page 1of 36

ITU

System Modeling and


Simulation
KON 214E

Prof. Dr. Hakan Temeltaş


temeltash@itu.edu.tr

KON 214E : System Modeling and Simulation 1


ITU

Course Outline
# Topic
1 Introduction and Laplace Transforms
2 Mathematical Models
3 Mechanical Systems
4 Electrical Systems
5 Electromechanical Systems
6 Fluid Systems
7 Thermal Systems
8 Input-Output Equations: Analytical Solutions
9 Input-Output Equations: Numerical Solutions
KON 214E : System Modeling and Simulation 2 2
ITU

Evaluation Criteria
Method Quantity Percentage(%)
Midterm Exam 2 2x20
Homework 4 10
Certificate 2 10
Pre-Test 1 0
Post-Test 1 5
Final Exam 1 35

KON 214E : System Modeling and Simulation 3 3


ITU

VF Condition
Students who satisfy the following conditions
will be eligible to take the final exam;
• At least 30/100 pts from in-term activities and
• At least three homework report submission

KON 214E : System Modeling and Simulation 4 4


ITU

Text Books (1)

(1)
System Dynamics, K. Ogata, Pearson, 2014
(Fourth Edition)

(2)
Dynamic Modeling and Control of
Engineering Systems, B. T. Kulakowski, J. F.
Gardner, J. L. Shearer, Cambridge University
Press, 2007 (Third Edition)

KON 214E : System Modeling and Simulation 5 5


ITU

Text Books (2)

(3)
Modeling and Simulation of Dynamic
Systems, R. L. Woods, K. L. Lawrence,
Prentice Hall, 1997

(4)
Control Systems Engineering, N. S. Nise,
Wiley, 2019 (Eight Edition)

KON 214E : System Modeling and Simulation 6 6


ITU

Course Requirements
• Certified programs to learn MATLAB/SIMULINK
– MATLAB Onramp
• https://www.mathworks.com/learn/tutorials/matlab-
onramp.html
– SIMULINK Onramp
• https://www.mathworks.com/learn/tutorials/simulink-
onramp.html
MATLAB and Simulink software with ITU Campus Licence to be used in
the course must be known at a basic level. For this, the completely free
MATLAB Onramp and SIMULINK Onramp courses must be completed
and the success status must be shown with a certificate.
KON 214E : System Modeling and Simulation 7 7
ITU

Chapter 1:
Introduction and Laplace
Transforms
System Modeling and Simulation
(KON 214E)

KON 214E : System Modeling and Simulation 8


ITU

Introduction

In this section, basic terms and classifications


related to system dynamics will be included.

System: It is the name given to the combination


of components (variables) that interact together
to achieve a purpose.

KON 214E : System Modeling and Simulation 9 9


ITU

Introduction
All systems interact with the environment they are
in through variables. These variables are divided
into 2 groups:

1) Input Variables: These variables occur outside


the system and are not directly related to the
system.

2) Output Variables: They are the variables


produced by the system during the interaction
of the system with the environment.
KON 214E : System Modeling and Simulation 10 10
ITU

Introduction
If the current outputs in a system are dependent
on the inputs in the previous moments, this
system is called a DYNAMIC SYSTEM.

If the system outputs are dependent only on the


current inputs, this system is called STATIC
SYSTEM.
KON 214E : System Modeling and Simulation 11 11
ITU

Introduction

Mathematical Model :
Mathematical representation of system dynamic
characteristics. Mathematical models of many
physical systems are expressed in Differential
Equations.

KON 214E : System Modeling and Simulation 12 12


ITU

Introduction
System Mathematical Models Classification:

System Model Type Model Equation Type


Linear Linear Differential Equations
Non-linear Non- Linear Differential Equations .
Distributed Partial Differential Equations
Lumped Ordinary Differential Equations .
Time Invariant Constant Coefficient Diff. Eqn.
Time Variable Variable Coefficient Diff. Eqn. .
Continuous Differential equations
Discrete Difference Equations

KON 214E : System Modeling and Simulation 13 13


ITU

Intro – Mathematical Modeling Steps


1) First, the schematic diagram of the system is
drawn and the variables are determined.

2) Using the laws of physics, an equation is written


for each component, and these equations are
combined to obtain a mathematical model.

3) To determine the accuracy of the mathematical


model, these equations are solved and compared
with the experimentally obtained results.
KON 214E : System Modeling and Simulation 14 14
ITU

Laplace Transform

Pierre-Simon Laplace

23 March 1749 – 5 March 1827

French mathematician and


astronomer

KON 214E : System Modeling and Simulation 15 15


ITU

Laplace Transform
Komplex number: 𝑍 = 𝑥 + 𝑗𝑦 𝑗 = −1
real part imaginery part
y
Angle: Z =  = tan
−1
Amplitude: 𝑍 = 𝑥2 + 𝑦2 x

rectangular (cartesian) form Z = x + jy


polar form Z = Z 

x = Z cos  y = Z sin 

KON 214E : System Modeling and Simulation 16 16


ITU

Laplace Transform
Complex conjugate: Z = x + jy → Z = x − jy

Z = x + jy = Z  ( ) = Z  ( cos  + j sin  )
Z = x − jy = Z  ( − ) = Z  ( cos  − j sin  )

KON 214E : System Modeling and Simulation 17 17


ITU

Laplace Transform
j
Euler Theorem: cos + j sin  = e  j Z = Z  e
− j 
cos − j sin  = e  Z = Z  e − j
Complex Variable: If the real and/or imaginary parts of a
complex number are variable, it is called COMPLEX
VARIABLE.
s =  + j

Complex Function: Functions whose arguments are


complex variables are called COMPLEX FUNCTIONS.

F ( s ) = FX + jFY

KON 214E : System Modeling and Simulation 18 18


ITU

Laplace Transform
A typical complex function:

K ( s + z1 )( s + z2 )...( s + zm )
F (s) =
( s + p1 )( s + p2 )...( s + pn )

Values which makes 𝐹 𝑠 zero are called ZERO.


Values which makes 𝐹 𝑠 ∞ are called POLE.

Zeros: 𝑠1 = −𝑧1 , 𝑠2 = −𝑧2 , … , 𝑠𝑚 = −𝑧𝑚


Poles: 𝑠1 = −𝑝1 , 𝑠2 = −𝑝2 , … , 𝑠𝑛 = −𝑝𝑛

KON 214E : System Modeling and Simulation 19 19


ITU

Laplace Transform
Differential equations can be transformed into algebraic
expressions owing to the Laplace transform. (pros)

ℒ 𝑓 𝑡 = 𝐹 𝑠 = න 𝑓(𝑡)𝑒 −𝑠𝑡 𝑑𝑡
0

𝑓 𝑡 ቚ = 0, 𝑡≤0
𝑡=0

𝑠: complex variable ℒ: Laplace transform

KON 214E : System Modeling and Simulation 20 20


ITU

Laplace Transform
Example: ℒ-transform of an exponential function

𝐴𝑒 −𝛼𝑡 𝑡≥0
𝑓 𝑡 =ቊ
0 𝑡<0

KON 214E : System Modeling and Simulation 21 21


ITU

Laplace Transform

 
L A  e − t =  A  e − t  e − s t  dt
0

− ( s + ) t A
= A  e  dt =
0
s +

• Example: ℒ-transform of a step function


A t  0 f(t)
f (t ) = 
0 t  0 A


A
L  f (t ) =  A  e −s t t
 dt =
0
s
KON 214E : System Modeling and Simulation 22 22
ITU

Properties of the Laplace Transform


1. Linearity:

L a  f1 (t ) + b  f 2 (t ) = a  F1 ( s ) + b  F2 ( s )

2. Integral Rule:

 t  F ( s )
L   f ( )  d  =
 0  s

KON 214E : System Modeling and Simulation 23 23


ITU

Properties of the Laplace Transform


3. Derivation Rule:
 d n f (t )  n n −1 
 d k
f (t ) 
L n 
= s  F (s) −  s n − k −1
 k 
 d t  k =0  d t 
t =0

 df (t ) 
Example: L   = s  F ( s ) − s 0
 f (0)
 dt 

4. Shifting in time domain:

L  f (t − a ) = e − as  F ( s )

KON 214E : System Modeling and Simulation 24 24


ITU

Properties of the Laplace Transform


5. Shifting in the s-plane:


L f (t )  e − at
 = F (s + a)
6. Initial value theorem:
+
f (0 ) = lim s  F ( s )
s →

7. Final value theorem:


lim f (t ) = lim s  F ( s)
t → s →0

KON 214E : System Modeling and Simulation 25 25


ITU

Properties of the Laplace Transform


8. Convolution Integral:
 t 
L  f1 (t )  f 2 (t ) = L   f1 (t −  )  f 2 ( )  d 
 =0 
= F1 ( s )  F2 ( s )

x(t) y(t)
g(t)

t
y (t ) =  g (t −  )  x( )  d y (t ) = x(t )  g (t )
 =0

KON 214E : System Modeling and Simulation 26 26


ITU

Inverse Laplace Transform (L-1)


Inverse Laplace Transform;
L

Time Frequency
domain domain
(t) (s)

L −1
c + j
1
−1
F ( s) = F ( s )  e st  ds
2    j c −j
f (t ) = L

c: constant and chosen larger than the real parts of


all singular points (poles) of F(s).
KON 214E : System Modeling and Simulation 27 27
ITU

Inverse Laplace Transform (L-1)


• Selection procedure of c constant:
– It is chosen larger than the real parts of all singular points
(poles) of F(s). jω
– Thus, the integration path
(trajectory) is chosen parallel
s-plane
to the jω axis.

σ
c

Singular
points

KON 214E : System Modeling and Simulation 28 28


ITU

Inverse Laplace Transform (L-1)


Solving inverse Laplace transform (L-1) problem using
partial fraction expansion:
A given expression F(s)
B( s ) K  ( s + z1 )  ( s + z2 ) ( s + zm )
F (s) = =
A( s ) ( s + p1 )  ( s + p2 ) ( s + pn )
an
can be converted into F ( s) = B( s) = a1 + a2 + +
A( s ) s + p1 s + p2 s + pn
 B( s) 
ak = ( s + pk )   k = 1, 2, ,n
 A( s )  s =− pk
and then the L-1-transform of each term can be calculated
to reach f(t) expression.
KON 214E : System Modeling and Simulation 29 29
ITU

Inverse Laplace Transform (L-1)


−1 
ak  − pk t
since L  =
 k a  e ,
 s + pk 
f (t ) = L −1  F ( s ) = a1  e − p1t + a2  e − p2 t + + an  e − pn t

is achieved.
s+3
Example: F (s) =  f (t ) = ?
( s + 1)  ( s + 2)
a1 a
F (s) = + 2  2 −1 
s +1 s + 2 f (t ) = L −1  F ( s ) = L −1  + 
 s +1 s + 2 
 s+3 
a1 = ( s + 1)   =2  2  −1  −1 
 ( s + 1)  ( s + 2)  s =−1 = L −1   + L  
 s + 1 s + 2
 s+3 
a2 = ( s + 2)   = −1 = 2  e −t − e −2t ; t0
 ( s + 1)  ( s + 2)  s =−2

KON 214E : System Modeling and Simulation 30 30


ITU

Inverse Laplace Transform (L-1)


Attention: How to find partial fraction expansion using
MATLAB!
B ( s ) num b1  s n + b2  s n−1 + + bn
= =
A( s ) den a1  s n + a2  s n−1 + + an

num = b1 b2 bn 
den =  a1 a2 an 
 r , p, k  = residue (num, den)
MATLAB command

B( s) r (1) r (2) r ( n)
= k (s) + + + +
A( s ) s − p (1) s − p (2) s − p ( n)

KON 214E : System Modeling and Simulation 31 31


ITU

Inverse Laplace Transform (L-1)


Example: Find the partial fraction expansion of the
following expression using MATLAB.
num = [1 8 16 9 6];
B( s ) s 4 + 8  s 3 + 16  s 2 + 9  s + 6
den = [1 6 11 6]; =
[r,p,k] = residue(num,den) A( s ) s 3 + 6  s 2 + 11  s + 6
r =
-6.0000
-4.0000
3.0000 B( s) −6 −4 3
= s+2+ + +
A( s ) s + 3 s + 2 s +1
p =
-3.0000
-2.0000
-1.0000

k =
1 2
MATLAB commands and outputs
KON 214E : System Modeling and Simulation 32 32
ITU

Solution of Differential Equations


(Linear Time Invariant)
The following 2 steps are executed to solve a
differential equation with L-transform:
1. An algebraic expression in terms of s-parameter is
obtained by taking the L-transform of each term in the
differential equation.
2. The necessary arrangements are done and time
domain solution (f(t)) is obtained by applying L-1
transformation.
KON 214E : System Modeling and Simulation 33 33
ITU

Solution of Differential Equations


(Linear Time Invariant)
• Example: Solve the differential equation given
below and find x(t).
x + 3  x + 2  x = 0 ; x(0) = a x(0) = b
L  x(t ) = X ( s )
L  x(t ) = s  X ( s ) − x(0) = s  X ( s ) − a
L  x(t ) = s 2  X ( s ) − s  x(0) − s 0  x(0) = s 2  X ( s ) − s  a − b

L  x + 3  x + 2 x = L  x + 3  L  x + 2  L  x = L 0

 s 2  X (s) − s  a − b  + 3   s  X (s) − a  + 2  X (s) = 0


 
KON 214E : System Modeling and Simulation 34 34
ITU

Solution of Differential Equations


(Linear Time Invariant)
 s 2  X (s) − s  a − b  + 3   s  X (s) − a  + 2  X (s) = 0
 

X ( s )   s 2 + 3  s + 2  = a  s + b + 3  a
a  s + b + 3 a 2  a + b a + b
X (s) = = −
s + 3 s + 2
2
s +1 s+2

2a + b a + b
x(t ) = L −1  X ( s ) = L −1  − 
 s + 1 s + 2 
Solution of 2a + b −1  a + b 
= L −1   − L  
the diferential  s +1  s+2
equation
x(t ) = ( 2  a + b )  e −t − ( a + b )  e −2t ; t0

KON 214E : System Modeling and Simulation 35 35


ITU

Next class…

• Mathematical Models

have any questions or concerns!

KON 214E : System Modeling and Simulation 36 36

You might also like