Sei sulla pagina 1di 178

Linear Time-Invariant

(LTI) Systems
Introduction
The unit impulse function
The unit impulse function AKA Dirac delta function is given as:

Very large, t=0 (t )


(t) =
0, otherwise

t
2 1 0 1 2 3

The value at t = 0 is very large, and(t)=0for t not equal 0


The duration is very short.
The area is one.

The unit impulse function is a mathematical model to represent signals that are
highly localized in time.

LTI Systems 2
Systems, Networks, and Circuits
Network theory is mainly concerned with network topology (interconnections of
component)
System theory is mainly concerned with input - output relationship.
Electrical system is divided to:
Linear system described by set of linear equations.
nonlinear system described by set of nonlinear
equations.
AndTime-invariant
into:
time-varying
system
AndPassive
into:
system
Active system
Also Lumped system
Distributed system
And

LTI Systems 3
Mathematical model
To aid analyzing and designing systems, mathematical models are formulated.
A mathematical model describes the behavior of physical system or device in
terms of a set of mathematical equations, with schematic diagram of the device
connection and the symbols of its component and numerical values.
Several models for continuous systems and techniques for system design and
analysis by analytical methods are proposed.
A system or transform maps one signal that is called input signal x(t) into another
signal which is called the output signal or response y(t) :
y t)=T x(t)}

System block diagram: (the operator)

Dr. Ray Kwok LTI Systems 4


Properties and characteristics of continuous systems

Properties and characteristics of continuous systems:


Linearity
Homogeneity
Additivity
Time-invariance
Causality
stability

x t)= input y t)= output


(excitation) r(esponse)

LTI Systems 5
Linear system
A system is linear if and only if it satisfies the principle of homogeneity and the
principle of additvity.
The principle of homogeneity.
If an input x1(t) applied to a linear system produces the output y 1(t), when a
scaled input signal by constant C is applied to the linear system, x 2 (t)= C1 x ( t)
the output y 2(t=) C y1 (t)1results.

LINEAR
x1 t) y
SYSTEM
t)1

LINEAR
Cx t)1
SYSTEM Cy1 t)

LTI Systems 6
Linear system

The principle of additivity.


If an input x1(t) applied to a linear system produces the output y1(t), and x2 (t)
produces y2(t) , when a new input x1(t) + x2(t) is applied to the linear system, the
output y1(t) + y2(t) results.

1 x t) 1 y t)

2 x t) 2 y t)

1 x t) +x t) 2 1 y t) +y t)2

LTI Systems 7
Linear system
The principle of superposition.
If an input x1(t) applied to a linear system produces the output y1(t), and x2 (t)
produces y2(t) , when a new input Ax1(t) +B x2(t) is applied to the linear system,
the output Ay1(t) + By2(t) results.

x 1t) y1 t)

x 2t) y2 t)

Ax t)1 + Bx 2t) Ay t)1 + By 2t)

Dr. Ray Kwok LTI Systems 8


Time invariance
If an input x1(t) applied to a system produces the output y1(t), when a time-
shifted version of input x2(t) = x1(t - to) is applied to the linear system, the
output y2(t) = y1(t - to) results for arbitrary x1(t) and to and for all t , then the
system is said to be a time invariant system.
Loosely speaking, the system parameter do not change with time.
The same input applied at different times will produce outputs that are identical
in shape and size but shifted in time

x1 t) y
t)1

x t)=x(tt)
2 1 0 y t)=y(tt)
2 1 0

LTI Systems 9
Causality

A causal system is a non-anticipative system in that the output does not precede,
or anticipate, the input.
i.e. The systems output depends only on the past and current input, but not on
the future inputs.
All nature, physics operate under this principal - called causality (cause and
effect).
The impulse response of a causal system must be 0 for all t < 0. [ i.e. the
impulse input is (t) ].

LTI Systems 10
Stability

System stability can be defined from several points of view.


The bounded input bounded output (BIBO) criterion
A system is bounded-input bounded-output (BIBO) stable if for any bounded input
defined by x
X k1
The corresponding output y is also bounded defined by y k
2

where k2 and k2 are finite real numbers.

LTI Systems 12
System invertibility and inverse systems

A system is said to be invertible if distinct inputs lead to distinct output. An inverse


system is a system that when is cascaded with duplicate of itself yields an output
equal to the input of cascaded system

x t) y t) x t)

LTI Systems 13
Thevenins Theorem

A linear two-terminal circuit can be replaced by an equivalent circuit consisting of


a voltage source in series with a resistor where V th is the open-circuit voltage at
the terminals and is the input or equivalent resistance at the terminals when the
independent sources are turned off.
Nortons Theorem
A linear two-terminal circuit can be replaced by an equivalent circuit consisting of
a current source in parallel with a resistor, where Is is the short-circuit current
through the terminals and R is the input or equivalent resistance at the terminals
when the independent sources are turned off.

V Th

LTI Systems 14
Operation for linear systems
Operation for linear systems
Continuous systems
Laplace transform, (s)
Convolution integral (time)
Correlation integral, (time)
Fourier series and transform
DFT approximation
Convolution (frequency, f )
Correlation (frequency, f)
Discrete systems
z- transform,
Convolution sum (time)
Correlation sum, (time)
Discrete time Fourier transform (DTFT) implemented by FFT
Discrete Fourier transform (DFT) implemented by Fast Fourier transform (FFT)
Convolution (frequency, )
Correlation (frequency, )

LTI Systems 15
Models for continuous and discrete systems
Models for contiguous and discrete systems
Continuous systems
Differential equation, DEs
Transfer function, H(s)
Frequency response, H(j)
State differential equations
Unit impulse response, h(t)
Signal flowgraph or block
diagram
Difference
Discrete equation, DEs
systems
Transfer function, H(z)
j
Frequency response, H(e )
State difference equations
Unit sample response, h[n]
Signal flowgraph or block diagram

LTI Systems 16
Linear differential equation
The output y(t) and input x(t) of a LTIC system are related by a linear
differential equation with constant-coefficient of the form
d ny t) d y t)
n1
dx d
m
x
an n +an1 n1+L+ ay=b
0 0 x( t)+b
1 (t)+L+b m dtm
dx dx dt
The right hand side terms are often lumped together and called forcing function
m
as: dx d x
f (t) =b x (t)b+
dt(t)n1
+L+b m m
0 1
dt
with initial condition y(0 ),L, y (0)
The complete response is of the form y (t)=y h0 (t)+yf0 (t)
where y h0(t) the homogenous response is the solution to the differential
equation with ( t) = 0 and contain n arbitrary constant.
and y f 0 (t) the forced response is that one particular solution to the differential
equation that contains no part of the y h0(t)
n1
The n arbitrary constant may be found by applying the values of y(0),L, y (0)
to it.

LTI Systems 17
Linear differential equation
The homogenous response y h0 (t) also called natural response, free response,
And
or the transient response
complementary is y f
response. 0 (t)

The terms forced, particular integral, final and steady state are used
interchangeably.
A more concise representation using the finite summation
k=n
ky (t) k=m kX( t)
ak = bk

k=0 t
k tk
k=0

Note: the notation is restricted to the practical situation where the number of the
derivatives of the output is greater than or equal to the number of input derivative,
that is nm
The order of a differential equation is the order the highest derivative of the output
function that appears in the equation.

LTI Systems 18
Linear differential equation
The homogenous response y t)h0 also called natural response, free response,
or complementary response.
And the transient response is y t)f0
The terms forced, particular integral, final and steady state are used
interchangeably.
A more concise representation using the finite summation
k=n
ky t) k=m kx t)
ak = bk

