Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
(LTI) Systems
Introduction
The unit impulse function
The unit impulse function AKA Dirac delta function is given as:
t
2 1 0 1 2 3
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)}
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
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)
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
LTI Systems 12
System invertibility and inverse systems
x t) y t) x t)
LTI Systems 13
Thevenins Theorem
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
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
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
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
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
1) The magnitude response H(j) must be constant for all frequencies of interest.
H(j) =k
LTI Systems 26
Condition for CT LTI distortionless transmission
LTI Systems 27
Frequency Response
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)
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
35
Linearity and Impulse Response
description of linear systems
Definition: a function f(x) is linear if
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
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
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
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
Differentiation
Lavi Shpigelman, Dynamic Systems and control 76929
42
Remember integration by parts:
Lavi Shpigelman, Dynamic Systems and control 76929
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
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
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 simple algebra
Do simple algebra
Do simple algebra
51
Using Laplace Transform to
Analyze a 2nd Order system
Consider the autonomous (homogenous) 2nd order system
Lavi Shpigelman, Dynamic Systems and control 76929
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
53
Real & Distinct roots (b2>4ac)
Some algebra helps fit the polynomial to Laplace
tables.
Lavi Shpigelman, Dynamic Systems and control 76929
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:
60
Modeling Theory of Linear Systems ..
61
What is modeling?
62
Modeling..
63
Modeling.. Black Box Model
Lavi Shpigelman, Dynamic Systems and control 76929
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.
65
Need of System Modeling..
66
Modeling Methods for Complex Systems
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
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
72
Lavi Shpigelman, Dynamic Systems and control 76929
Modeling
73
Modeling
74
Fundamental Axiom (Modeling Hypothesis)
75
Component Postulate (First Postulate)
76
Lavi Shpigelman, Dynamic Systems and control 76929
77
Generic Description of Two-Terminal
Components
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
81
Example 1.
Similarly, Ohms law for a resistor V = Ri, where V is the voltage drop, i is the
current, and R is the resistance.
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
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
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
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
89
Example 2 ..
Dynamic Systems and control 76929
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
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
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
98
Running SIMULINK from MATLAB command prompt
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
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
The two are held together by a spring, which has the stiffness
coefficient of k.
108
Free body diagram and Newtons law
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.
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,
110
Let the output of the system be the velocity of the engine. Then the output
equation will become
y = V1
1. Transfer function
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
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
118
Lavi Shpigelman, Dynamic Systems and control 76929
119
Matlab Code of Mechanical Coupler
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
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
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
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.
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
127
Lavi Shpigelman, Dynamic Systems and control 76929
128
MATLAB codes
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
130
Dynamic Systems and control 76929
131
Rotational Mechanical Systems with Gear Train
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
1 and gear 2,
respectively.
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
135
A two-gear train system.
136
Example
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.
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.
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:
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
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
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
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
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
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
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
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
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