Docsity

Lecture Notes on System Identification | EML 4930, Study notes of Electrical and Electronics Engineering

Partial preview of the text

Download Lecture Notes on System Identification | EML 4930 and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

Lecture Notes on

System Identification

Dr. Prabir Barooah

August 25, 2008

Disclaimer: This document probably contains typos. For comments on the

content and typos, please contact the author at pbarooahufl.edu

©c Prabir Barooah. Please do not distribute this document without the

author’s consent.

Contents

  • 1 Parameter identification through least squares
    • 1.1 An example
    • 1.2 Least squares solution
      • 1.2.1 Basic least squares:
      • 1.2.2 Geometric interpretation of least squares
    • 1.3 ARX model identification by least squares
  • 2 Mathematical models of physical systems
    • 2.1 ODE models
      • 2.1.1 Numerical integration
      • 2.1.2 Modeling exercise:
      • 2.1.3 Equilibrium point and linearization around it
  • 3 Continuous time SISO LTI systems
    • 3.1 Laplace transform
    • 3.2 Transfer function
      • 3.2.1 Impulse response and transfer function
    • 3.3 Steady state response to sinusoidal inputs
  • 4 Discrete time SISO LTI systems
    • 4.1 Z-transforms
      • 4.1.1 Properties of Z-transform
    • 4.2 Discrete time transfer function
      • 4.2.1 Unit pulse response and transfer function
    • 4.3 Steady-state response to sinusoidal inputs
    • 4.4 Approximating Hc(s) with Hd(z)
      • 4.4.1 Forward difference approximation
      • 4.4.2 Trapezoidal approximation
      • 4.4.3 Properties
    • 4.5 Difference equation from transfer function
    • 4.6 Parametric system identification revisited

4 CHAPTER 1. PARAMETER IDENTIFICATION THROUGH LEAST SQUARES

where ǫi is an unknown measurement noise. As a result, what we can construct from measured data are not y and Φ but their noisy counterparts:

y˜ =

y ˜ 1 y ˜ 2

... y ˜N − 1

˜y 0 u 0 ˜y 1 u 1

...... y ˜N − 1 uN − 1

Because of noise, there may not be a θ that will satisfy

˜y = Φ˜ˆθ.

Instead, it is more likely that for every θˆ we try, there will be a discrepancy between the right hand and left sides of the equation above, which we denote by e:

e := ˜y − Φ˜ˆθ.

In this case, we try to find the so-called least squares solution θˆLS that minimizes the squared error

‖e‖^2 =

∑^ N

i=

The “norm of an n-vector” (˜y − Φθˆ)^2 i = ‖˜y − Φ˜θˆ‖^2 x = [x 1 , x 2 ,... , xn]T^ usu- ally means its 2-norm, which is defined asq ‖x‖ 2 = PN i=1 x (^2) i.

1.2 Least squares solution

1.2.1 Basic least squares:

The problem above can be thought of as finding the best-fit straight line to a set of data points. Suppose two scalar variables x and y are related by a linear equation of the form

y = ax + b (1.2)

Suppose we conduct N experiments and get N pairs of data points (xi, yi), for i = 1, 2 ,... , N. Due to measurement noise etc., it is unlikely that yi = axi + b is exactly satisfied by the i-th data point. Define

ei := (axi + b) − yi (1.3)

as the error between the data yi and the “prediction” ˆaxi + ˆb, for every set of values (ˆa, ˆb) we try. Least squares identification attempts to find values of a and b so that the the sum of squares errors,

i e

2 i , is as small as possible.

Problem 1. Find the values for a and b that minimizes the Sum-of-Squares Error (SSE):

SSE =

∑^ N

i=

(axi + b − yi)^2. 

1.2. LEAST SQUARES SOLUTION 5

Solution to 1. Let us use calculus and solve

∂ ∂a

SSE =

∑^ N

i=

2 xi(axi + b − yi) = 0

∂b

SSE =

∑^ N

i=

2(axi + b − yi) = 0