k=0 t
k tk
k=0

Note: the notation is restricted to the practical situation where the number of the
derivatives of the output is greater than or equal to the number of input derivative,
that is nm
The order of a differential equation is the order the highest derivative of the output
function that appears in the equation.

LTI Systems 18
The characteristic equation
The characteristic equation (CE) of the system is found by substituting a trial
st
solution y t)= Ce into the homogenous differential equation. k=n
k
y t)
ak

k=0 t
k =0

Obtained by setting to zero terms involving the input and its derivative, with the
result: 0 st 1 st n st
a0s (Ce )+a1s (Ce )+L+ans (Ce )=0
y t)=0
Since
Cestcan not be zero (this corresponds to the trivial solution
it can be factored out. The remaining terms must satisfy the algebraic
0 1 n
equation as0 +a1s+L+as n =0

This result is known as the characteristic equation and can also be written as
k=n
a sk = 0

k=0 k

LTI Systems 19
The characteristic equation
k=n
The n roots of the equation
aksk =0

k=0

s1 =r,1 s2 =r2 L s n =rn

are called characteristic roots. The characteristic equation can be written in factored
form: k=n
k
as =a(sr)(sr)L(sr)=0
k=0
k n 1 2 n

where r,r
1 2
,L,r n , may be real or complex. If the DE has real coefficient, complex
roots must appear in conjugate pair. The solution of the homogenous DE
k=n
ky t)
=0

k=0
a k
t k

for the given set of initial condition

n1 n1
y t) ,y t)/ t , y t)/t
t =0 t=0 t =0

LTI Systems 20
The characteristic equation
The solution of the homogenous DE k=n
k

ask =0
k=0

For the given set of initial condition


n1 n1
y t) , y t)/t , y t)/t t=0
t=0 t=0
is called the initial condition (IC) solution and for simple (non-repeating) roots is of
the form r 1t r2t rn t
y ICt)=C 1 e +Ce
2 +L+Cen
n
or in compact form rtk
=IC C ek
y t) k=1

where theC
k k are coefficient that must be determined in order
to satisfy the given for condition and rk for k =1,2,Ln, are the
set of initial
=1,2,Ln
characteristic roots.

LTI Systems 21
The CE with multiple roots

If the CE contain multiple roots indicated by the factor


(ssk )q terms of the
form q1 stk q2 stk stk
Ct1 e +Ct2 e +L+Ceq

will appear in the initial condition

LTI Systems 22
Linear differential equation
Example:
Given the first order differential equation dy
+py = q pandq
=C
Suggested solution dx
y= y h0 +y f0
Substituting to original differential equation
d(yh0 +y f 0 )+ p(y +y =q
h0 f0 )
dx
To find the homogenous solution, set forced function to zero:
dy h0+py = 0
h0
dx
The yh0 t) is

y h0=Ae px

LTI Systems 23
Distortionless transmission
What are the conditions for distortionless transmission?
By distortionless transmission, we mean that output signal of system is an exact
replica of the input signal except for two minor modifications.
1 - A possible scaling of amplitude
2 - A constant time delay
A signal x(t) is transmitted through a system without distortion if the output signal
is defined by y(t)

x t) y t)

y t)=kx (tt 0 )

LTI Systems 24
Distortionless transmission
Here the constant k accounts for a change in amplitude and
t0 constant
accounts for a delay in transmission: t0
Y(j)=k X( j)e j
The frequency response of a distortionless system is:
Y(j) j t
H(j)= =ke
0

X(j)
Correspondingly, the impulse response of the system is

h t)= k(tt o )

LTI Systems 25
Condition for CT LTI distortionless transmission

Conditions for distortionless transmission of CT LTI system


with transfer function H(j ) is

1) The magnitude response H(j) must be constant for all frequencies of interest.
H(j) =k

2) For the same frequencies of interest H( j) is linear in frequency with


slope t0 and intercept of zero.
H( j) =- t
0
where t accounts
0
for a delay in transmission through the system.

LTI Systems 26
Condition for CT LTI distortionless transmission

For DT LTI system with transfer function


j
1 The magnitude response H(e ) is constant
for all frequencies of interest
H(e j
) =k

2 For the same frequencies of interest, the phase


j
response H(e ) is linear in frequency
j
H(e )=n0
where n 0 accounts for an integer delay in transmission
through the system.

LTI Systems 27
Frequency Response

Frequency response for distortionless transmission through a linear time-invariant


system
H ( j)
K

argH ( j)

Slope = -t 0

a) Magnitude response
b) Phase response

LTI Systems 28
Lumpedness and causality
Definition: a system is lumped if it can be
described by a state vector of finite
dimension. Otherwise it is called distributed.
Lavi Shpigelman, Dynamic Systems and control 76929

Examples:
distributed system: y(t)=u(t- t)
lumped system (mass and spring with friction)

Definition: a system is causal if its current


state is not a function of future events (all
real physical systems are causal)
29
Lavi Shpigelman, Dynamic Systems and control 76929

30
Lavi Shpigelman, Dynamic Systems and control 76929

31
Lavi Shpigelman, Dynamic Systems and control 76929

32
Lavi Shpigelman, Dynamic Systems and control 76929

33
Lavi Shpigelman, Dynamic Systems and control 76929

34
The main conclusion of this work is twofold. First, it is
mandatory that any dataset be certified to be self-
consistent, causal, and passive before proceeding to
further modeling steps.
Lavi Shpigelman, Dynamic Systems and control 76929

Second, any macromodeling algorithm must preserve


such properties in order to avoid flawed simulation
results.

Conclude this paper by pointing the reader to a set of


significant references on both data checking and
consistent model extraction techniques.

35
Linearity and Impulse Response
description of linear systems
Definition: a function f(x) is linear if

(this is known as the superposition property)


Lavi Shpigelman, Dynamic Systems and control 76929

Impulse response:
Suppose we have a SISO (Single Input Single Output) system
system as follows:

where:
y(t) is the systems response (i.e. the observed output) to the
control signal, u(t) .
The system is linear in x(t) (the systems state) and in u(t)

36
Linearity and Impulse Response
description of linear systems
Define the systems impulse response, g(t,), to be the
response, y(t) of the system at time t, to a delta function
control signal at time (i.e. u(t)=t) given that the system
state at time is zero (i.e. x()=0 )
Lavi Shpigelman, Dynamic Systems and control 76929

Then the system response to any u(t) can be found by


solving:

Thus, the impulse response contains all the information


on the linear system

37
Time Invariance
A system is said to be time invariant if its response to an
initial state x(t0) and a control signal u is independent of
the value of t0.
Lavi Shpigelman, Dynamic Systems and control 76929

So g(t,) can be simply described as g(t)=g(t,)


A linear time invariant system is said to be causal if

A system is said to be relaxed at time 0 if x(0) =0


A linear, causal, time invariant (SISO) system that is
relaxed at time 0 can be described by
causal

relaxed Time invariant Convolution 38


LTI - State-Space Description
Fact: (instead of using the impulse response representation..)
Every (lumped, noise free) linear, time invariant
(LTI) system can be described by a set of
Lavi Shpigelman, Dynamic Systems and control 76929

equations of the form:


Linear, 1st order ODEs
Linear algebraic equations
Dynamic Observation
Process Process
Controllable u
inputs u D
Observations
B x + y
+ 1/s C
A

State x
Disturbance Measurement
(noise) w Error (noise) n 39
Plant
What About
nth Order Linear ODEs?
Can be transformed into n 1st order ODEs
Lavi Shpigelman, Dynamic Systems and control 76929

