state space representation part-1

Upload: singappuli

Post on 08-Aug-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/22/2019 State space representation Part-1

    1/47

    Lecture -6: State-space Representation -2

    hours

    By Mr S Wijewardana

    PhD student QMUL 21-04-

    2013

    Learning Objectives:1. Reduction of higher order equations to first-

    order.

    2. State Equations and Stare Variables.3. State-space Analysis & State-space Model.

    4. From State-space to Transfer Functions.

  • 8/22/2019 State space representation Part-1

    2/47

    Solution of higher order differential equations are

    much more difficult to handle than first order

    differential equations.

    It is easy to handle mathematically when the order

    of the differential equation is of first order.

    include

    Consider the differential equation given below:

    The easiest way to solve the

    above equation is to do a

    substitution:

    Now we can write the equation:

    xyy ...

    wy .

    xww .

    This equation is much

    easier to handle than the

    second derivative equation -1

    --------eq1

  • 8/22/2019 State space representation Part-1

    3/47

    From our Maths knowledge we can see that we have to use an integral factor to

    solve the equation now:

    Where p is the coefficient in front of the independent variable x:Nothing will happen to the equation if we multiply each term by an

    integrating factor:

    xdxpdx eee

    xewewexxx

    .

    21

    2

    1

    1

    1

    .2

    1

    )1(1

    )(

    )(

    cecxx

    dxecxwyecxw

    cexe

    dxexe

    dxxewe

    xewedx

    d

    x

    x

    x

    xx

    xx

    xx

    xx

  • 8/22/2019 State space representation Part-1

    4/47

    Consider two differential equations as shown below:

    Reduce them to first order differential equations:

    033

    0343

    .......

    .......

    vvvuu

    vvvuuu -----------eq- 1

    ------------eq-2

    Assume:

    54

    .

    43

    .

    2

    .

    1

    .

    ..

    5

    .

    43

    .

    21

    :

    ;;;;

    xx

    xx

    xux

    Hence

    vxvxvxuxux

    Eq-1 &2 can now be

    written:

    033

    0343

    345

    .

    22

    .

    345

    .

    12

    .

    2

    xxxxx

    xxxxxx

  • 8/22/2019 State space representation Part-1

    5/47

    By adding and subtracting the last two equations:

    402

    302223

    4315

    .

    34122

    .

    eqxxxx

    eqxxxxx

    We can write all equations as shown below:

    431

    .

    5

    .

    4

    .

    4321

    .

    .

    25

    4

    3

    22322

    21

    xxxx

    xx

    xx

    xxxxx

    xx

    We can write the above

    equations in Matrix form:

  • 8/22/2019 State space representation Part-1

    6/47

    5

    4

    3

    2

    1

    5

    .4

    . 3

    .2

    .1

    .

    01102

    10000

    01000

    02232

    00010

    x

    x

    x

    x

    x

    x

    xx

    x

    x

    State Equations and State Variables

    )()()()(

    .)(

    11

    1

    1 tftyadt

    tdya

    dt

    tyda

    dt

    tydon

    n

    nn

    n

    ______________________________________________________________________

    _

    Consider a differential equation as shown

    below:

    ---Eq-1

  • 8/22/2019 State space representation Part-1

    7/47

    If we substitute:

    1

    1

    2

    1

    )()(

    .

    .

    )()(

    )()(

    n

    n

    ndt

    tydtx

    dt

    tdytx

    tytx

    Then we can get:

    )()(

    )()(

    32

    21

    txdt

    tdx

    txdt

    tdx

    Hence we can write:

    )()()()()()( 1122110 tftxatxatxatxadt

    tdx nnnnn

    )()()()(

    .)(

    11

    1

    1 tftyadt

    tdya

    dt

    tyda

    dt

    tydon

    n

    nn

    n

    Eq-2:

    State

    equations

  • 8/22/2019 State space representation Part-1

    8/47

    Eq-2: as you can see clearly now a first order

    differential equation with different set of variables.

    (However, original equation is the nth order

    equation.)The variables x1, x2, x3 are called statevariables

  • 8/22/2019 State space representation Part-1

    9/47

    State-space method is a generalized mathematical modelling technique

    which can be used to analyse control systems.(also called time-domainapproach)

    This has become more popular as it provides more flexibility of modelling

    simple to complex nonlinear systems.

    State space model can also be applied to other areas like economics,

    agriculture, weather etc.

    The model is simply a set of first order differential equations written in

    Matrix form.

    The normal classicalfrequency domain method is limited only to linear,time invariant systems(LTI systems)(But, this method gives the stability and

    transient response information very rapidly)

    However, state-space method can be applied to time varying systems like

    missiles etc.

    Other advantage of the state-space model is the flexibility of choosingstate variables.

  • 8/22/2019 State space representation Part-1

    10/47

    Consider a system described by an nth orderdifferential equation:

    radtda

    dtda

    dtd

    n

    n

    nn

    n

    121

    1

    .

    We are free to choose our own state variable in order to bring the differential

    equation into first order that we can handle easily.

    Convenient way to select state variables is to choose the output, (t), and itsn-1 derivatives as state variables: this choice is normally called the Phase variable

    choice.

    Let us now select the state variables:

    ))(1(...

    4

    ..

    3

    .

    2

    1

    ,

    ,

    dotsn

    nxx

    xx

    x

    ------------------eq1

    ------------------eq2

    A dot above omega signifiesdifferentiation w.r.t. time.

  • 8/22/2019 State space representation Part-1

    11/47

    From equations 1 to 3 we can get

    nnxxxx

    xx

    1

    .

    32

    .

    2

    .

    ,

    1

    Substituting the above relationship to our original nth order

    differential equation: ( for convenience look at from left to right)

    ))(1(...

    4

    ..

    3

    .

    2

    1

    ,

    ,

    dotsn

    nxx

    xx

    x

    nnnnn

    nnnnn

    xaxaxaxarx

    rxaxaxaxax

    112211

    .

    112211

    .

    ...

  • 8/22/2019 State space representation Part-1

    12/47

    Last equation in the previous slide is a set of first order differential

    equations what we want:

    Whole set of equations can now be represented in Matrix form as

    shown below:

    n

    nn

    x

    x

    x

    r

    x

    x

    x

    aaax

    x

    x

    x

    2

    1

    2

    1

    221

    .

    3

    .

    2

    .

    1

    .

    001

    1

    .

    0

    .

    .....

    .....

    0100

    0010

    These two equations represent the state-space model for the dynamicsystem of nth order differential equations. However, the standardnotation used in control systems is shown in the next slide:

  • 8/22/2019 State space representation Part-1

    13/47

    DuCxy

    BuAxx

    .

    State-space Model

    -----------State equation

    -----------Output equation

    X is the state vector:

    ):1(,

    )(

    )(

    )(

    )(2

    1

    vectormatrixn

    tx

    tx

    tx

    tx

    n

  • 8/22/2019 State space representation Part-1

    14/47

    ):1(,

    )(

    )(

    )(

    )( 2

    1

    vectormatrixq

    ty

    ty

    ty

    ty

    q

    Yis the output vector:

    U is the input control vector:

    ):1(,

    )(

    )(

    )(

    )(2

    1

    vectormatrixp

    tu

    tu

    tu

    tu

    p

  • 8/22/2019 State space representation Part-1

    15/47

    A is the system matrix:

    ):(,

    21

    22221

    11211

    vectormatrixnn

    aaa

    aaa

    aaa

    A

    nnnn

    n

    n

    B is the input matrix:

    ):(,

    21

    22221

    11211

    vectormatrixpn

    bbb

    bbb

    bbb

    B

    npnn

    p

    p

  • 8/22/2019 State space representation Part-1

    16/47

    C = output matrix:

    D = feed forward matrix:

    ):(,

    21

    22221

    11211

    vectormatrixnq

    ccc

    ccc

    ccc

    C

    qnqq

    n

    n

    ):(,

    21

    22221

    11211

    vectormatrixpq

    ddd

    ddd

    ddd

    D

    qpqq

    p

    p

  • 8/22/2019 State space representation Part-1

    17/47

    State Variables:A set of user defined minimum number of linearly independent variables which

    are used to define the system variables such that the knowledge of these

    variables at any time t 0 , and information on the input excitation subsequently

    applied, are sufficient to determine the state of the system at any time t t 0 .

    State Vector:

    A vector whose elements are the state variables

    State Space:

    The n-dimensional space whose axes are the state variables.

    State Equation:

    A set of n simultaneous, first order differential equations with n variables, where

    the n variables to be solved are the state variables.

    Output Equation:

    Output equation is an algebraic equation, which signifies the output variables of

    a system as a linear combination of the state variables and the inputs.

    Note here, the number of state variables we define is equal to the order of the

    differential equation.

    We cannot select a variable which is linearly combined with another state

  • 8/22/2019 State space representation Part-1

    18/47

    State Transition

    Matrix

    The solution to the homogeneous(In the matrix equation

    AX=B if B =0 then we call homogeneous) state equationwhat we described earlier:

    Axx .

    Can be represented in the form of )0().()( xttx

    )(tWhere is an n x n matrix and is the unique solution of .)0(),(.

    ItA

    )(t is called the state transition matrix.

    Also note Atet )(

  • 8/22/2019 State space representation Part-1

    19/47

    Example:

    In a normal LRC circuit if VR(t) is chosen as state variable, then i(t)

    cannot be written as a state variable because VR(t)= R.i(t)( one variable

    is a linear combination of the other)

    Example:

    Find the state-space representation in Phase-variable form for the

    transfer function

    65

    5

    )3)(2(

    5

    )(

    )(:

    )3)(2(

    5

    )(

    )(

    2

    sssssR

    sC

    Solution

    sssR

    sC

    State space model in phase-variable presentation is:

    equationOutputDuCxy

    EquationSBuAxx

    .. -----eq1

    ------eq2

  • 8/22/2019 State space representation Part-1

    20/47

    Equation-1 and 2 can also be written in the form:

    n

    nn

    x

    x

    x

    Cy

    Br

    x

    x

    x

    A

    x

    x

    x

    2

    1

    2

    1

    .

    2

    .

    .

    1

    Cross multiplication of the TF yields:

    (s2+5s+6) C(s) = 5 R(s)

    Taking the s operator as: d/dt = s; d2/dt2 =

    s2

    rccc565

    ...

  • 8/22/2019 State space representation Part-1

    21/47

    rccc 565...

    Now we have to select the state variables:

    ..

    2

    .

    3

    ..

    3

    .

    1

    .

    2

    .

    2

    111

    cxxcx

    cxxcx

    xxcx

    Now I can write:

    rxxx

    xx

    565 122.

    21

    .

    In matrix form:

    2

    1

    2

    1

    2

    .1

    .

    01

    50

    5610

    x

    xy

    rxx

    xx

  • 8/22/2019 State space representation Part-1

    22/47

    5 x2

    1.

    x

    2

    .

    x

    -5

    rxxx

    xx

    565 122.

    21

    .

    x1

    -6

    r

    Y(t) or

    c(t)

    Block diagram for the

    computer simulation

  • 8/22/2019 State space representation Part-1

    23/47

    Example:

    Find the state-space representation in phase-variable form for the transfer

    function:

    65

    )1(5

    )(

    )(2

    ss

    s

    sR

    sC

    Solution:

    Cross multiplication of the TF yields the derivative of R(which is

    the input variable).C(s)[s2+5s+6] = (5s+5)R(s)

    For convenience let us eliminate R(s).

    To eliminate R(s) let us introduce a dummy variable called U:

    Then:

    )65(

    )1(5

    . 2

    ss

    s

    R

    U

    U

    C

    Now we can

    write: )1(5)(

    )( s

    sU

    sCand

    )65(

    1

    )(

    )(

    2

    sssR

    sU

  • 8/22/2019 State space representation Part-1

    24/47

    Defining the state variables as before:

    C(s) = 5s.U(s) +5u(s)

    R(s) = s2.U(s) +5s.U(s) +U(s).6

    uuc

    ruuu

    55

    65

    .

    ...

    ..

    2

    .

    2

    .

    1

    .

    1;

    ux

    xuxux

    12

    122

    .

    21

    .

    55

    5

    xxcy

    rxxx

    xx

    2

    155

    1

    0

    2

    1

    56

    10

    2

    1.

    .

    x

    xy

    rx

    x

    x

    x

  • 8/22/2019 State space representation Part-1

    25/47

    Y(t) or

    c(t)

    r(t)1

    x2

    1.

    x

    2

    .

    x

    -5

    x1

    -6

    5

    5

    Block diagram for the state space model in

    phase variable form(Computer simulation

    diagram)

    Question:

  • 8/22/2019 State space representation Part-1

    26/47

    22187

    23

    )(

    )(23

    2

    ssS

    ss

    sR

    sC

    Question:

  • 8/22/2019 State space representation Part-1

    27/47

    Stability

    we say system x =Ax is stable if etA 0 as t

    meaning:

    state x(t) converges to 0, as t , no matter what x(0) is

    all trajectories of x =Ax converge to 0 as t fact: x =Ax is stable if and only if all eigenvalues of A have negative real

    part:

    i < 0, i = 1, . . . , n

  • 8/22/2019 State space representation Part-1

    28/47

    From State Space to Transfer Function

    When analysing control systems more often we haveto learn how to transfer the systems from statespace to TF and vise-versa.

    Assume the standard state-space model:

    DuCxy

    BuAxx

    .

    2)()()(

    1)()()(

    eqsDUsCXsY

    eqsBUsAXssX

    In Laplace-

    domain:

    From equation-1:

    [sI-A] X(s) = B U(s)

    X(s) = [sI-A]-1 BU(s)

  • 8/22/2019 State space representation Part-1

    29/47

    Substituting in equation 2 we get:

    Y(s) = C[sIA]-1 BU(s) + DU(s)

    Y(s) = [C(sIA)-1

    B +D] .U(s)

    The matrix [C(sI-A)-1B +D] is called the transfer

    function matrix because it relates the output

    vector Y(s) to the input vector U(s). {if U(s) andY(s) are scalars} Then we can write:

    DBAsICsU

    sYsG 1)(

    )(

    )()(

    2]([

    )(

    .)(

    )(

    eqAsI

    DAsIBAsIadjCsG

    DBAsI

    AsIadjCsG

  • 8/22/2019 State space representation Part-1

    30/47

    From equation-2, we can see that the dynamic characteristics and stability are

    determined by poles of the closed-loop transfer function, that is , the roots of sI-A=0

    This equation is called the characteristic equation in state space model.

    0 AsIIf the coefficients of matrix A are real

    then are also

    real.0 AsI

    Example: A control system is defined by the state space model by the followingequations. Find the transfer function of the system.

    2

    1

    2

    1

    2

    .1

    .

    01

    0

    1

    32

    10

    x

    x

    y

    ux

    x

    x

    x

    By comparison with the state space model:

    ]01[,0

    1,

    32

    10

    CBA

  • 8/22/2019 State space representation Part-1

    31/47

    We have already derived the transfer function

    matrix as shown below:

    DBAsICsU

    sYsG 1)(

    )(

    )()(

    21

    3

    )(

    0

    1

    2

    13

    21

    1)()(

    2

    13

    23

    1)(

    1

    2

    1

    ss

    s

    sG

    s

    s

    ss

    oBAsICsG

    s

    s

    ssAsI

    Using Matlab:

    A=[0 1;-2 -3];

    >> B=[1;0];

    >> C=[1 0];>> D=0;

    >> [num,den]=ss2tf(A,B,C,D)

    num =

    0 1 3

    den =

    1 3 2

  • 8/22/2019 State space representation Part-1

    32/47

    Use Matlab to find the transfer function of the state-space model:

    01,2

    0,

    32

    10

    CBA

    Answer:num =

    0 0 2.0000

    den =

    1 3 2

  • 8/22/2019 State space representation Part-1

    33/47

    Solution of State Variables

    How to obtain a general solution to the linear time-invariant state equation.

    (space vehicle: mass will change after some time: time variant systems)

    Solution of scalar differential equations.

    Consider a system with only initial conditions without any forcing function:

    )()(.

    taxtx

    Assume a solution of x(t) is in the form of power series:

    x(t)= b0

    +b1t + b

    2t + b

    3t + ---------eq2

    ...32)( 2321.

    tbtbbtx

    By substituting the assumed solution to the first equation:

    b1 + 2b2t + 3b3t2 + = a [b0 + b1t + b2t

    2 +]

    Equating the coefficients of equal powers of t:

    b1 = a b0

    b2 = a b1/2 = a2b0= (1/2!) a

    2b0

    b3

    = (1/3!)a3.b0

    --------------------eq1

  • 8/22/2019 State space representation Part-1

    34/47

    Substituting in equation 2 : When t = 0,

    x(0) = b0 .

    Therefore the solution x(t) can be written as:

    )0()(

    )0(.. .!3!2

    1)(3322

    xetx

    xtata

    attx

    at

    ...)0(!2

    1)0()0()(

    2

    xaaxxtx

    x(0) is the initial condition of state variable

    Combining equation 2

    Laplace Transform Method to the solution of Homogeneous State Equations

  • 8/22/2019 State space representation Part-1

    35/47

    p g q

    Our system is:

    )()(.

    tAxtx ---------eq1

    Taking Laplace transform of equation-1:Laplace transform of x: (x)= X(s)

    Hence s X(s)X(0) = AX(s): Note the theorem )0()(

    fssF

    dt

    df

    s X(s)- A X(s) = X(0)

    (s I - A) X(s) = X(0)

    X(s)= (sIA)-1 X(0)

    Hence: x(t) = -1 (s IA)-1x(0)

    ...3

    2

    2

    1

    s

    A

    s

    A

    s

    IAsI

  • 8/22/2019 State space representation Part-1

    36/47

    -1 (s IA)-1

    )0()(

    )(

    !3!21

    3322

    xetx

    eAsI

    etAtA

    AtI

    At

    At

    At

    we can write

    Hence the

    solution is:

    )()(

    3210

    2

    1

    2

    .1

    .

    txtx

    x

    x

    Example:

    Find x1(t) and x2(t) given initial conditions:

    2

    1

    )0(

    )0(

    2

    1

    x

    xUsing Laplace

    transformmethod.

  • 8/22/2019 State space representation Part-1

    37/47

    We have shown that given the initial conditions the solution to the above

    state equation can be represented in the form of x(t) = eAt x(0).

    This solution is for the state equation that can be represented as follows:

    )()(.

    tAxtx

    Taking Laplace transform of both side of the equation we can write:

    sX(s) -X(0) = A X(s)

    (sIA)X(s) =X(0)

    X(s) = (sI -A)-1 X(0)

    2

    1

    )0(,32

    10

    XAWe were giventhat

    Hence we can

    write:

    32

    1

    32

    10

    0

    0

    s

    s

    s

    sAsI

  • 8/22/2019 State space representation Part-1

    38/47

    tt

    tt

    ee

    ee

    tx

    tx

    ss

    sss

    s

    ss

    s

    s

    XAsI

    2

    2

    2

    1

    2

    1

    64

    34

    )(

    )(

    )2)(1(

    22)2)(1(

    5

    23

    2

    1

    2

    13

    )0(

    We can check the solution whether it is correct by applying the initialconditions: x1(0) =1, x2(0) =2, 1 = 1 and 2 =2: which implies as correct.

    32

    10A

    In the same example if initial conditions are not given:

    The state transition matrix is defined as: Atet)( -1 (s IA)-1

  • 8/22/2019 State space representation Part-1

    39/47

    32

    1

    32

    10

    0

    0][

    s

    s

    s

    sAsI

    The inverse of (sIA) is given by:

    )2)(1()2)(1(2

    )2)(1(

    1

    )2)(1(

    3

    2

    13

    )2)(1(

    1][ 1

    sss

    ss

    ssss

    s

    s

    s

    ssAsI

    Atet)( -1 (s IA)-1Since:

    )(tWe can get thestate transition

    matrix:

    tttt

    ttt

    eeee

    eeee22

    221

    222

    2

  • 8/22/2019 State space representation Part-1

    40/47

    We have learned how to construct signal flow graphs (SFG) for simultaneous

    equations in lecture -5: The signal flow graphs which represent the state

    equations or differential equations are called state diagrams. State diagram is anextension of SFG to portray state equations and differential equations.

    Given the state diagram it is much easier to construct state equations or TF than

    from SFG. Construction procedures and rules are same for SFG and State

    diagrams but, state diagram is in Laplace domain.

    State Diagram

    State Diagram for State Equations:

    Consider the control system:

    4954

    3853

    26237

    12352

    321

    3213

    .

    3212

    .

    3211

    .

    eqxxxy

    eqrxxxx

    eqrxxxx

    eqrxxxx

  • 8/22/2019 State space representation Part-1

    41/47

    R(s) sX3(s) X3(s) sX2(s) X2(s) sX1(s) X1(s)

    Y(s)

    Initially let us define three state variable x1, x2, x3 and let these three state

    variables are represented as nodes and to the left of each node, respective

    derivatives of them are also shown as below:

    Let us define the input as r and the output as y.

    In Laplace domain we can show the derivatives and nodes as shown below:

    In the next step, we interconnect the state variables and their derivatives

    with the definition of integration (1/s):

    sX3(s) X3(s)

    1/s

    Integratio

    n

  • 8/22/2019 State space representation Part-1

    42/47

    12352 3211.

    eqrxxxx

    State diagram for equation -1:

    R(s) sX3(s) X3(s) sX2(s) X2(s) sX1(s) X1(s) Y(s)-51/s

    2

    1/s1/s

    2

    3

  • 8/22/2019 State space representation Part-1

    43/47

    R(s) sX3(s) X3(s) sX2(s) X2(s) sX1(s) X1(s) Y(s)

    R(s) sX3(s) X3(s) sX2(s) X2(s) sX1(s) X1(s) Y(s)

    6

    1/s

    21/s 1/s

    -7

    -3

    262373212

    .

    eqrxxxx

    1/s8

    1

    1/s-5

    -3

    1/s

    3853 3213.

    eqrxxxx

  • 8/22/2019 State space representation Part-1

    44/47

    R(s) sX3(s) X3(s) sX2(s) X2(s) sX1(s) X1(s) Y(s)

    321 954 xxxy

    State diagram for equation -1:

    5

    1/s

    9

    1/s 1/s

    -4

  • 8/22/2019 State space representation Part-1

    45/47

    R(s) sX3(s) X3(s) sX2(s) X2(s) sX1(s) X1(s) Y(s)

    Now we have to combine all figures to get one state diagram for all equations:

    3

    1

    8

    5

    1/s

    9

    1/s 1/s

    -4

    6

    2

    -3

    -5

    2-5

    2

    -7-3

    Homework: check the numbers and the branches

  • 8/22/2019 State space representation Part-1

    46/47

    End

    Characteristic Equation From State-Space Representation:

  • 8/22/2019 State space representation Part-1

    47/47

    The roots of the characteristic equation are the same as the eigenvalues of

    matrix A. The characteristic equation of matrix A can simply be computed

    with Matlab by using the command :

    p = poly(A);

    or p = poly(A,v); %retun as a variable v