se207 modeling and simulation unit 4

42
SE207 Modeling and Simulation Unit 4 Standard Forms for System Models Dr. Samir Al-Amer Term 072

Upload: others

Post on 05-Feb-2022

2 views

Category:

Documents


0 download

TRANSCRIPT

SE207 Modeling and SimulationUnit 4

Standard Forms for System Models

Dr. Samir Al-AmerTerm 072

SE207 Modeling and SimulationUnit 4

Lesson 1: State Variable Models

Dr. Samir Al-AmerTerm 072

Read Section 3.1

Outlines Two standard forms for models will be used.

State variable modelInput-output model

States (state Variables) For each dynamical system, there exist a set of variables (states) such that if the values of the states are known an any reference time t0 and if the input is known for t ≥ t0 then the output and the states can be determined for t ≥ t0

States (State Variables) States are not unique.The value of states summarize effect of past inputs on the system.Usually the number of states is equal to the number of energy storing elements ( Masses and springs)In some cases we may have redundant states (the number of states is less than the number of energy storing elements)

State Variable Models Example (1-input,1-output and 2-states)

uqy

ubqqqubqqq

5.0

5.032

1

2212

1211

+=

++=++=

&

&State Equations

Output Equation

u: input, y: output, qi :states ( or state variables)

State Variable Models

2221213232221212

2121113132121111

2321313332321313

2221213232221212

2121113132121111

ududqcqcqcyududqcqcqcy

ububqaqaqaqububqaqaqaq

ububqaqaqaq

++++=++++=

++++=++++=++++=

&

&

& State Equations

Output Equations

State Equations: set of first order ODEs.The derivative of a state = algebraic function of states and inputs

Output Equation:Output = algebraic function of states and inputs

Typical Choice of the States Typical choice of states for translational Mechanical

systems

the number of states is equal to the number of energy storing elements ( Masses and springs)Some times we have less than that numberSelect velocity of a mass as a stateSelect elongation of a spring as a stateStates are not unique.

Example 1

M

xInput: fa(t)Outputs :

• Tensile force in spring

• Velocity of mass

• Acceleration of mass

fa(t)K

B

# of states = 2

Velocity of mass v

Elongation of spring x ( other choices are possible)