1. Define new variable:

2. Then:

Dx/dt = A x + B u
y = [I 0 0 0] x 40
Using Laplace Transform to
Solve ODEs
The Laplace transform is a very useful tool in the
solution of linear ODEs (i.e. LTI systems).
Definition: the Laplace transform of f(t)
Lavi Shpigelman, Dynamic Systems and control 76929

It exists for any function that can be bounded by


aet (and s>a ) and it is unique
The inverse exists as well
Laplace transform pairs are known for many
useful functions (in the form of tables and Matlab
functions)
Will be useful in solving differential equations!
41
Some Laplace Transform
Properties
Linearity (superposition):

Differentiation
Lavi Shpigelman, Dynamic Systems and control 76929

42
Remember integration by parts:
Lavi Shpigelman, Dynamic Systems and control 76929

Using that and the transform definition:

43
Some Laplace Transform
Properties
Linearity (superposition):

Differentiation
Lavi Shpigelman, Dynamic Systems and control 76929

Convolution

44
Using definitions
Lavi Shpigelman, Dynamic Systems and control 76929

Integration over triangle 0 < < t

Define t, thend= dt and region is t

45
Some Laplace Transform
Properties
Linearity (superposition):

Differentiation
Lavi Shpigelman, Dynamic Systems and control 76929

Convolution

Integration

46
By definition:
Lavi Shpigelman, Dynamic Systems and control 76929

Switch integration order

Plug = t-

47
Some specific Laplace
Transforms (good to know)
Constant (or unit step)
Lavi Shpigelman, Dynamic Systems and control 76929

Impulse

Exponential

Time scaling

48
Homogenous (aka Autonomous / no input)
1st order linear ODE
Solve:
Lavi Shpigelman, Dynamic Systems and control 76929

Do the Laplace transform

Do simple algebra

Take inverse transform


Known as zero
input response 49
1st order linear ODE
with input (non-homogenous)
Solve:
Do the Laplace transform
Lavi Shpigelman, Dynamic Systems and control 76929

Do simple algebra

Take inverse transform

Known as the zero state response


50
Example: a 2nd order system
Solve:
Do the Laplace transform
Lavi Shpigelman, Dynamic Systems and control 76929

Do simple algebra

Take inverse transform

51
Using Laplace Transform to
Analyze a 2nd Order system
Consider the autonomous (homogenous) 2nd order system
Lavi Shpigelman, Dynamic Systems and control 76929

To find y(t), take the Laplace transform


(to get an algebraic equation in s)

Do some algebra

characteristic polynomial
Find y(t) by taking determined by Initial condition
the inverse transform

52
2nd Order system -
Inverse Laplace
Solution of inverse transform depends on nature of the
roots 1,2 of the characteristic polynomial p(s)=as2+bs+c:
real & distinct, b2>4ac
Lavi Shpigelman, Dynamic Systems and control 76929

real & equal, b2=4ac


complex conjugates b2<4ac

In shock absorber example:


a=m, b=damping coeff., c=spring coeff.
We will see:
Re{} exponential effect
Im{} Oscillatory effect

53
Real & Distinct roots (b2>4ac)
Some algebra helps fit the polynomial to Laplace
tables.
Lavi Shpigelman, Dynamic Systems and control 76929

Use linearity, and a table entry


To conclude:
p(s)=s2+3s+1
y(0)=1,y(0)=0
1=-2.62
2=-0.38

Sign{} growth or decay


|| rate of growth/decay y(t)=-0.17e-2.62t+1.17e-0.38t
54
Real & Equal roots (b2=4ac)
Some algebra helps fit the polynomial to Laplace
tables.
Lavi Shpigelman, Dynamic Systems and control 76929

Use linearity, and a some table entries to


conclude:
p(s)=s2+2s+1
y(0)=1,y(0)=0
1=-1

Sign{} growth or decay


|| rate of growth/decay y(t)=-e-t+te-t
55
Complex conjugate roots (b2<4ac)
Some algebra helps fit the polynomial to Laplace
tables.
Lavi Shpigelman, Dynamic Systems and control 76929

Use table entries (as before) to conclude:

Reformulate y(t) in terms of and

Where:
56
Complex conjugate roots (b2<4ac)
E.g. p(s)=s2+0.35s+1 and initial condition y(0)=1 , y(0)=0
Roots are =+i=-0.175i0.9846
Solution has form:
Lavi Shpigelman, Dynamic Systems and control 76929

with constants
A=||=1.0157
r=0.5-i0.0889
=arctan(Im(r)/Re(r))
=-0.17591
Solution is an
exponentially
decaying oscillation
Decay governed by
oscillation by

57
The Roots of a Response

Im(s) Marginally
Stable

Stable
Dynamic Systems and control 76929

Unstable

Re(s)

58
Linear Control Systems
Modeling Theory of Linear Systems
Why is modeling / modeling theory required? Because
modeling may be quite useful:

To measure the width of a river without actually crossing it


, Dynamic Systems and control 76929

To gauge the mass of the Earth, not using any balance

To find the temperature at the surface or at the center of


the sun

To estimate the yield of wheat in India from the standing


crop
59
Modeling Theory of Linear Systems ..

To quantify the amount of blood inside a living human


body

To predict the population of China for the year 2050

To determine the time required by a satellite to complete


Dynamic Systems and control 76929

one orbit around the earth, say at the height of about


10,000 km above the ground

To assess the impact of 30% reduction in income tax over


the national economy

60
Modeling Theory of Linear Systems ..

To ascertain the optimally effi cient gun whose


performance depends on 10 parameters, each of which
can take 10 different values, without actually
manufacturing 1010 guns

To determine the mean time between failures (MTBF) or


Dynamic Systems and control 76929

average life span of an electric bulb

To forecast the total amount of insurance claims a


company has to pay next year

61
What is modeling?

Modeling is a process of abstraction of a real system.

A model portrays a conceptual framework to describe a


system and can be viewed as an abstraction (essence) of
an actual system or a physical replica of a system or a
situation.
Dynamic Systems and control 76929

It is a factual representation of reality.

The word model is derived from Latin and its meaning is


mould or pattern (physical model).
The abstracted model may be logical or mathematical.

62
Modeling..

A mathematical model is a mathematical description of


properties and interactions in the system.
Lavi Shpigelman, Dynamic Systems and control 76929

The development of a mathematical model depends on the


system boundary, system components, and their
interactions.

During model development, it is necessary


to optimize two things:
1. Simplicity of the model
2. Accuracy of the model or faithfulness of
model

63
Modeling.. Black Box Model
Lavi Shpigelman, Dynamic Systems and control 76929

An often used approach for black-box models are artificial neural


networks (ANNs), which usually do not need anything except the
input and output data sets.

ANN models are good for complex systems, especially when input
output patterns known to us are in quantitative form. If the input and
output information are not in quantitative form, but in qualitative or
fuzzy form, then ANN cannot be used.

For such situations fuzzy models are good. 64


Need of System Modeling

Models are used to mimic the behavior of systems under


different operating conditions.
Lavi Shpigelman, Dynamic Systems and control 76929

Due to following reasons Modeling is not possible


on Real Systems

1. Too expensive: Example-physical experimentation of


a complex system like the satellite system

2. Risky: Example- training a person for operating the


nuclear plant in a dangerous situation

65
Need of System Modeling..

Modeling is an essential requirement in certain


situations, such as the following:
Lavi Shpigelman, Dynamic Systems and control 76929

1. Abstract specifications of the essential features of a system:


