Dynamic Systems Course Notes
Dynamic Systems Course Notes
Dynamic Systems Course Notes
Dynamic Systems
Steven Dumble, PhD
1 Differential Equations
A differential equation is an equation that relates one or more functions together and
their derivatives. Many of the processes that occur in the world can be expressed as
differential equations, generally in representation of physical quantities, the deviates
represent the rate of change of that quantity and the differential equation describes
the relationship between the two. These processes occur in nature, physics, biology,
economics, engineering and many other areas. Issac Newton invented calculus and used
it to described classical mechanics to express the relationship between position, velocity
and acceleration as a differential equation with respect to time. For example, if x is the
position of a particle, then its velocity v is how quickly the position is changing with
time:
dx
v = ẋ =
dt
The same thing can be said about velocity and acceleration a:
dv
a = v̇ =
dt
These differential equations are commonly called the equation of motion.
Ordinary Differential Equations are an equation which contains only a single variable
and its derivations. Most problems encountered in physics are ODE, for example the
equations of motion are all a function of derivative(s) of a single variable: position.
dx
v=
dt
d2 x
a=
dt2
1
Here the t time is the independent variable and x, v, a are the dependant variables as
they depend on t. These are the types of differential equations we will focus on for data
fusion and state estimation, as we usually want to track how the variable evolve over
time (with time being the independent variable).
Partial Differential Equations are equations which contains multiple variables and their
derivations. An example is the Laplace Equation:
∂u ∂u
+ =0
∂x2 ∂y 2
which is used in many areas of physics, such as heat and fluid dynamics.
2
2 Dynamic Systems
A system is a collection of interrelated entities that can be considered as a whole. If the
different properties or attributes of that system change with time, then it is considered
a dynamic system. The process is how the system evolves over time.
The differential equations that make up the system are the state equations of the dy-
namic system. The state variables of the system are the dependant variables of the state
equations.
ẋ1 = f1 (t, x1 , x2 , · · · , xn , u1 , u2 , · · · , um )
ẋ2 = f2 (t, x1 , x2 , · · · , xn , u1 , u2 , · · · , um )
ẋ3 = f3 (t, x1 , x2 , · · · , xn , u1 , u2 , · · · , um )
..
.
ẋn = fn (t, x1 , x2 , · · · , xn , u1 , u2 , · · · , um )
There are m states, so there are m state equations, each equation is a function of time
t, and the m number of states xi and the n number of inputs uj .
This can compactly be written in vector form as:
where:
x(t) = [x1 (t), x2 (t), · · · , xn (t)]T
u(t) = [u1 (t), u2 (t), · · · , um (t)]T
Many of the processes that occur in the world can be expressed as linear or non-linear
differential equations. We can describe these processes in state-space form which then
allow us to use different mathematical tools to extract useful information and perform
various analysis on the system. If the know the state of the system for the current time
and all the current and future inputs to that system, then we can predict the values of
the future states and outputs of that system and a lot more.
3
are differential equations. To obtain the state of the system for some time in the future,
the differential equations have to be integrated to find the state.
Z t
x(t) = f (t, x(t), u(t)) dt
0
Discrete time systems break the continuous time t into a number of small steps of time
∆t where the current time is expressed as a integer k multiplication of the timestep
such that t = k∆t. So the time, state, and input are all represented at distict steps in
time such that tk , xk and uk are the time, state and input respectively for time step k.
Discrete time dynamic systems do not calculate the derivate ẋ(t) rather they calculate
the new state for the next time step k + 1 in the future such that:
xk+1 = f (tk , xk , uk )
The integration step is not needed as in continuous-time systems, however the discrete
model can only be calculated for discrete chucks of time while the continuous-time system
can be calculated for any time.
4 Mathematical Models
The state space representation of dynamic systems can be expressed in continuous time
or discrete time. Each time representation many consist of linear or non-linear models
that may or may not be time varying.
4
ẋ1 (t) a11 (t) a12 (t) ... a1n (t) x1 (t)
ẋ2 (t) a21 (t) a22 (t) ... a2n (t) x2 (t)
=
.. .. .. .. .. ..
. . . . . .
ẋn (t) an1 (t) an2 (t) ... ann (t) xn (t)
b11 (t) b12 (t) ... b1r (t) u1 (t)
b21 (t) b22 (t) ... b2r (t) u2 (t)
+
.. .. .. .. ..
. . . . .
bn1 (t) bn2 (t) . . . bnr (t) ur (t)
x1 f11 f12 ... f1n x1
x2 f21 f22 ... f2n x2
=
.. .. .. .. .. ..
. . . . . .
xn k+1
fn1 fn2 . . . fnn k
xn k
g11 g12 . . . g1r u1
g21 g22 . . . g2r u2
+ .
.. .. .. ..
..
. . . .
gn1 gn2 . . . gnr k
ur k
5
• Discrete Time (calculates next time step state xk+1 )
Continuous Discrete
Time invariant
General ẋ(t) = f (x(t), u(t)) xk = f (xk−1 , uk−1 )
Linear ẋ(t) = Ax(t) + Bu(t) xk = Fxk−1 + Guk−1
Time varying
General ẋ(t) = f (t, x(t), u(t)) xk = f (k, xk−1 , uk−1 )
Linear ẋ(t) = A(t)x(t) + B(t)u(t) xk = Fk−1 xk−1 + Gk−1 uk−1
where t0 is the initial time of the system, which is usually just set to be zero. The
first term matrix exponential in the above equation is commonly referred to as the
state-transition matrix, as it is the matrix that describes how the state changes from an
initial condition to a new condition at the end of the time period without any control
involvement.
To convert the above system into a discrete form, we want to substitute the discrete
time relationship tk = tk−1 + ∆t into the continuous-time solution, so t0 = tk−1 is the
previous time step and t = tk is the current time step with ∆t = tk − tk−1 so that:
Z tk
x(tk ) = eA(tk −tk−1 ) x(tk−1 ) + eA(tk −τ ) Bu(τ )dτ (3)
tk−1
6
If we assume that the control input u(t) is held constant over the time period ∆T and
let α = τ − tk−1 then:
Z ∆t
A∆t
x(tk ) = e x(tk−1 ) +eA(∆t−α) dα Bu(tk−1 ) (4)
0
Z ∆t
=e A∆t
x(tk−1 ) + eA∆t
e−Aα dα Bu(tk−1 ) (5)
0
= Fx(tk−1 ) + Gu(tk−1 ) (6)
F = eA∆t (7)
Z ∆t
G=F e−Aα dα B (8)
0
= F I − e−A∆t A−1 B if A−1 exists
(9)
The matrix exponential term eAt can be computed or approximated a number of different
ways. One useful definition is:
∞
At
X (At)j
e = (10)
j!
j=0
(At)2 (At)3
eAt = (At)0 + (At)1 + + + ... (11)
2! 3!
A simple approximation that may be applied is to ignore the higher order terms, such
that:
eAt ≈ I + At (12)
This approximation may or may not be appropriate depending on the system matrix A,
if the higher order terms are significant then a different method would be needed to be
taken.
7
continuous response of the system by assuming the derivatives can be held constant over
a small interval in time, such that:
The state x is stepped forward in small chucks of time ∆t, this process is carried out
until time t reaches the end time of the simulation. The steps of the integration process
can be summarized as:
The characteristics of Euler First Order Integration that should be noted are:
• Least Accurate
• Can be numerically unstable (Solution accuracy get exponentially worse with time)