Example

)(tfvMvBxK

vMfvBfxKf

a

I

B

k

=++

===

&

&

M

x

Kfa(t)

B

[ ])(1

:

tfKxBvM

v

vxEquationsState

a+−−=

=

&

&

)(1

:

3

2

1

tfM

xMKv

MBy

vykxy

EquationOutput

a+−

−−

=

==

Example State Variable Model

[ ])(1 tfKxBvM

v

vx

a+−−=

=

&

&

)(13

2

1

tfM

xMKv

MBy

vykxy

a+−−

=

==

State equations

Output equations

Example 2

M1

x1

M2

x2

K2 fa(t)K1

B

Input: fa(t)

Outputs: Tensile force in spring 2

Total momentum of the masses

Example 2

M1

x1

M2

x2

K2 fa(t)K1

B

# of States = # of energy storing elements =4 ( 2 springs & 2 masses)

One possible choice of states : x1,x2,v1,v2

Elongation of spring 1= x1; Elongation of spring 2= x2-x1

Velocity of mass 1 =v1; Velocity of mass 2 =v2;

Example 2Draw freebody diagrams

M1

2

2

1

1

I

B

k

I

k

fff

ff

)(

2

tf

ff

a

B

k

M2

Example 2Express all forces in terms of states (x1,x2,v1,v2)

222

12

1222

111

111

)()(

vMfvvBf

xxKf

vMfxKf

I

B

k

I

k

&

&

=−=−=

==

M1

M2 )(

)()(

12

1222

tf

vvBfxxKf

a

B

k

−=−=

Example State Variable Model

[ ]

[ ])(1

)(1

2221122

1

22

22211211

1

11

tfBvxKBvxKM

v

vx

BvxKBvxKKM

v

vx

a+−−+=

=

++−+−=

=

&

&

&

&

22112

1221 )(vMvMy

xxKy+=−=

State equations

Output equations

Example 2Alternative choice of states

M1

x1

M2

x2

K2 fa(t)K1

B

# of States = # of energy storing elements =4 ( 2 springs & 2 masses)

Alternative choice One possible choice of states : x1,xr=x2-x1 ,v1,vr=v2-v1

Elongation of spring 1= x1; Elongation of spring 2= xr

Velocity of mass 1 =v1; Velocity of mass 2 =vr+v1;

Example 2Express all forces in terms of states (x1,x2,v1,v2)

)( 222

22

111

111

RI

RB

Rk

I

k

vvMfBvf

xKf

vMfxKf

&&

&

+===

==

M1

M2 )(

22

tf

BvfxKf

a

RB

Rk

==

Example State Variable Model

[ ]

[ ])()()(1

1

12121212121

2111

1

11

tfMvMMBxMMKxMKMM

v

vx

BvxKxKM

v

vx

aRRR

RR

RR

++−+−=

=

++−=

=

&

&

&

&

R

R

vMvMMyxKy

21212

21

)( ++==

State equations

Output equations

Example 2Two possible state variable models for the system

M1

x1

M2

x2

K2 fa(t)K1

B

Two state variable models were obtained for the same system

They are different but they represent the same relationship between inputs and outputs.

Example 3

M

x1

fa(t)

x2

K2K1

B1 B2

Input fa(t)

Output : displacement of the mass-less junction

Example 2Express all forces in terms of states (x1,x2,v1,v2)

M

2222

211

11

1

)(

xKxB

xxKvBvM

+

&

&

)(

)(

211 xxK

tfa

Example State Variable Model

[ ]

[ ]2122112

2

2111111

11

1

)(1

xKxKxKB

x

tfxKvBxKM

v

vx

a

−−=

++−−=

=

&

&

&

21 xy =

State equations

Output equations

State Variable Models States are not unique.The value of states summarize effect of past inputs on the system.Usually the number of states is equal to the number of energy storing elements ( Masses and springs)In some cases we may have redundant states (the number of states is less than the number of energy storing elements)Typical choice of states: velocity of mass and elongation of spring.State variable model:

State equations (set of first order ODE, involves states and inputs)Output equations (algebraic equations , involves states and inputs)

SE207 Modeling and SimulationUnit 4

Lesson 2: Input-Output (I/O) Models

Dr. Samir Al-AmerTerm 072

Read Section 3.2

Outlines Two standard forms for models will be used.

State variable modelInput-output model

States (State Variables) States are not unique.The value of states summarize effect of past inputs on the system.Usually the number of states is equal to the number of energy storing elements ( Masses and springs)In some cases we may have redundant states (the number of states is less than the number of energy storing elements)

State Variable Models Example (1-input,1-output and 2-states)

uqy

ubqqqubqqq

5.0

5.032

1

2212

1211

+=

++=++=

&

&State Equations

Output Equation

u: input, y: output, qi :states ( or state variables)

Input-Output ModelsODE that contains the inputs, the output and their derivatives and no other variables.

)(tfxBKxxM a=++ &&&

Output and its derivatives input

State Variable and Input-output Models

State Variable Model input-output model

M

x Input: fa(t)Output : displacement xK

fa(t)

B

[ ]xy

tfKxBvM

v

vx

a

=

+−−=

=

)(1&

&

)(tfxBKxxM a=++ &&&

Example Input-Output Models

[ ])(1 tfKxBvM

v

vx

a+−−=

=

&

&

xy =1

State variable model

Input-Output Model

)(tfxBKxxM a=++ &&&

Example Input-Output ModelsFor simple problems, you may be able to obtain the I/O model directly by expressing all forces (in the free body diagram) in terms of inputs, outputs and their derivatives.

Input-Output Models

22

1

2121122

2111111

,Eliminate:

)(:

0)()(

xxxoutput

tfinput

xKxKKxBtfxKxKxBxM

a

a

&

&

&&&

=−++=−++

Input-Output Models

( )

( )

( ) ( )aa

a

a

a

fKKfBxKK

xBKBKKBxMKMKBBxMBxandx

tfxKxBxMK

xxatedifferenti

tfxKxBxMK

xxforsolve

xKxKKxBtfxKxKxBxM

)(

modeloutputinputgettosimplifyandsubsitute

)(1

)(1

0)()(

212121

11211121212112

22

111111

22

111111

22

2121122

2111111

++=+

++++++−

−++⎟⎟⎠

⎞⎜⎜⎝

⎛=⇒

−++⎟⎟⎠

⎞⎜⎜⎝

⎛=⇒

=−++=−++

&

&&&&&&

&

&&&&&&&&

&&&

&

&&&

Input-Output Models( ) ( )

aa fKKfBxKK

xBKBKKBxMKMKBBxMB

)( 212121

11211121212112

++=+

++++++&

&&&&&&

ablesother vari no and), ( sderivative its andoutput theand

),,,( sderivative its andinput theinvolvesequation This 1111

aa ff

xxxx&

&&&&&&

Reduction using differentiator operator

( )

aa

a

fxpporfxpxxp

tfxxx

xdtdx

dtxdxpp

xdtdx pandx

dtdpx

=++=++

=++

++++

)532(532

)(532ooperator t p Apply the

42 means42

means means

operatorator differenti :p Define

22111

2

22

2

22

&&&

Reduction using differentiator operator

a

a

fxpxxp

tfxxx

=++

=++

532

)(532

.manipulate easier to arehich operator w p in the equations algebraic into equations aldifferenti

theconvertsoperator ator differenti The

2

111 &&&

Input-Output Models

( ))()(

00)(

)(

:),(:0)(

)(

2111112

112112

2121122

21111112

1

2121122

2111111

tfxKxKpBxMpM

xKxKKpBxKxKKxpB

tfxKxKpxBxMp

xoutputtfinputxKxKKxB

tfxKxKxBxM

a

a

a

a

=−++⇒

=−++⇒=−++=−++

=−++=−++

&

&&&

Input-Output Models

only sderivative their and , containsequation final The, Remove

:),(:0)(

)(

1

22

1

2121122

2111111

xfxx

xoutputtfinputxKxKKxB

tfxKxKxBxM

a

a

a

&

&

&&&

=−++=−++

Input-Output Models

( )( )

( ) ( )( )

( )( )( ) )(

)(

)()(

, eliminate To

112

1111112

112

112112

112

2111211112

112

112

112112

22

tfKKpBxKxKpBxMpKKpBM

xKbyxKKpBreplaceNowtfKKpB

xKKKpBxKpBxMpMKKpB

KKpBbysidesbothmuliplyxKxKKpB

xx

a

a

++=−++++

++++=

++−++++

++=++

&

Input-Output Models

( )( )

aa fKKfB

xKKxBKBKKBxMKMKBBxMB

dtd

)(

simplifyandby operator p Replace

212

1211121112

1212112

++=

+++++++

&

&

&&&&&

State space versus input/output modelsThe order of the I/O model = number of states (unless some states are redundant

or some states have no effect on output)State variable models are more convenient for solution and for modeling MIMO (multi-input-multi-output) systems