2. Modeling forces us to think clearly before making a physical model:
3. To guide the thought process:
4. It is a tool that improves the understanding about a system, and allows us to
demonstrate and interact with what we design, and not just describe it.
5. To improve system performance: Models will help in changing the system
structure to improve its performance.
6. To explore the multiple solutions economically: It also allows us to find many
alternate solutions for the improvement in system performance.
7. To create virtual environments for training purpose or entertainment purposes

66
Modeling Methods for Complex Systems

1. Less complex systemsMathematical modeling techniques.


2. Medium complex systemsANN modeling technique.
3. Highly complex systemsFuzzy systems modeling technique
Dynamic Systems and control 76929

67
Dynamic Systems and control 76929

Classification of Models

68
Physical vs. Abstract Model

Physical Model
Wind tunnels, cockpits disconnected from their airplanes to
be used in pilot training, or miniature supertankers scurrying
Lavi Shpigelman, Dynamic Systems and control 76929

about in a swimming pool.

These are examples of physical models (also called iconic


models), and are not typical of the kinds of models that are of
interest in operations research and system analysis.

Physical models are most easily understood.

They are usually physical replicas, often on a reduced scale.


Dynamic physical models are used as in wind tunnels to
show the aerodynamic characteristics of proposed aircraft
69
Abstract Model
An abstract model is one in which symbols, rather than
Lavi Shpigelman, Dynamic Systems and control 76929

physical devices, constitute the model.


The abstract model is more common but less recognized.
The symbolism used can be a written language or a
thought process.

70
Dynamic Systems and control 76929

Characteristics of Models

71
Modeling
Modeling is the art/process of developing a system model.
The purpose of modeling a system is to expose its internal
working and to present it in a form useful to science and
engineering studies.
Lavi Shpigelman, Dynamic Systems and control 76929

In other words, modeling means the process of organizing


knowledge about a given system.

72
Lavi Shpigelman, Dynamic Systems and control 76929

Modeling

73
Modeling

Consider an aircraft shown in Figure which could be modeled as


1. A particle
2. A system of rigid bodies
Lavi Shpigelman, Dynamic Systems and control 76929

3. A system of deformable bodies

74
Fundamental Axiom (Modeling Hypothesis)

Mathematical model of a component characterizes its behavior as


an independent entity of a system, and how it is interconnected
with the other components to form a system.

It implies that the various components can be removed either


literally or conceptually from the remaining components and can be
studied in isolation to establish a model of their characteristics.
Dynamic Systems and control 76929

This is a tool of science which makes the system theory universal.

Analysts can go as far as they wish in breaking down the system in


search of building blocks that are sufficiently simple to model and
which identify a structure upon which alteration can be made.

75
Component Postulate (First Postulate)

The pertinent performance (behavior) characteristics of each n terminal


component in an identified system structure can be specified completely by
a set of (n 1) equations in (n 1) pairs of oriented complementary
variables (i.e., across variables xi(t) and through variables yi(t)) identified by
n arbitrarily chosen terminal graph as shown in Figure
Dynamic Systems and control 76929

76
Lavi Shpigelman, Dynamic Systems and control 76929

77
Generic Description of Two-Terminal
Components

The fundamental two-terminal components may be


classified as
Lavi Shpigelman, Dynamic Systems and control 76929

A-type elements: dissipater or algebraic components

B-type elements: delay type components

C-type elements: accumulator or capacitive type


components

D-type elements: drivers or sources as shown in


Table 78
Lavi Shpigelman, Dynamic Systems and control 76929

79
Mathematical Modeling of Physical Linear
Systems Using MATLAB

Example 1
Consider a tank of volume V which is full of a solution of a material A at
concentration C. A solution of the same material at concentration C0 is flowing into
Lavi Shpigelman, Dynamic Systems and control 76929

the tank at flow rate F0 and a solution is flowing out the top of the tank at flow rate
F1 as shown in Figure.
Determine the dynamic response to a step change in the inlet concentration C0.
Hydraulic system.

Assumptions:
Well mixed solution
Density of solution is constant
Level is constant in the tank

80
Example 1.

2. Data:
F0 = 0.085 m3/min, V = 2.1 m3
Cinit = 0.925 kg/m3 t < = 0
C0 = 1.85 kg/m3 t > 0
Lavi Shpigelman, Dynamic Systems and control 76929

The system is initially at steady state i.e.,


C(t) = C0(t) = Cinit for t < = 0

To formulate the model the following fundamental principles are used:


Conservation laws
Component terminal equation

Conservation laws are the laws for conservation of material, energy,


momentum, and electrons,
which have the general form
Rate of accumulation = (rate)in (rate)out

81
Example 1.

Component terminal equations relate quantities of different kinds, e.g., Hookes


law for a spring:

F = kx relates the spring force F to the springs displacement x,


where k is the spring constant.
Lavi Shpigelman, Dynamic Systems and control 76929

Similarly, Ohms law for a resistor V = Ri, where V is the voltage drop, i is the
current, and R is the resistance.

Note these are only approximate relations.

For a real spring or resistor the relation holds well for a certain range only;
outside this range the relation is nonlinear.
Important variables/constants
Input variables: C0, F0
State Variables: C, F1
Constants: V,
Initial value Cint
Rate equation for the fl ow of fl uid is
82
Dynamic Systems and control 76929

Example 1.

83
MATLAB program

% Computer program for simulating hydraulic system


% Initialization
clear all;
F=0.085; % cubic m/min
V=2.1; % cubic m
C0=1.85; % kg/cubic m
C=0.925; % kg/cubic m
t=0;
dt=0.01;
Dynamic Systems and control 76929

for n=1:10000
X1(n,:)=[C t];
dC=F*(C0C)/V;
C=C+dt*dC;
t=t+dt;
end
Dynamic response of tank system.
plot(X1(:,2),X1(:,1) )
xlabel(Time (sec.))
ylabel(C) 84
Modeling of Mechanical Systems

Translational Mechanical Systems

The basic building blocks of translational mechanical systems are


mass, spring, and dashpot.
The input to a translational mechanical system may be a force F
and the output the displacement y.
Dynamic Systems and control 76929

85
Translational Mechanical Systems.
Dynamic Systems and control 76929

86
Translational Mechanical Systems simulation using SIMULINK

SIMULINK
Powerful graphical user interface (GUI), Simulink of Matlab.

This software is used for solving the modeling equations and obtaining the
response of a system to different inputs. Both linear and nonlinear differential
equations can be solved numerically with high precision and speed, allowing
system responses to be calculated and displayed for many input functions.
Dynamic Systems and control 76929

Simulink provides access to an extensive set of blocks that accomplish a wide


range of functions useful for the simulation and analysis of dynamic systems.
The blocks are grouped into libraries, by general classes of functions.

Mathematical functions such as summers and gains are in the Math library.
Integrators are in the Continuous library.
Constants, common input functions, and clock can all be found in the Sources
library.
Scope, To Workspace blocks can be found in the Sinks library.

87
GENERAL INSTRUCTIONS FOR WRITING A SIMULINK PROGRAM
To create a simulation in Simulink, follow the steps:
Start MATLAB.
Start Simulink
Open the libraries that contain the blocks you will need. These usually will
include the Sources, Sinks, Math and Continuous libraries, and possibly
others.
Open a new Simulink window.
Dynamic Systems and control 76929

Drag the needed blocks from their library folders to that window. The Math
library, for example, contains the Gain and Sum blocks.
Arrange these blocks in an orderly way corresponding to the equations to
be solved.
Interconnect the blocks by dragging the cursor from the output of one
block to the input of another block. Interconnecting branches can be made by
right-clicking on an existing branch.

