part 2 - step and impulse response graphical models

Upload: farideh

Post on 28-Feb-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    1/86

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    2/86

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Part II

    Step and Impulse ResponseGraphical Models

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    3/86

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Classification

    RecallTypes of modelsfrom Part I:

    1 Mental or verbal models

    2 Graphs and tables3 Mathematical models, with two subtypes:

    First-principles, analytical models

    Models from system identification

    Step and impulse responses are graph models; they belong to thesecond category.

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    4/86

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Recall example

    A hard drive read-write head, with input = motor voltage, and output =

    head position.

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    5/86

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Classification (continued)

    Step and impulse response models also belong to the class ofnonparametric models: they are functions of time that, in general,cannot be represented by a finite number of parameters.

    The study of these models is called transient analysis, since it relies

    in a large part on the transient regime of the response.

    Note: We will in fact derive parametric models from the

    nonparametric graph model.

    Li d l St 1 t d St 2 d d I l 1 t d I l 2 d d

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    6/86

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Table of contents

    1 Recap: Continuous-time linear models

    2 Step response models of first-order systems

    3 Step response models of second-order systems

    4 Impulse response models of first-order systems

    5 Impulse response models of second-order systems

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    7/86

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    A definition of linear systems

    A system islinearif it satisfies:

    Superposition: If for inputu1(t)the system responds with outputy1(t); and foru2(t)the system responds withy2(t); thenfor inputu1(t) + u2(t)the system will respond withy1(t) + y2(t).

    Homogeneity: If for inputu(t)the system responds with output y(t);

    then for inputu(t)the system will respond withy(t).

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    8/86

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Transfer function representation

    The transfer function is:

    H(s) = Y(s)

    U(s)

    = bms

    m + bm1sm1 +. . .+ b1s+ b0

    ansn

    + an1sn

    1

    +. . .+ a1s+ a0, m

    n

    whereU(s)and Y(s)are, respectively, the Laplace transforms of theinput and output signalsu(t)and y(t).(Note: in zero initial conditions.)

    TheLaplace transformof a signalf(t)is:

    F(s) = L[f(t)] =

    0

    f(t)estdt

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    9/86

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Laplace transform interpretation

    sis calledcomplexargument (as in complex number), and theLaplace transform can be seen as taking a function from the timedomaintto the more abstract, complex domains.

    The motivation is that many signal operations common inengineering (differentiation, integration, etc.) become muchsimpler in thesdomain.

    Intuitively, L can be seen as a representation off in terms of itsexponential components, like the Fourier transform is arepresentation in terms of periodic components.

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    10/86

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Table of contents

    1 Recap: Continuous-time linear models

    2 Step response models of first-order systems

    First order system

    Step response. Determining the parameters

    Example

    3 Step response models of second-order systems

    4 Impulse response models of first-order systems

    5 Impulse response models of second-order systems

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    11/86

    p p p p

    First order system: Motivating example

    First-order systems are common. Typical example: a thermal system.Consider an object at temperature1 (output variable) placed in anenvironment at temperature2 (input variable). Then:

    C1(t) =2(t) 1(t)

    R

    whereCis the thermal capacitance and Ris the thermal resistance.

    Applying the Laplace transform on both sides:

    Cs1(s) =2(s)1(s)

    R

    leading to the transfer function:

    H(s) =1(s)

    2(s)=

    1CR

    s+ 1

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    12/86

    p p p p

    First order system: General form

    H(s) = K

    Ts+ 1where:

    Kis the gain (=1 in the example)

    Tis the time constant (= CR

    in the example)

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    13/86

    Table of contents

    1 Recap: Continuous-time linear models

    2 Step response models of first-order systems

    First order system

    Step response. Determining the parameters

    Example

    3 Step response models of second-order systems

    4 Impulse response models of first-order systems

    5 Impulse response models of second-order systems

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    14/86

    Ideal step input

    uS(t) = 0 t 0

    1 t>0

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    15/86

    Ideal 1st order response

    Solving the differential equation fory(t)(or easier: solve forY(s)andthen apply inverse Laplace transform L1), we get:

    y(t) =K(1 et/T)from where:

    y(t) = K

    Tet/T, y(0) =

    K

    Te0 =

    K

    T

    y(T) =K(1 e1) 0.632Kand similar fort=2T, 3T, 4T(see figure).

    Note: output within 2% of steady state after 4T.

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    16/86

    Determining the parameters

    So far, everything known from: Sys. Theory, Process Modeling.

    Now, consider we are given a step response of a real, unknownsystem: this response is the nonparametric model. We can use it tofind an approximate transfer function (a parametric model) of thesystem.

    Algorithm

    1 Read the steady-state value. That is the gainK.

    2 Determine the time value where the output reaches 0.632 of its

    steady state value. That is the time constantT.

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    17/86

    Nonzero initial conditions

    In practice, we often cannot use ideal step signals: the system must

    be kept around a safe/profitable operating point. Real-lifeapproximations of step inputs are rectangular signals as below. Thesystem response is therefore nonstandard.

    But recall linearity properties. Our new input is

    u(t) =u0+ (uss u0)uS(t)withuS(t)the ideal step input. Then,denoting the ideal step response by yS(t), we have the new output:

    y(t) =y0+ (uss u0)yS(t)

    simply a shifted and scaled version. (Note we assumed the system

    was in steady-state aty0 with input held constant atu0.)

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    18/86

    Nonzero initial conditions (continued)

    Then the parameters are recovered easily:

    K = yss y0uss u0

    y(T) =y0+ 0.632(yss

    y0)

    (read T where the output raises 0.632 of the difference)

    The start time of the step may also be different from 0, solved triviallyby shifting the time axis.

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    19/86

    Table of contents

    1 Recap: Continuous-time linear models

    2 Step response models of first-order systems

    First order system

    Step response. Determining the parameters

    Example

    3 Step response models of second-order systems

    4 Impulse response models of first-order systems

    5 Impulse response models of second-order systems

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    20/86

    Example: Thermal system

    Consider the thermal system in the figure. The input is the voltage V

    applied to the lamp, the output is the temperature read by athermocouple at the back of the steel plate.

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    21/86

    Thermal system: Experimental data

    The data is obtained from the Daisy database(http://homes.esat.kuleuven.be/smc/daisy/).

    Note: the presence ofnoisein the data! This is virtually always true inidentification experiments.

    We use the first step for identification, and keep the others for

    validation.

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    http://homes.esat.kuleuven.be/~smc/daisy/http://homes.esat.kuleuven.be/~smc/daisy/http://homes.esat.kuleuven.be/~smc/daisy/http://homes.esat.kuleuven.be/~smc/daisy/http://homes.esat.kuleuven.be/~smc/daisy/
  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    22/86

    Thermal system: Model and parameters

    The nonparametric model is the graph. We use it to estimate atransfer function model.

    We haveyss 192 C, y0 129 C. Also, the inputuss=9 V and(from the experiment) we know that u0 =6 V. Therefore:

    K = yss y0uss u0

    192 1299 6 21

    Further,y(T) =y0+ 0.632(yss

    y0)

    169, and identifying this point

    on the graph we getT 60.

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    23/86

    Thermal system: Transfer function model

    K =21T =60H(s) = K

    T s+ 1

    = 21

    60s+ 1

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    24/86

    Thermal system: Validation of transfer function model

    The simulation does not take into account the non-zero initialcondition of the system, hence the first part is different.

    The fit is not great the cooling dynamics are quite slower than theheating dynamics, for example, so in reality this is not a simplefirst-order system.

    Nevertheless, the transfer function is sufficient for a rough initial

    model: this is the typical use of transient analysis.

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    25/86

    Thermal system: Validation (continued)

    Mean squared error (MSE) on the validation data (second and furthersteps):

    J= 1

    N

    Nk=1

    e2(k) = 1

    N

    Nk=1

    (y(k) y(k))2 62.21Note that although we treated the data as continuous-time so far, it isof course sampled in discrete time, so a meaningful MSE can be

    computed. The sampling time isTs =2 s.

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    26/86

    Table of contents

    1 Recap: Continuous-time linear models

    2 Step response models of first-order systems

    3 Step response models of second-order systems

    Second order system

    Step response. Determining the parameters

    Example

    Other issues

    4 Impulse response models of first-order systems

    5

    Impulse response models of second-order systems

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    27/86

    Second order system: Motivating example

    Second-order systems are also quite common.

    Consider a massmtied to a spring, to which we apply a force f (the

    input) away from the string. We measure the position xof the mass(output). From Newtons second law:

    mx(t) =f(t) kx(t)wherekis the spring constant.

    Applying the Laplace transform on both sides:ms2X(s) =F(s) kX(s)

    leading to the transfer function:

    H(s) = X(s)

    F(s)

    = 1

    ms2

    + k

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    28/86

    Second order system: General form

    H(s) = K2n

    s2 + 2ns+2n

    where:

    Kis the gain (= 1k

    in the example)

    is the damping (=0 in the example)

    nis the natural frequency (= k/min the example)

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    29/86

    Table of contents

    1 Recap: Continuous-time linear models

    2 Step response models of first-order systems

    3 Step response models of second-order systems

    Second order system

    Step response. Determining the parameters

    Example

    Other issues

    4 Impulse response models of first-order systems

    5

    Impulse response models of second-order systems

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    30/86

    2nd order step response shapes

    Damping factoris crucial in determining step response shape.

    =0, undamped

    (0, 1), underdamped

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    31/86

    2nd order step response shapes (continued)

    =1, critically damped

    >1, overdamped

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    U d d d 2 d d

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    32/86

    Underdamped 2nd order step response

    We are mostly interested in the underdamped case ( (0, 1))

    Solving fory(t)we get:

    y(t) =K

    1 1

    1 2ent sin(n

    1 2t+ arccos )

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    R h t i ti

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    33/86

    Response characteristics

    Steady-state valueK

    To get the peaks and valleys, we solve for zero derivative, y(t) =0:

    y(t) = Kn1 2 ent sin(n1 2t) =0

    tm= mn

    1 2

    y(tm) =K[1 + (

    1)mMm], whereovershoot M=e

    12

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    N t i d l

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    34/86

    Nonparametric model

    Now, consider we are given a step response of a real, unknownsystem: this response is the nonparametric model. Using the insightdeveloped above, we can find an approximate transfer function (aparametric model) of the system.

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    D t i i th t

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    35/86

    Determining the parameters

    Algorithm

    1 Determine steady-state output valueyss. That is the gainK.2 Determine overshootM, (a) from the first peak: M= y(t1)yss

    yss, or

    (b) from ratio of first valley and first peak: M=

    yss

    y(t2)

    y(t1)yss .3 SolveM=e

    12 , leading to= log1/M

    2+log2 M

    4 Read period of oscillation T0=t3 t1= 2n

    12, getting

    n= 2

    T012

    , or equivalentlyn= 2T02 + log

    2 M.

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Nonzero initial conditions

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    36/86

    Nonzero initial conditions

    Similar to 1st order case: new input u(t) =u0+ (uss u0)uS(t), sothe new output is again just a shifted and scaled version of the idealstep responseyS(t): y(t) =y0+ (uss u0)yS(t).The modified formulas are:

    1 GainK = yssy0ussu0 .

    2 Overshoot (a)M= y(t1)yssyssy0 (we need to subtracty0), or (b)

    M= yssy(t2)y(t1)yss (no change in this formula).

    3 : same as before.4 T0: same as before, the time axis is unchanged.

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    37/86

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    2nd order example

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    38/86

    2nd order example

    Simulation example, 500 samples with sampling time 0.047.

    Note again the measurement noise. Also, while the experiment haszero initial condition (u0 =y0 =0), the steps still have nonstandardvalues (different from 1).

    We will use step 1 for identification, steps 3-5 for validation (using the

    fact that step 2 returns the system to zero initial condition).

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Example: step response model

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    39/86

    Example: step response model

    The nonparametric model is the graph. We use it to estimate atransfer function model.

    Since the output is quite noisy, we determine the steady state valueby averaging several samples, namely numbers 90 to 100, betweent4andt5:

    yss 111

    100k=90

    y(k) 1.00

    We read on the graph: t1

    0.65,t2

    1.35,t3

    1.96,y(t1)

    1.37,

    y(t2) 0.86. Finally,uss=4.

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Example: Determining the parameters

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    40/86

    Example: Determining the parameters

    1 GainK = yssy0ussu0 0.25.

    2 Overshoot M= y(t1)yssyssy0 0.36.

    3 Damping= log 1/M2+log2 M

    0.31.4 PeriodT0 =t3 t1 1.31, so natural frequency

    n= 2

    T0

    12 5.05.

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Example: Transfer function model

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    41/86

    Example: Transfer function model

    K =0.25

    =0.31

    n=5.05H(s) = K2ns2 + 2ns+2n = 6.38s2 + 3.09s+ 25.51

    (Note: Actual calculations done in double precision with Matlab, so

    using the two-decimal precision numbers given in the slides can leadto slightly different results. This remark applies to all the examples.)

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Example: Validation of transfer function model

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    42/86

    Example: Validation of transfer function model

    Very good fit (not surprising since this is synthetic data).

    Mean squared error (MSE):

    J= 1

    N

    Nk=1

    e2(k) = 1

    N

    Nk=1

    (y(k) y(k))2 9.66 105

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Table of contents

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    43/86

    Table of contents

    1 Recap: Continuous-time linear models

    2 Step response models of first-order systems

    3 Step response models of second-order systems

    Second order system

    Step response. Determining the parameters

    Example

    Other issues

    4 Impulse response models of first-order systems

    5 Impulse response models of second-order systems

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Choosing the order

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    44/86

    Choosing the order

    Even when it is overdamped orcritically-damped, att=0 a 2ndorder system response will have aderivative of 0: it will betangent tothe time axis. In contrast, thetangent slope isK/Tfor 1st ordersystems.

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    45/86

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Table of contents

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    46/86

    Table of contents

    1

    Recap: Continuous-time linear models

    2 Step response models of first-order systems

    3

    Step response models of second-order systems

    4 Impulse response models of first-order systems

    Impulse signal. Relation between step and impulse responses

    First-order impulse response. Determining the parametersExample

    5 Impulse response models of second-order systems

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Ideal impulse input

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    47/86

    dea pu se put

    The ideal impulse is the Dirac delta. An informal definition:

    uI(t) =

    t=00 t=0

    with the additional condition uI(t)dt=1.(In fact, the ideal impulse is not a function and requires the notion ofdistributions to be formally defined.)

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Practical impulse realization

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    48/86

    p

    In practice, we cannot create signals of infinite amplitude.So, an approximate impulse is realized with the rectangular signal:

    uIR(t) =

    1 t [0, )0 otherwise

    where (much smaller than the time constants in the system).Note the signal still obeys

    uIR(t)dt=1 (rectangle has area 1).

    So there will be approximation error, but for small the error is notlarge. We develop the analysis in the ideal case, while the examples

    use the practical realization.

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Useful property of impulse response

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    49/86

    p p y p p

    In the Laplace domain:

    step inputUS(s) = 1

    s, impulse inputUI(s) =1

    Recall that the time-domain response of a system can be expressedas: y(t) = L1 {Y(s)}, andY(s) =H(s)U(s). So:

    YS(s) = 1

    sYI(s), YI(s) =sYS(s)

    yS(t) = t0

    yI()d, yI(t) = yS(t)

    The impulse response is the derivative of the step response.

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Table of contents

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    50/86

    1 Recap: Continuous-time linear models

    2 Step response models of first-order systems

    3 Step response models of second-order systems

    4 Impulse response models of first-order systems

    Impulse signal. Relation between step and impulse responses

    First-order impulse response. Determining the parametersExample

    5 Impulse response models of second-order systems

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Recall: First order system

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    51/86

    y

    H(s) = K

    Ts+ 1

    where:

    K is the gain

    Tis the time constant

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Ideal 1st order impulse response

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    52/86

    Using the relation to the step response, and the derivative of the stepresponse we already computed, we have the impulse response:

    yI(t) = K

    Tet/T, t 0

    from where:

    yI(0) = KT

    =ymax

    yI(T) = K

    Te1 =ymaxe

    1 0.368ymax

    Note: yI(4T) =0.0183ymax, so like for the step response, the output

    is roughly in steady state after 4T.

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Nonzero initial conditions

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    53/86

    When the initial conditions are non-zero, the impulse is shifted alongthe vertical axis.

    From linearity, given the shiftedu(t) =u0+ uI(t), we have a shiftedy(t) =y0+ yI(t). (We assumed the system was in steady-state at y0with input held constant atu0.)

    So the behavior is:

    ymax=y0+K

    T

    y(T) =y0+ 0.368(ymax y0)

    Noteu0 =uss, y0 =yss.

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Determining the parameters

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    54/86

    Consider now that we are given the impulse response of a real,unknown system: this response is the nonparametric model. As in

    the step case, we can use this response to find an approximatetransfer function (a parametric model) of the system.

    We consider first non-zero initial conditions because that is actually afavorable situation: we have a reliable way to find the gainK.

    Algorithm

    1 Read the steady-state (or initial) output yss=y0 and inputuss=u0. Then,K =yss/uss.

    2 Readymaxand determine the time where the output decreases to0.368 of the differenceymax

    y0. That is the time constantT.

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Determining the parameters in zero initial conditions

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    55/86

    We can estimate the gain by using ymax= K

    T, but in practice this will

    not be as accurate (e.g. because the impulse is not ideal).

    Algorithm

    1 Readymaxand determine the time where the output decreases to0.368 of the differenceymax y0. That is the time constant T.

    2 FindK =ymaxT.

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Table of contents

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    56/86

    1 Recap: Continuous-time linear models

    2 Step response models of first-order systems

    3 Step response models of second-order systems

    4 Impulse response models of first-order systems

    Impulse signal. Relation between step and impulse responses

    First-order impulse response. Determining the parametersExample

    5 Impulse response models of second-order systems

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    1st order example

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    57/86

    Simulation example, 330 samples with sampling time Ts =0.28 (30samples are the initial steady-state regime, then 100 for each impulse

    response). The practical impulses are realized with = Ts =0.28,amplitude 1/ 0.37.

    Note the measurement noise and the non-zero initial condition.

    We will use impulse 1 for identification, impulses 2-3 for validation.

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    58/86

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Example: Model and parameters (continued)

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    59/86

    The maximum output value isymax 0.19, reached att1 8.86.Valuey0+ 0.368(ymax y0) 0.15 is reached att2 12.60.Therefore:

    1 K =yss/uss 0.25.2 T =t2 t1 3.92.

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Example: Transfer function model

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    60/86

    K =0.25

    T =3.92H(s) = KT s+ 1 = 0.253.92s+ 1

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    61/86

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    State space model of annth order system

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    62/86

    Astate space modelof a linear system is a representation of the

    system in the following form:

    x(t) =Ax(t) + Bu(t)

    y(t) =Cx(t) + Du(t)

    where:xstate vector,x Rn withnthe order of the systemuandyare the usual input and output. They can be vectors ifthe system has several inputs or outputs, but for us here, a scalarinput and output are enough.

    Astate matrix,B input matrix,Coutput matrix, andDfeedthrough matrix. They have appropriate dimensions:A Rnn,B Rn1 (a vector, due to scalar input), C R1n (avector, due to scalar output), D R (a scalar).

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    State space model of a general 1st order system

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    63/86

    Starting from transfer function model:

    H(s) = K

    Ts+ 1=

    Y(s)

    U(s)

    and moving back to the time domain we get:

    y(t) =1T y(t) + KTu(t)

    By simply takingx=y(recall that the system has order 1 so a singlestate suffices), we can write:

    x(t) = 1T

    x(t) + KT

    u(t)

    y(t) =x(t)

    so our state space model hasA = 1T

    ,B= KT

    , C=1, D=0.

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Back to example: (Approximate) state space model

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    64/86

    x(t) = 1Tx(t) +KTu(t) = 0.26x(t) + 0.06u(t)

    y(t) =x(t)

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Example: Validation with correct initial condition

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    65/86

    To take the initial condition into account, we simply set x(0) =y0when starting the simulation.

    Mean squared error (MSE) on the validation data:

    J= 1

    N

    Nk=1

    e2(k) 3.74 106

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    66/86

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    67/86

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Recall: Second order system

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    68/86

    H(s) = K2n

    s2 + 2ns+2n

    where:

    K is the gain

    is the damping factor

    nis the natural frequency

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    69/86

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    70/86

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Underdamped impulse response

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    71/86

    Using the derivative of the step response we already computed, wehave the impulse response:

    yI(t) = Kn1 2 ent sin(n1 2t)

    Already note that the oscillation period is unchanged, soT0 =t3 t1 =2(t2 t1).

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    72/86

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    73/86

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Nonzero initial conditions: estimatingK

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    74/86

    In non-zero initial conditions, the impulse is shifted,u(t) =u0+ uI(t),leading to a shiftedy(t) =y0+ yI(t). Noteu0 =uss, y0 =yss.

    From the steady-state values we can estimate thegain: K = yssuss

    .There is no change in T0, but the areas must now be found relative tothe steady-state value:

    A+= t0,1

    0

    (y() y0)d =K+ KM

    A= t0,2

    t0,1

    (y0 y())d =KM+ KM2

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    75/86

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    76/86

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Table of contents

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    77/86

    1 Recap: Continuous-time linear models

    2 Step response models of first-order systems

    3 Step response models of second-order systems

    4 Impulse response models of first-order systems

    5

    Impulse response models of second-order systemsSecond-order impulse response. Determining the parameters

    Example

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    78/86

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Example: Steady-state values and gain

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    79/86

    We use the graph (nonparametric model) to estimate a transferfunction (parametric model). We haveu0 =uss=2.

    We determine the steady state output (equal to the initial output) byaveraging the last 11 samples:

    yss=y0 111

    130

    k=120

    y(k) 0.5

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    80/86

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    81/86

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    82/86

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    83/86

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    84/86

    Linear models Step 1st order Step 2nd order Impulse 1st order Impulse 2nd order

    Back to example: (Approximate) state space model

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    85/86

    x(t) =

    0 1

    26.68

    3.22

    x(t) +

    0

    6.64u(t)

    y(t) = 1 0 x(t) + 0u(t)wherexis now the whole state vector, x(t) =

    x1(t)x2(t)

    .

  • 7/25/2019 Part 2 - Step and Impulse Response Graphical Models

    86/86