for the unknown parameters a and b. This amounts to solving a system of two linear equations for a and b: ( (^) N ∑

i=

x^2 i

a +

( N

i=

xi

b =

∑^ N

i=

xiyi ( (^) N ∑

i=

xi

  • N b =

∑^ N

i=

yi

[∑

N i=1 x

2 i

∑N

∑N i=1^ xi i=1 xi^ N

]

R

[

a b

]

[∑

N ∑i=1N^ xiyi i=1 yi

]

From which we compute the least squares solutions of a and b as

aˆLS =

N (

i xiyi)^ −^ (

i xi)(

i yi) N (

i x 2 i )^ −^ (

i xi)^2 ˆbLS = (

i x

2 i )(

i yi)^ −^ (

i xiyi)(

i xi) N (

i x 2 i )^ −^ (

i xi) 2

Caution: The solution for ˆaLS , ˆbLS described above is valid only if the denominator N (

i x 2 i )^ −^ (

i xi) (^2) is not zero. This equivalent to asking det(R) 6 = 0.

The method described above can be extended to the case when there are more than two parameters to be estimated.

Problem 2. Given an n × m matrix A and an n-vector y, find the m-vector ˆxLS so that it minimizes the SSE among all n-vectors x:

SSE := ‖y − Ax‖^2 =

∑^ n

i=

(yi − (Ax)i)^2

where (Ax)i denotes the i-th entry of the vector Ax. 

The vector ˆxLS is called the the solution to the problem Ax = y in the least squares sense, or simply the least squares solution to the problem Ax = y. This might be confusing; remember that the “the solution to the problem Ax = y” means “the vector x so that, given A and y, x satisfies Ax = y”. When no such x exists, we settle for a vector that minimizes the sum of squared error between Ax and y, which is the least squares solution.

Solution to 2. We will solve this problem in a manner similar to Problem 1, by determining

When x is a vector and f (x) is a scalar function of x, the Taylor series expan- sion of f around x is

f (xo + δx) = f (xo) + df dx |xo δx

1 2 δxT^ d^2 f dx^2 |x 0 δx +..

Since each term must be a scalar, the derivative df /dx is a row vector and the second derivative d^2 f /dx^2 is a matrix. The second derivative d^2 f /dx^2 is called a Hessian of f.

the scalars xi that satisfies

∂ ∂ xˆ 1

SSE =

∂ xˆ 2

SSE = · · · =

∂ xˆm

SSE = 0.

This equation can be re-written as

d dx

SSE :=

[

∂ ∂x 1 SSE^

∂ ∂x 2 SSE^

. (^) ∂x∂m SSE

]

1.2. LEAST SQUARES SOLUTION 7

Rm Rn A (n × m matrix)

x =

[ (^) x 1 .. . xm

] Ax^ =

[ (^) y 1 .. . yn

]

Figure 1.1: A m × n matrix A is a linear transformation from Rm^ to Rn.

You can easily verify that the statement above is true for an arbitrary matrix A and vector x, as long as their dimensions are compatible so that the product Ax is well-defined.

mely important er that a matrix transformation. z = x + y, then

  • y) = Ax + Ay. The set of output vectors that a matrix^ A^ is capable of producing, when the input^ x takes all possible values, is called the range space of the matrix A, and is denoted by R(A).

R(A) = {y ∈ Rm|∃x ∈ Rn^ such that y = Ax} (1.10)

It is the set of all vectors that A can produce as “output” when you try all possible input vectors. Now going back to our example (1.7): given the vector y and the matrix A, we want to find a vector x such that “output” Ax for the “input” x is equal to y. To answer the first question of whether such a vector x exists (before we spend time trying to find it), use what you learned about possible outputs of a matrix. Clearly, the given vector y must lie in the range space of the given matrix A for any Ax to equal y. In other words, such an x exists if and only if y is a linear combination of the columns of A. Now let’s check if that is the case:

α

[

]

  • β

[

]

= 5α

[

]

  • 2β

[

]

= (5α + 2β)

[

]

So all linear combinations of the columns of A lie on one vector: [1, 2]T^. Since [3, 7]T^ does not lie along this vector, we now know that there is no solution to (1.7). To summarize: Given A ∈ Rm×n^ and y ∈ Rn, there is a vector x that satisfies Ax = y if and only if y ∈ R(A). When a solution does not exist, we have a situation that is depicted in Figure 1.2. The least squares solution ˆxLS is the vector in the input space of the matrix A so that the corresponding output ˆy∗^ := AxˆLS is closest to y. Therefore, y∗^ is the vector in R(A) that is closest to y, and can be determined by dropping a perpendicular to R(A) from y. Note that the idea of “dropping a perpendicular” works not only in R^2 and R^3 , but can be extended to Rm^ for arbitrary m.

8 CHAPTER 1. PARAMETER IDENTIFICATION THROUGH LEAST SQUARES

Rm Rn

A (n × m matrix)

xˆLS

y (^) R(A)

Figure 1.2: No solution to A(·) = y. The least squares solution ˆxLS is characterized by the fact that the perpendicular from y onto R(A) is precisely the point AxˆLS.

1.3 ARX model identification by least squares

Consider a system whose outputs and inputs are described by a difference equation:

y[k + n] + βn− 1 y[k + n − 1] + βn− 2 y[k + n − 2] + · · · + β 1 y[k + 1] + β 0 y[k] = αmu[k + m] + αm− 1 u[k + m − 1] + · · · + α 1 u[k + 1] + α 0 u[k]. (1.11)

We re-write (1.11) to see that the output y[·] can be computed recursively from the inputs and past outputs:

y[k + n] = −βn− 1 y[k + n − 1] − βn− 2 y[k + n − 2] − · · · − β 1 y[k + 1] − β 0 y[k]

  • αmu[k + m] + αm− 1 u[k + m − 1] + · · · + α 1 u[k + 1] + α 0 u[k] (1.12)

or, equivalently,

y[k] = −βn− 1 y[k − 1] − βn− 2 y[k − 2] − · · · − β 1 y[k − (n − 1)] − β 0 y[n − k]

  • αmu[k − (n − m)] + αm− 1 u[k − (n − m + 1)] + · · · + α 1 u[k − (n − 1)] + α 0 u[k − n]

Note that the output y[k] at time k depends only on the past outputs y[k − 1], y[k − 2],... , y[k − n + 1], y[k − n] and inputs u[k − n + m], u[k − n + m − 1],... , u[k − n + 1], u[k − n].

In physical systems where the present output does not depend on future inputs, m ≤ n. Such systems are called causal systems. If m < n, the present output y[k] is affected only by the past inputs, whereas if m = n, the present output is affected also by the present input. Eq. (1.11) is said to be of order n.

The equation (1.11) can be compactly written as

y[k] = ϕ[k]T^ θ (1.13)

where θ is a vector containing the parameters αi, i = 0,... , m and βj , j = 0,... , n − 1, and

Chapter 2

Mathematical models of

physical systems

2.1 ODE models

Example: (pendulum): Consider the inverted pendulum shown in Figure 2.1. It consists of a mass-less link of length ℓ, with a point mass m at the end. There is an actuator which can apply a torque of T to the link at the base around the z axis (the z axis is normal to the plane of the paper). The drag on the tip mass due to its motion through air is given by −b θ˙. The angle of the link from the horizontal is denoted by θ (positive in the CCW direction). The dynamics of the angle θ is determined by the following Ordinary Differential Equation (ODE): Derive this ODE from Newton’s laws.

mℓ^2 θ¨(t) = −mgℓ cos θ(t) − b θ˙(t) + T (t), (2.1)

where T is the CCW torque applied to the base, and g is the acceleration due to gravity. Dividing throughout by mℓ^2 , we get

¨θ(t) = − b mℓ^2

θ˙(t) − g ℓ

cos θ(t) + u(t), (2.2)

where u(t) := T mℓ^ (t 2 ).

Define

x 1 := θ x 2 := θ.˙ (2.3)

The ODE (2.2) can now be re-written as

x˙ 1 = x 2 =: f 1 (x, u, t)

x˙ 2 = −

b mℓ^2

x 2 −

g ℓ

cos x 1 + u(t) =: f 2 (x, u, t)

Which is equivalent to the vector form [ x˙ 1 x ˙ 2

]

[

f 1 (x, u, t) f 2 (x, u, t)

]

2.1. ODE MODELS 11

m

θ

˜θ

g

Figure 2.1: Inverted pendulum.

We will deal with dynamical systems that are modeled by a number of coupled first-order differential equations:

x˙ 1 = f 1 (x 1 , x 2 ,... , xn, u 1 ,... , up, t) x˙ 2 = f 2 (x 1 , x 2 ,... , xn, u 1 ,... , up, t) .. . x˙n = fn(x 1 , x 2 ,... , xn, u 1 ,... , up, t)

Vector notation can be used to represent these equations in compact form. Define

x :=

x 1 x 2 .. . xn

u :=

u 1 u 2 .. . up

f (x, u, t) :=

f 1 (x, u, t) .. . fn(x, u, t)

and rewrite (2.6) as

x˙ = f (x, u, t), x ∈ Rn. (2.7)

The eq. (2.7) is called the state equation and x is referred to as the state of the dynamic system. Sometimes, another equation

y = h(x, u, t), y ∈ Rq^ (2.8)

is associated with (2.7), thereby defining a q-dimensional output vector y. The output y frequently consists of signals that are physically measured.

The behavior of dynamic systems without external inputs is governed by the so-called unforced state equation:

x˙ = f (x, t) (2.9)

which is obtained by setting u ≡ 0 in (2.7). If an external input u is specified as an explicit function of time γ(t), or as a feedback function of the state γ(x), or both γ(x, t), then substituting this function in (2.7) also leads to (2.9).

2.1. ODE MODELS 13

F







m g y

(a) mass spring damper

i

R (^) C L

V (b) RLC circuit

Figure 2.2: A mechanical and an electrical system that are governed by similar ODEs.

where the function fInvPenduModel is defined in a file named “f InvPenduModel.m”:

function [x_dot] = f_InvPenduModel(t,x,ModelParams,... input_sine_params) global g x1 = x(1); x2 = x(2); amp = input_sine_params.amp; freq = input_sine_params.freq; %model parameters LinkLen = ModelParams.LinkLen; %m DampingCoeff = ModelParams.DampingCoeff; %Ns/m TipMass = ModelParams.TipMass; %Kg

T = ampsin(2pifreqt); x1_dot = x2; x2_dot = - DampingCoeff/(TipMassLinkLen^2)x2 - g/LinkLen*cos(x1) ...

  • T/(TipMass*LinkLen^2);

x_dot = [x1_dot; x2_dot];

2.1.2 Modeling exercise:

Determine the mathematical model of the following systems:

  1. Mass-spring-damper: consider the mass-spring-damper systems shown in Figure 2.2(a). The vertical displacement of the center of the mass, from its equilibrium position, is denoted by y(t). Determine the differential equation that relates y to the external force F. The spring coefficient is k and damping coefficient is b.
  2. RLC circuit: consider the RLC circuit shown in Figure 2.2(b). Determine the differ- ential equation that relates the current i(t) to the externally supplied voltage V (t).

2.1.3 Equilibrium point and linearization around it

A point x∗^ in the state space is said to be an equilibrium point of (2.9) if f (x∗, t) = 0 for every t. That is, whenever the starts at x∗,it stays at x∗^ for all time. If the state starts

14 CHAPTER 2. MATHEMATICAL MODELS OF PHYSICAL SYSTEMS

close to an equilibrium point, the dynamic evolution of the deviation from the equilibrium x(t) − x∗^ is sometimes described by a linear system.

In the pendulum model (2.4), x = [π/ 2 , 0]T^ is an equilibrium point. Suppose θ(t 0 ) ≈ π 2 for some t 0. Define the deviation of θ from π 2 as

θ˜ := π 2

− θ.

and then determine the dynamics of θ˜ from (2.2), which leads to the following equation

θ¨˜ = − b mℓ^2

θ˜^ ˙ + g ℓ

sin(θ˜) − u

b mℓ^2

θ˜^ ˙ + g ℓ

˜θ − u (2.11)

Thus, if the position of the pendulum is close to the upright position, the dynamics of the deviation-from-the-upright can be approximated by

θ¨˜ = − b mℓ^2

˜θ^ ˙ + g ℓ

θ˜ − u (2.12)

With the states x 1 and x 2 as defined in (2.3), eq. (2.12) can be represented in the state space form as

d dt

[

x 1 x 2

]

[

g ℓ −^

b mℓ^2

] [

x 1 x 2

]

[

]

u.

16 CHAPTER 3. CONTINUOUS TIME SISO LTI SYSTEMS

Let us now evaluate the Laplace transform of

x(t) = e(a+bj)t1(t) :=

ea+bj^ t t ≥ 0 0 t < 0

⇒ L(x(t)) = X(s) =

0

x(t)e−stdt =

0

e(a+bj−s)tdt

a + bj − s

lim τ →+∞ e(a−Re(s)+(b−Im(s))j)τ^ − 1

1 s−(a+bj) if^ Re(s)^ > a undefined otherwise

Hence, we say that the Laplace transform of the signal e(a+bj)t1(t) is (^) s−(a^1 +bj) with a region of convergence Re(s) > a.

The Laplace transform Y (s) of a signal {y(t)} is a complex number, whose values depend on the complex argument s. Therefore Laplace transform can be thought of as a complex function.

Exercise: plot the values of Y (s) for a few complex numbers s. The Laplace transform is linear:

L(ax(t) + by(t)) = aL(x(t)) + bL(y(t)),

where {x(t)}, {y(t)} are signals are a, b are complex scalars.

Why does the ROC matter? Two quite different signals may have the same Laplace transform (but distinct ROCs). So, if the Laplace transform is specified without the ROC, there is ambiguity as to which signal it is the Laplace transform of. Example:

y 1 (t) = e−t1(t) Y 1 (s) =

1 + s

, ROC: s > − 1 (3.4)

y 2 (t) = −et1(−t) Y 2 (s) =

1 + s

, ROC: s < − 1 (3.5)

Inverse Laplace transform: The inverse Laplace transform is defined as

y(t) = L−^1 (Y (s)) :=

∫ (^) σ+j∞

σ−j∞

Y (s)estds, (3.6)

which recovers the signal y(t) from the Laplace transform Y (s).

Does the ROC play a role in evaluating the inverse Laplace transform? The inverse transform is also linear. That is, if X(s) and Y (s) are Laplace transforms of two signals x(t) and y(t) with associated ROCs A and B such that A ∩ B is not empty, then the inverse Laplace transform of X(s) + Y (s) is given by L−^1 (X(s) + Y (s)) = x(t) + y(t).

Evaluation of the inverse transform involves complex integration, but usually the signal can be recovered from Y (s) by partial fraction expansion and using knowledge of Laplace transform of complex exponential signals. Of course, the ROC of the transform Y (s) must be specified. Example:

Y (s) = 7 s^3 + 12s^2 + 28s + 18 s^4 + 2s^3 + 11s^2 + 18s + 18

, ROC: Re(s) > 0.

3.1. LAPLACE TRANSFORM 17

What is L−^1 (Y (s))? From partial fraction expansion, we get

Y (s) =

s + (1 + j)

s + (1 − j)

5 s s^2 + 9

⇒ L−^1 (Y (s)) = L−^1

s + (1 + j)

+ L−^1

s + (1 − j)

+ L−^1

5 s s^2 + 9

These are the possibilities for each term:

L−^1

s + (1 + j)

e−(1+j)t1(t) if ROC: Re(s) > − 1 −e−(1+j)t1(−t) if ROC: Re(s) < − 1

L−^1

s + (1 − j)

e−(1−j)t1(t) if ROC: Re(s) > − 1 −e−(1−j)t1(−t) if ROC: Re(s) < − 1

L−^1

s s^2 + ω^2

5 cos(3t) 1(t) if ROC: Re(s) > 0 −5 cos(3t) 1(−t) if ROC: Re(s) < 0

The ROC specification of the transform Y (s) as Re(s) > 0 implies that the possibilities above that correspond to left-half plane ROCs are ruled out. So,

L−^1 (Y (s)) = e−(1+j)t1(t) + e−(1−j)t1(t) + 5 cos(3t)1(t)

A few useful properties of the Laplace transform are

  1. Laplace transform of the derivative of a signal: if Y (s) is the Laplace transform of a signal {y(t)}, then the transform of the derivative ˙y is

L ( ˙y(t)) = sY (s).

This property follows from differentiating the inverse Laplace transform:

y(t) =

2 πj

∫ (^) σ+j∞

σ−j∞

Y (s)estds

which leads to

y˙(t) =

2 πj

∫ (^) σ+j∞

σ−j∞

sY (s)estds,

which shows that sY (s) is the Laplace transform of ˙y(t).

  1. if Y (s) is the Laplace transform of a signal {y(t)1(t)}, then the transform of the signal y˙1(t) is

If y(0) 6 = 0, but y(t) = 0 for all t < 0, the derivative y˙(t) does not exist at t =

  1. In such cases, we talk L ( ˙y(t)1(t)) = sY (s) − y(0). about the signal ˙y(t)1(t).

This can be shown by integration by parts:

L ( ˙y1(t)) =

−∞

y ˙(t)1(t)e−stdt =

0

e−st^ y˙(t)dt

[

e−sty(t) −

(−s)e−sty(t)dt

]∞

0

= −y(0) + sY (s),

where we have used the fact that, since e−sty(t) is integrable for all values of s in the ROC, e−sty(t) → 0 as t → ∞.

3.2. TRANSFER FUNCTION 19

For the LTI system (3.1), carrying out the above procedure leads to a similar expression:

Y (s) = Hc(s)U (s) + E(s), (3.12)

where the complex function

Hc(s) :=

αmsm^ + αm− 1 sm−^1 + · · · + α 1 s + α 0 sn^ + βn− 1 sn−^1 + · · · + β 1 s + β 0

is called the (continuous time) transfer function from u to y for the system (3.1), and S(s) depends (as it does in (3.10)) on the initial conditions.

note that the transfer func- tion is from U (s) to Y (s), not from u(t) to y(t). SO continuous-time trans- fer function is really a mis- nomer.

Upon taking the inverse s-transform of (3.12), we get

y(t) = L−^1 (Hc(s)U (s)) + S−^1 (E(s))

which shows that the output of the system is a superposition of the response due to the input and the response due to initial conditions.

If all the initial conditions are 0, then (3.12) reduces to

In MATLAB, tf(num, den) creates a continuous-time transfer function with nu- merator and denominator specified by num, den. Ex- ample: tf( 1 , [1 2 3]) pro- duces (^) s (^2) +2^1 s+.

Y (s) = Hc(s)U (s) (3.14)

Since y(t) can be recovered by taking the inverse Laplace transform of the right hand side, it shows that when all initial conditions are zero, the transfer function together with the input completely determines the output.

The roots of the denominator polynomial of Hc(s) are called the poles of the system and the roots of its numerator polynomial are called the zeros of the system.

In MATLAB, zpk(z, p, k) creates a continuous-time transfer function with ze- ros, poles and gain speci- A system is called BIBO stable if the output is bounded for every bounded input. It has fied by z, p and k. two equivalent characterizations for LTI systems

  1. A LTI system is BIBO stable if and only if its impulse response h(t) is absolutely integrable, i.e., ∫ (^) ∞

0

|h(t)|dt < ∞. (^) Can you find a bounded in- put such that if h(t) is not absolutely integrable, the response to this input will

  1. A LTI system is BIBO stable if and only if each of the poles of its transfer function be unbounded? Hc(s) have negative real parts.

If a system is BIBO stable, it can be shown that

ǫ(t) := L−^1 (E(s)) (3.15)

is a signal such that s(t) → 0 as t → ∞. Therefore, for a BIBO stable system, the output at steady state (as t → ∞ ) is given by

yss(t) = L−^1 (Hc(s)U (s)) (3.16)

Thus the transfer function provides information on steady state behavior of the system.

20 CHAPTER 3. CONTINUOUS TIME SISO LTI SYSTEMS

3.2.1 Impulse response and transfer function

Let H(s) be the transfer function of a system from the input u to the output y, and let it now be driven by an impulse input δ(t). In that case,

Y (s) = H(s)L(δ(t)) = H(s)

since the Laplace transform of δ(t) is 1. The impulse response h(t) is the inverse Laplace transform of Y (s), so that we get

The MATLAB command impulse(sys) can be used to plot the impulse re- sponse for the system spec- ified in sys. h(t) = L−^1 (H(s)) ≡ H(s) = L (h(t))

The transfer function of a system is therefore the Laplace transform of its impulse re- sponse.

For an arbitrary input u(t), since the output y(t) satisfies Y (s) = H(s)U (s) when initial conditions are zero, from the convolution property of Laplace transforms, we get

y(t) = h(t) ∗ u(t).

Thus, the response to an arbitrary input can be determined from the knowledge of the impulse response of the system.

3.3 Steady state response to sinusoidal inputs

Stable LTI systems have the unique (and hugely advantageous) property that the output of the system when driven by a sinusoidal input, after transients have died down, is also a sinusoid of the same frequency as the input signal, differing possibly in amplitude and phase. Suppose a system with a transfer function H(s) that is BIBO stable is driven with a sinusoid input signal with frequency ω rad/s:

u(t) = A sin(ωt + φu).

The output of the system is going to be of the form

y(t) = g(ω)A sin(ωt + φ + ∆φ) ︸ ︷︷ ︸ steady state

  • ǫ(t) ︸︷︷︸ transient

where the gain g(ω) and the phase difference ∆φ(ωu) are given by

g(ω) = |H(jω)| ∆φ = ∠H(jω)

Since the system is BIBO stable, ǫ(t) → 0 as t → ∞, so at steady state, when the transients have died down, the output signal just a scaled and phase shifter version of the input sinusoid.

Caution! The phrase steady state is crucial, it comes from the fact that this relationship is true only when transients have died down.

The Bode plot of a transfer function H(s) depicts

In MATLAB, bode(sys) can be used to draw the Bode plot of the system sys. (^) 1. the magnitude |H(jω)| in dB (20 log 10 |H(jω)|) as a function of frequency^ ω^ (in rad/s or Hz).