88
Example 2 Mass-Spring System Model-Translational
System-Using SIMULINK

Consider the Mass-Spring system used in the previous exercise as shown in


the figure. Where Fs(x) is the spring force, Ff( ) is the friction coefficient, x(t) is
the displacement and Fa(t) is the applied force:
Dynamic Systems and control 76929

89
Example 2 ..
Dynamic Systems and control 76929

Objective :Modeling of a second order system

90
Steps:
Draw the free body diagram.
Write the modeling equation from the free body diagram
Solve the equations for the highest derivative of the output.
Draw a block diagram to represent this equation.
Draw the corresponding Simulink diagram.
Use Step block to provide the input fa(t).
In the Step block, set the initial and final values and the time at which
Dynamic Systems and control 76929

the step occurs.


Use the To Workspace blocks for t, fa(t), x, and v in order to allow
MATLAB to plot the desired responses. Set the save format to array in
block parameters.
Select the duration of the simulation to be 10 seconds from the
Simulation > Parameters entry on the toolbar

91
Given below is a file that will set up the MATLAB workspace by
establishing the values of the parameters needed for the Simulink
simulation of the given model.
Dynamic Systems and control 76929

92
Lavi Shpigelman, Dynamic Systems and control 76929

Simulink block diagram

93
Dynamic Systems and control 76929

94
Dynamic Systems and control 76929

95
Plotting the outputs in MATLAB:
The file to create the plots of the output is given below.
Create the file and save it by the name given below.
Dynamic Systems and control 76929

96
Dynamic Systems and control 76929

97
Example3 - Simulation with system parameter
variation

Steps:
Perform the following steps. Use the same input force as in Exercise 1.
Begin the simulation with B = 4 N-s/m, but with the input applied at t = 0
Dynamic Systems and control 76929

Plot the result.


Rerun it with B = 8 N.s/m.
Hold the first plot active, by the command hold on
Reissue the plot command plot(t,x), the second plot will superimpose on the
first.
Repeat for B = 12 N-s/m and for B = 25 N-s/m
Release the plot by the command hold off
Show your result.

98
Running SIMULINK from MATLAB command prompt

If a complex plot is desired, in which several runs are


needed with different parameters, this can using the
command called sim.
sim command will run the Simulink model file from the
Matlab command prompt.
Dynamic Systems and control 76929

For multiple runs with several plot it can be accomplished


by executing ex1_model (to load parameters) followed by
given M-file.
Entering the command ex1_plots in the command window
results in multiple runs with varying values if B and will plot
the results.

99
Dynamic Systems and control 76929

100
Example 4 state model for the mechanical system

Determine the state model for the mechanical system shown in Figure The state
variable vector for the given mechanical system may be displacements and
velocities
Dynamic Systems and control 76929

101
Example 4 state model for the mechanical system
Dynamic Systems and control 76929

102
Example 4 MATLAB CODE

% Simulation program for state space


model
clear all
t=0; % Initial time
Lavi Shpigelman, Dynamic Systems and control 76929

dt=0.01; % step size


tsim=10.0; % Simulation time
n=round( (tsim-t)/dt); % number of
iterations
%system parameters
k1=5;
k2=7;
m1=2;
m2=3;
d1=40;
d2=30;
A=[0 1 0 0; -k1/m1 -d1/m1 k1/m1 d1/m1; 0
0 0 1; k1/m2 d1/m2 -(k1+k2)/m2 end

103
Example 4 MATLAB CODE

-(d1+d2)/m2];
B=[0; 1/m1; 0; 0];
% C=[0 1];
% D=[0 0];
X=[0 0 0 0]';
Lavi Shpigelman, Dynamic Systems and control 76929

u=5;
for i=1:n;
dx=A*X+B*u;
X=X+dx*dt;
X1(i,:)=[t,X'];
t=t+dt;
subplot(2,2,1)
plot(X1(:,1),X1(:,2),'b.')
axis([0 10 0 2])
xlabel('time')
ylabel('X1')
title('Response of state variable X1')
subplot(2,2,2)
plot(X1(:,1),X1(:,3),'r.')
104
Example 4 MATLAB CODE

axis([0 10 0 1])
xlabel('time')
ylabel('X2')
title('Response of state variable X2')
Lavi Shpigelman, Dynamic Systems and control 76929

subplot(2,2,3)
plot(X1(:,1),X1(:,4),'c.')
axis([0 10 0 2])
xlabel('time')
ylabel('X3')
title('Response of state variable X3')
subplot(2,2,4)
plot(X1(:,1),X1(:,5),'g.')
axis([0 10 0 1])
xlabel('time')
ylabel('X4')
title('Response of state variable X4')

105
Dynamic Systems and control 76929

Results

106
Example 5: Modeling of Train System

Will consider a toy train consisting of an engine and a car as


shown in Figure.

Assuming that the train travels only in one direction, we want


to apply control to the train so that it has a smooth start-up
and stop, and a constant-speed ride.
Dynamic Systems and control 76929

The mass of the engine and the car will be represented by M1


and M2, respectively.

The two are held together by a spring, which has the stiffness
coefficient of k.

F represents the force applied by the engine, and the Greek


107
Lavi Shpigelman, Dynamic Systems and control 76929

108
Free body diagram and Newtons law

Where B1 = M1g and B2 = M2 g

From Newtons law, we know that the sum of the forces acting on a mass equals
mass times its acceleration as shown in Figure.

In this case, the forces acting on M1 are the spring, the friction, and the force
applied by the engine. The forces acting on M2 are the spring and the friction.
, Dynamic Systems and control 76929

In the vertical direction, the gravitational force is canceled by the normal force
applied by the ground, so that there will be no acceleration in the vertical
direction.

The equations of motion in the horizontal direction are the following:

Systems Modeling

109
Example5State-variable and output equations

This set of system equations can now be manipulated into state-variable form.
Knowing state variables are

X1 and X2 and

Input is F,

State-variable equations will look like the following:


Dynamic Systems and control 76929

110
Let the output of the system be the velocity of the engine. Then the output
equation will become
y = V1
1. Transfer function

.To find the transfer function of the system, first, we take


the Laplace transforms of the above state-variable and
Dynamic Systems and control 76929

output equations.

111
2. State space
Another method to solve the problem is to use the state-space form. Four
matrices A, B, C, and D characterize the system behavior, and will be used
to solve the problem.
, Dynamic Systems and control 76929

The state space form manipulated from the state-variable and output
equations is shown below.

112
Matlab Code of Train Model

clc
k=35; m1=1800; m2=1000;
u=0.05; g=9.81; F=100;
A=[0 1 0 0; -k/m1 -u*g -k/m1 0; 0 0 0 1;
k/m2 0 -k/m2 -u*g];
B=[0 1/m1 0 0]';
C=[0 0 1 0];
D=[0];
X=[0 0 0 0]';
Dynamic Systems and control 76929

t=0;
tsim=3;
dt=0.02;
n=round( (tsim-t)/dt);
for i=1:n
X1(i,:)=[t X'];
dvdx=A*X+B*F;
X=X+dt*dvdx ;
t=t+dt;
end 113
Matlab Code of Train Model..

plot(X1(:,1),X1(:,2:5) )
xlabel('x(m)');ylabel('state variables')
[num,den]=ss2tf(A,B,C,D)
sys=tf(num,den)
Dynamic Systems and control 76929

114
Dynamic Systems and control 76929

115
Mechanical coupler

Consider a mechanical coupler normally used for coupling of two railway coaches as
shown in Figure 1. The equivalent system of railway coupling is shown in Figure 2.,
which consists of two masses, a spring, a dashpot, and forces applied to each mass.
Derive an expression for the mathematical model of the system.

.
Dynamic Systems and control 76929

116
Fig.2.Equivalent diagram of
mechanical coupler.
Dynamic Systems and control 76929

Fig.3. Free body diagram for mass


m1.

Fig4.Free body diagram for mass


m2.

117
Draw the free body diagram for mass m1 as shown in Figure 2.

Applying Newtons second law to the mass m1 write down the force

draw the free body diagram for m2 as shown in Figure 3, and its equation
Dynamic Systems and control 76929

to the mass m2,

118
Lavi Shpigelman, Dynamic Systems and control 76929

To get the state-space model for the given system:

119
Matlab Code of Mechanical Coupler

% Simulation program for the state model


given in Equation 2.34
% Initialization
clear all;
F1=1;
F2=-1;
M1=1; %kg
M2=1.5; %kg
B=0.1; %
K=0.2;
Dynamic Systems and control 76929

Coef_1=[B/M1 -B/M1
-B/M2 B/M2];
Coef_2=[K/M1 -K/M1
-K/M2 K/M2];
Y=[0.1; 0.1];
dY=[0; 0];
dt=0.1; % step size
t=0; % Initial time
tsim=200; % Simulation time
n=round(tsim-t)/dt; 120
Matlab Code of Mechanical Coupler..

for i=1:n
X1(i,:)=[Y' dY' t];
ddY=[F1/M1;F2/M2] - Coef_1*dY -
Coef_2*Y;
dY=dY+dt*ddY;
Y=Y+dt*dY;
t=t+dt
end
figure(1)
Dynamic Systems and control 76929

plot(X1(:,5),X1(:,1:2))
xlabel('Time (sec.)')
ylabel('Displacements')
figure(2)
plot(X1(:,5),X1(:,3:4))
xlabel('Time (sec.)')
ylabel('Velocities')

121
Dynamic Systems and control 76929

Results of Mechanical Coupler

122
Rotational Mechanical Systems

The basic building blocks of rotational mechanical systems are the moment of
inertia, the torsion spring (or rotational spring), and the rotary damper (Figure).

The input to a rotational mechanical system may be the torque T and the output
the rotational displacement, or angle.

Torsional spring

A rotational spring is similar to a translational spring, but here the spring is


Dynamic Systems and control 76929

twisted.

The relationship between the applied torque T and the angle rotated by the
spring is given by

T = k
where is known as the rotational stiffness constant. In our modeling we are
assuming that the mass of the spring is negligible and the spring is linear.

123
The energy stored in a torsional spring when twisted by an angle is given by
Lavi Shpigelman, Dynamic Systems and control 76929

A rotary damper element creates damping as it rotates. For example, when a


disk rotates in a fluid we get a rotary damping effect.

The relationship between the applied torque T and the angular velocity of the
rotary damper is given by

124
In our modeling the mass of the rotary damper will be neglected, or will be
assumed to be negligible.

A rotary damper does not store energy.

Moment of inertia refers to a rotating body with a mass. When a torque is applied
to a body with a moment of inertia we get an angular acceleration, and this
acceleration rotates the body.
Dynamic Systems and control 76929

The relationship between the applied torque T, angular acceleration a, and the
moment of inertia I, is given by

125
The energy stored in a mass rotating with an angular velocity can be
written as

Example
A disk of moment of inertia I is rotated (refer Figure) with an applied torque of T.
The disk is fixed at one end through an elastic shaft. Assuming that the shaft can
be modeled with a rotational dashpot and a rotational spring, derive an equation for
Dynamic Systems and control 76929

the mathematical model of this system.

Rotational mechanical system.


126
The damper torque and the spring torque oppose the applied torque. If is
the angular displacement from the equilibrium, we can write the torque
balancing equation for the given system:
Lavi Shpigelman, Dynamic Systems and control 76929

127
Lavi Shpigelman, Dynamic Systems and control 76929

128
MATLAB codes

% Simulation program for the state model


given in Equation 2.52
% Initialization
clear all;
T=0.25;
Lavi Shpigelman, Dynamic Systems and control 76929

I=0.5;
b=0.5;
k=0.1;
A =[-b/I -k/I
1 0];
B=[1/I
0];
X =[0; 0.1;];
dt=0.1; % step size
t=0; % Initial time
tsim=200; % Simulation time
n=round(tsim-t)/dt;
for i=1:n
X1(i,:)=[X' t];
dX=A*X+B*T; 129
MATLAB codes

t=t+dt;
end
subplot(2,1,1) % Divides the graphics
Lavi Shpigelman, Dynamic Systems and control 76929

window into sub windows


plot(X1(:,3),X1(:,1) )
xlabel('Time (sec.)')
ylabel('Angle')
subplot(2,1,2) % Divides the graphics
window into sub windows
plot(X1(:,3),X1(:,2) )
xlabel('Time (sec.)')
ylabel('Angular velocity')

130
Dynamic Systems and control 76929

Results - MATLAB codes

131
Rotational Mechanical Systems with Gear Train

Gear-train systems are very important in many mechanical engineering


systems.

Figure 1 shows a simple gear train, consisting of two gears, each connected to
two masses with moments of inertia I1 and I2.

Suppose that gear 1 has n1 teeth and radius r1, and that gear 2 has n2 teeth
and radius r2.
, Dynamic Systems and control 76929

Assume that the gears have no backlash, they are rigid bodies, and the
moment of inertia of the gears is negligible.

The rotational displacement of the two gears depends on their radii and is
given by

132
A two-gear train system

where 1 and 2 are


the rotational
displacements of gear
Dynamic Systems and control 76929

1 and gear 2,
respectively.

The ratio of the teeth


numbers is equal to
the ratio of the radii
and is given by

where n is the gear teeth ratio.


133
A two-gear train system.

Let a torque T be applied to the system, then torque equation may be written
as
Dynamic Systems and control 76929

134
Lavi Shpigelman, Dynamic Systems and control 76929

A two-gear train system.

135
A two-gear train system.

It is clear from Equation T that the moment of inertia of


the load I2 is reflected to the other side of the gear train
as n2I2.
Lavi Shpigelman, Dynamic Systems and control 76929

136
Example

Objective: Figure shows a rotational mechanical system coupled with a gear


train. Derive an expression for the model of the system.

Assuming that a torque T is applied to the system,


then the system equation may be written as
, Dynamic Systems and control 76929

Mechanical system
with gear train.

137
Dynamic Systems and control 76929

138
Lavi Shpigelman, Dynamic Systems and control 76929

139
Example-Safety bumper at the end of the racing track.

A safety bumper is placed at the end of a racetrack to stop out-of-control cars as


shown in Figure. The bumper is designed in such a way that the force applied is a
function of the velocity v and the displacement x of the front edge of the bumper
according to the equation
F = Kv ^3(x + 1)^3 where K = 35 s-kg/m5 is a constant.
Lavi Shpigelman, Dynamic Systems and control 76929

Objective:
A car with a mass m of 1800 kg hits the bumper at a speed of
60 km/h. Determine and plot the velocity of the car as a
function of its position for 0 x 3 m.

Safety bumper at the end of the racing


track.
140
The declaration of the car once it hits the bumper can be
calculated from Newtons second law of motion.

Which can be solved for the acceleration a as a function of v and x:


Dynamic Systems and control 76929

The velocity as a function of x can be calculated by substituting the


acceleration in the equation

141
The ordinary differential equation may be solved for the interval 0 x 3
with the initial condition:
v = 60 km/h at x = 0.
Lavi Shpigelman, Dynamic Systems and control 76929

Main Program:

global k m % To share any where in the program or function commonly


has to use global keyword
k=35; m=1800; v0=60;
xspan = [0:0.2:3];
v0mps =v0*1000/3600;
[x v] =ode45('bumper',xspan,v0mps)
plot(x,v)
xlabel('x(m)');ylabel('velocity(m/s)')

142
Bumper Function:

function dvdx=bumper(x,v)
global k m
dvdx=-(k*v^2*(x+1)^3)/m;
Dynamic Systems and control 76929

143
Example-3-D Projectile Trajectory

A projectile is fi red with a velocity of 300 m/s at an angle of 65 relative to the


ground.
The projectile is aimed directly north.
Because of the strong wind blowing to the west, the projectile also moves in this
Lavi Shpigelman, Dynamic Systems and control 76929

direction at a constant speed of 35 m/s.


Determine and plot the trajectory of the projectile until it hits the ground. Also
simulate the projectile when there is no wind.
Solution:
The coordinate system is set up such that the x and y axes point to the east
and north directions, respectively.

Then, the motion of the projectile can be analyzed by considering the


vertical direction z and the two horizontal components x and y.

Since the projectile is fi red directly north, the initial velocity v0 can be
resolved into a horizontal y component and a vertical z component:

144
In addition, due to the wind the projectile has a constant velocity in the
negative x direction, vx = 30 m/s.

The initial position of the projectile (x0, y0, z0) is at point (3000, 0, 0). In the
vertical direction the velocity and position of the projectile are given by
Dynamic Systems and control 76929

145
MATLAB CODE
v0=250; g=9.81; theta=65;
x0=3000;vx=-30;
v0z=v0*sin(theta*pi/180);
v0y=v0*cos(theta*pi/180);
t=2*v0z/g;
tplot=linspace(0,t,100);
z=v0z*tplot-0.5*g*tplot.^2;
Dynamic Systems and control 76929

y=v0y*tplot;
x=x0+vx*tplot;
xnowind(1:length(y) )=x0
plot3(x,y,z,'k-',xnowind,y,z,'k--')
grid on
axis([0 6000 0 6000 0 2500])
xlabel('x(m)'); ylabel('y(m)'); zlabel('z(m)')

146
Lavi Shpigelman, Dynamic Systems and control 76929

147
Lavi Shpigelman, Dynamic Systems and control 76929

148
Lavi Shpigelman, Dynamic Systems and control 76929

149
Modeling of Electrical Systems

Example : Determining the Size of a Capacitor


An electrical capacitor has an unknown
capacitance.
Lavi Shpigelman, Dynamic Systems and control 76929

In order to determine its capacitance it is


connected to the circuit shown in Figure
at the right hand side.
The switch is first connected to B and
the capacitor is charged.
Then, the switch is switched to A and the
capacitor discharges through the
resistor.
As the capacitor is discharging, the voltage across the capacitor is
measured for 10 s in intervals of 1 s.
The recorded measurements are given in the table below.
Plot the voltage as a function of time and determine the capacitance of the
capacitor by fitting an exponential curve to the data point.
150
SOLUTION
When a capacitor discharges through a resistor, the voltage of the capacitor as
a function of time is given by
, Dynamic Systems and control 76929

where
V0 is the initial voltage
R the resistance of the resistor
C the capacitance of the capacitor
The exponential function can be written as a linear equation for In(V) and t in the
form

151
Lavi Shpigelman, Dynamic Systems and control 76929

This equation which has the form y = mx + b can be fitted to the data points by
using the polyfit(x, y, 1) function with t as the independent variable x and In(V) as
the dependent variable y.

The coefficients m and b determined by the polyfi t function are then used to
determine C and V0 by

p = polyfit(x,y,n) finds
the coefficients of a polynomial p(x) of degree n that fits the data, p(x(i)) to y(i),
in a least squares sense.
The result p is a row vector of length n+1 containing the polynomial coefficients
in descending powers:
152
MATLAB CODE

R = 2000;
t = 1:10;
v = [9.4 7.31 5.15 3.55 2.81 2.04 1.26 0.97
0.74 0.58];
Lavi Shpigelman, Dynamic Systems and control 76929

p = polyfit(t,log(v),1);
C = -1/(R*p(1) )
V0 = exp(p(2) )
tplot = 0:0.1:10;
vplot = V0*exp(-tplot./(R*C) );
plot(t,v,'o',tplot,vplot)

153
Example-Flight of Model Rocket

The flight of a model rocket can be developed as follows. During the first 0.15
s the rocket is propelled up by the rocket engine with a force of 16 N.
The rocket then flies up while slowing down under the force of gravity. After it
reaches its peak, the rocket starts to fall back.
Lavi Shpigelman, Dynamic Systems and control 76929

When its down velocity reaches 20 m/s a parachute opens (assumed to open
instantly) and the rocket continues to move down at a constant speed of 20
m/s until it hits the ground.
Write a program that calculates and plots the speed and altitude of the rocket
as a function of time during the flight.

SOLUTION
The rocket is assumed to be a particle that moves along a straight line in
the vertical plane.
For motion with constant acceleration along a straight line, the velocity and
position as a function of time are given by

154
where v and s are the initial velocity and position, respectively. In the computer
program the flight of the rocket is divided into three segments.
Each segment is calculated in a while loop. In every pass the time increases by
Lavi Shpigelman, Dynamic Systems and control 76929

an increment.

Segment 1: The fi rst 0.15 s when the rocket engine is on. During this period,
the rocket moves up with a constant acceleration.
The acceleration is determined by drawing a free body and a mass acceleration
diagrams. From Newtons second law, the sum of the forces in the vertical
direction is equal to the mass times the acceleration (equilibrium equation):

155
where the initial velocity and the initial position are both zero. In the computer
program this segment starts when t = 0, and the looping continues as long as t
< 0.15 s.
The time, velocity, and height at the end of this segment are t1, v1, and h1.
Lavi Shpigelman, Dynamic Systems and control 76929

Segment 2: The motion from when the engine stops until the parachute opens. In
this segment the rocket moves with a constant deceleration g. The speed and
height of the rocket as a function of time are given by

In this segment the looping continues until the velocity of the rocket is 20 m/s
(negative since the rocket moves down). The time and height at the end of this
segment are t2 and h2.
Segment 3: The motion from when the parachute opens until the rocket hits the
ground. In this segment the rocket moves with constant velocity (zero
acceleration). The height as a function of time is given by

is the constant velocity after the parachute opens. In this segment the looping
156
MATLAB CODE

m=0.05; g=9.81; tEngine=0.15; Force=16; vChute=-20;


Dt=0.01;
clear t v h
n=1;
t(n)=0; v(n)=0; h(n)=0;
% Segment 1
Lavi Shpigelman, Dynamic Systems and control 76929

a1=(Force-m*g)/m;
while t(n)<tEngine &n< 50000
n=n+1;
t(n)=t(n-1)+Dt;
v(n)=a1*t(n);
h(n)=0.5*a1*t(n)^2;
end
v1=v(n); h1=h(n); t1=t(n);
% Segment 2
while v(n)>=vChute &n<50000
n=n+1;
t(n)=t(n-1)+Dt;
v(n)=v1-g*(t(n)-t1);
h(n)=h1+v1*(t(n)-t1)-0.5*g*(t(n)-t1)^2;
end 157
v2=v(n); h2=h(n); t2=t(n);
% Segment 3
while h(n)>0 & n<50000
n=n+1;
Lavi Shpigelman, Dynamic Systems and control 76929

t(n)=t(n-1)+Dt;
v(n)=vChute;
h(n)=h2+vChute*(t(n)-t2);
end
subplot(1,2,1)
plot(t,h,t2,h2, 'o')
subplot(1,2,2)
plot(t,v,t2,v2, 'o')

Height VS time
Velcoity VS time

158
Modeling of Thermal Systems

Thermal systems are encountered in chemical


processes like heating, cooling, and air
Lavi Shpigelman, Dynamic Systems and control 76929

conditioning systems, power plants, etc.


Thermal systems have two basic components:
thermal resistance and thermal capacitance.
Thermal resistance is similar to the resistance in
electrical circuits. Similarly, thermal capacitance
is similar to the capacitance in electrical circuits.
The across variable, which is measured across
an element, is the temperature, and the through
variable is the heat flow rate. In thermal
systems there is no concept of inductance or 159
where
T1 and T2 are the temperatures
Lavi Shpigelman, Dynamic Systems and control 76929

q is the heat flow rate


Thermal capacitance is a measure of the energy storage in a thermal system.
If q1 is the heat fl owing into a body and q2 is the heat fl owing out then the
difference q2 q1 is stored by the body, and we can write

where
C = mc
m is the mass
c is the specific heat capacity of the body
160
Example

Figure shows a room heated with an electric heater. The inside of the room is at
temperature Tr and the walls are assumed to be at temperature Tw. If the outside
temperature is To, develop a model of the system to show the relationship
between the supplied heat q and the room temperature Tr.
Lavi Shpigelman, Dynamic Systems and control 76929

The heat flow from inside the room to the walls is given by

where Rr is the thermal resistance of the room.


Similarly, the heat flow from the walls to the outside is given by

where Rw is the thermal resistance of the walls.


Heating equation may be written as
161
Lavi Shpigelman, Dynamic Systems and control 76929

Simple thermal system

162
Lavi Shpigelman, Dynamic Systems and control 76929

163
Lavi Shpigelman, Dynamic Systems and control 76929

164
MATLAB codes
% Simulation program for Thermal System
% Initialization
clear all;
C1=0.5;
C2=1.5;
Lavi Shpigelman, Dynamic Systems and control 76929

Rr=0.5;
Rw=1.8;
Tr=8;
Tw=4;
To=3;
q=5;
A=[1/(C1*Rr) 1/(C1*Rr)
1/(C2*Rr) (1/(C2*Rr) )+(1/(C2*Rw) )];
B=[1/C1 0
0 1/(C2*Rw)];
X=[Tr; Tw;];
dt=0.1; % step size
t=0; % Initial time
tsim=25; % Simulation time
n=round(tsimt)/dt; 165
for i=1:n
X1(i,:)=[X' t];
dX=A*X+B*[q; To];
X=X+dt*dX;
Lavi Shpigelman, Dynamic Systems and control 76929

t=t+dt;
end
Subplot(2,1,1) % Divides the graphics
window into sub windows
plot(X1(:,3),X1(:,1) )
xlabel(Time (sec.))
ylabel(Room Temperature degree C)
Subplot(2,1,2) % Divides the graphics
window into sub windows
plot(X1(:,3),X1(:,2) )
xlabel(Time (sec.))
ylabel(Wall Temperature degree C)

166
Lavi Shpigelman, Dynamic Systems and control 76929

167
PistonCrank Mechanism

It converts, rotary motion into reciprocating motion using a piston, a connecting


rod, and a crank (Figure 2.57).
Calculate and plot the position, velocity, and acceleration of the piston for two
revolutions of the crank. Assume the initial condition zero.
Lavi Shpigelman, Dynamic Systems and control 76929

168
Lavi Shpigelman, Dynamic Systems and control 76929

169
Lavi Shpigelman, Dynamic Systems and control 76929

170
Lavi Shpigelman, Dynamic Systems and control 76929

171
% Matlab codes to simulate the PistonCrank mechanism
clear all
theta_dot=500; % rpm
r=0.12; c=0.25; % m
t_rev=2*pi/ theta_dot % Time for one revolution
Lavi Shpigelman, Dynamic Systems and control 76929

t=linspace(0,t_rev, 200); % time vector


theta=theta_dot*t ; % calculate theta at each time.
h=r*sin(theta);
d2s=c^2-r^2*sin(theta).^2; %calculate d2 square
d2=sqrt(d2s);
x=r*cos(theta)+d2; % calculate x for each theta
x_dot=-r*theta_dot*sin(theta)-(r^2*theta_dot*sin(2*theta)./(2*d2) );
x_dot_dot=-r*theta_dot^2*cos(theta)-
(4*r^2*theta_dot^2*cos(2*theta).*d2s+(r^2*sin(2*theta)*theta_dot).^2)./
(4*d2s.^(3/2) );
subplot(2,2,1)
plot(t,x) % plot Position vs t
xlabel('Time(s)')
ylabel('Position(m)')
subplot(2,2,2) 172
plot(t,x_dot) % plot Velocity vs t
xlabel('Time(s)')
ylabel('Velocity(m/s)')
subplot(2,2,3)
Lavi Shpigelman, Dynamic Systems and control 76929

plot(t,x_dot_dot) % plot Acceleration vs t


xlabel('Time(s)')
ylabel('Acceleration(m/s^2)')
subplot(2,2,4)
plot(t,h) % plot h vs t
xlabel('Time(s)')
ylabel('h(m)')

173
Lavi Shpigelman, Dynamic Systems and control 76929

174
Airplane Deceleration
with Brake Parachute
An airplane uses a brake parachute and other means of braking as it
slows down on the runway after landing as shown in Figure. Its
acceleration is given by a = 0.0045 v2 3 m/s2.
Consider
Lavi Shpigelman, Dynamic Systems and control 76929

an airplane with a velocity of 300 km/h that opens its parachute and starts
deceleration at t = 0 s.
Determine
(a) Velocity as function of time from t = 0 until airplane stops.
(b) Distance that airplane travels as a function of time.
Also write a MATLAB program to plot the distance traveled and the velocity
vs. time for the system shown in Figure

175
% Matlab codes to simulate the airplane
braking using parachute
clear all
v=300; % velocity (km/h)
Lavi Shpigelman, Dynamic Systems and control 76929

tsim=100 % step size


npoint=10000;
dt=tsim/npoint;
acc=0;d=0;
t=0;
for i=1:npoint
x1(i,:)=[acc,v, d, t];
acc=-0.0045*(v*1000/3600)^2-3; %m/s^2
v=v+dt*acc;
d=d+dt*v;
t=t+dt;
if (v<=0); break; end
end
t1=x1(:,4);
176
subplot(2,2,1)
plot(t1,x1(:,3) ) % plot Position vs t
xlabel('Time(s)')
Lavi Shpigelman, Dynamic Systems and control 76929

ylabel('Distance(m)')
subplot(2,2,2)
plot(t1,x1(:,2) ) % plot Velocity vs t
xlabel('Time(s)')
ylabel('Velocity(m/s)')
subplot(2,2,3)
plot(t1,x1(:,1) ) % plot Acceleration vs t
xlabel('Time(s)')
ylabel('Acceleration(m/s^2)')
disp('time required in stopping the
airplane')

177
Lavi Shpigelman, Dynamic Systems and control 76929

178

Potrebbero piacerti anche