17
CDS 101: Lecture 4.1 Linear Systems Richard M. Murray 18 October 2004 Goals: Describe linear system models: properties, examples, and tools Characterize stability and performance of linear systems in terms of eigenvalues Compute linearization of a nonlinear systems around an equilibrium point Reading: Åström and Murray, Analysis and Design of Feedback Systems, Ch 4 Packard, Poola and Horowitz, Dynamic Systems and Feedback, Sections 19, 20, 22 (available via course web page)

CDS 101: Lecture 4.1 Linear Systemsmurray/books/AM08/lectures/L4-1_linsys.pdf · 18 Oct 04 R. M. Murray, Caltech CDS 4 Linear Systems Input/output linearity at x(0) = 0 yLinear systems

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CDS 101: Lecture 4.1 Linear Systemsmurray/books/AM08/lectures/L4-1_linsys.pdf · 18 Oct 04 R. M. Murray, Caltech CDS 4 Linear Systems Input/output linearity at x(0) = 0 yLinear systems

CDS 101: Lecture 4.1Linear Systems

Richard M. Murray18 October 2004

Goals:Describe linear system models: properties, examples, and toolsCharacterize stability and performance of linear systems in terms of eigenvaluesCompute linearization of a nonlinear systems around an equilibrium point

Reading: Åström and Murray, Analysis and Design of Feedback Systems, Ch 4Packard, Poola and Horowitz, Dynamic Systems and Feedback, Sections 19, 20, 22 (available via course web page)

Page 2: CDS 101: Lecture 4.1 Linear Systemsmurray/books/AM08/lectures/L4-1_linsys.pdf · 18 Oct 04 R. M. Murray, Caltech CDS 4 Linear Systems Input/output linearity at x(0) = 0 yLinear systems

18 Oct 04 R. M. Murray, Caltech CDS 2

Lecture 3.1: Stability and Performance

Key topics for this lecture

Stability of equilibrium points

Local versus global behavior

Performance specification via step and frequency response

-2π 0 2π-2

0

2

x1

x2

0 5 10 15 20 250

0.5

1

1.5

0 5 10 15 20

uy

Review from Last Week

Page 3: CDS 101: Lecture 4.1 Linear Systemsmurray/books/AM08/lectures/L4-1_linsys.pdf · 18 Oct 04 R. M. Murray, Caltech CDS 4 Linear Systems Input/output linearity at x(0) = 0 yLinear systems

18 Oct 04 R. M. Murray, Caltech CDS 3

What is a Linear System?

Linearity of functions: Zero at the origin:Addition:Scaling:

Linearity of systems: sums of solutions

: n mf →(0) 0f =

( ) ( ) ( )f x y f x f y+ = +( ) ( )f x f xα α=

( )( ) ( )

f x yf x f y

α βα β+ =

+ ( )f x Ax=

Canonical example:

x Ax=&

x Ax Buy Cx Du= += +

&

⇓10 20

1 2

(0)( ) ( ) ( )

x x xx t x t x tα β

α β= +→ = +

10

1

(0)( ) ( )

x xx t x t

=→ =

20

2

(0)( ) ( )

x xx t x t

=→ =

1

1

(0) 0, ( ) ( )( ) ( )

x u t u ty t y t

= =→ =

2

2

(0) 0, ( ) ( )( ) ( )

x u t u ty t y t

= =→ =

1 2

1 2

(0) 0, ( ) ( ) ( )( ) ( ) ( )

x u t u t u ty t y t y t

α βα β

= = +→ = +

Dynamical system Control system

Page 4: CDS 101: Lecture 4.1 Linear Systemsmurray/books/AM08/lectures/L4-1_linsys.pdf · 18 Oct 04 R. M. Murray, Caltech CDS 4 Linear Systems Input/output linearity at x(0) = 0 yLinear systems

18 Oct 04 R. M. Murray, Caltech CDS 4

Linear Systems

Input/output linearity at x(0) = 0Linear systems are linear in initial condition and input ⇒ need to use x(0) = 0 to add outputs togetherFor different initial conditions, you need to be more careful (sounds like a good midterm question)

Linear system ⇒ step response and frequency response scale with input amplitude

2X input ⇒ 2X outputAllows us to use ratios and percen-tages in step/freq response. These are independent of input amplitudeLimitation: input saturation ⇒ only holds up to certain input amplitude

x Ax Buy Cx Du= += +

&

u1

0 5 10-1

0

1

u y

+ +

0 5 10-2

0

2

y 1 +

y2

(0) 0x =

0 5 10-1

0

1

y1

u2

0 5 10-1

0

1

0 5 10-0.5

0

0.5

y2

0 5 10-2

0

2

u 1 +

u2

Page 5: CDS 101: Lecture 4.1 Linear Systemsmurray/books/AM08/lectures/L4-1_linsys.pdf · 18 Oct 04 R. M. Murray, Caltech CDS 4 Linear Systems Input/output linearity at x(0) = 0 yLinear systems

18 Oct 04 R. M. Murray, Caltech CDS 5

b

k3

m1

m2

q1

u(t)

q2

k2k1

Why are Linear Systems Important?Many important tools

Frequency response, step response, etc

Traditional tools of control theoryDeveloped in 1930’s at Bell Labs; intercontinental telecom

Classical control design toolboxNyquist plots, gain/phase marginLoop shaping

Optimal control and estimatorsLinear quadratic regulators Kalman estimators

Robust control designH∞ control designμ analysis for structured uncertainty

Many important examplesElectronic circuits

Especially true after feedbackFrequency response is key performance specification (think telephones)

Many mechanical systems

Quantum mechanics, Markov chains, …

CDS101/110a

CDS110b

CDS110b/212

Page 6: CDS 101: Lecture 4.1 Linear Systemsmurray/books/AM08/lectures/L4-1_linsys.pdf · 18 Oct 04 R. M. Murray, Caltech CDS 4 Linear Systems Input/output linearity at x(0) = 0 yLinear systems

18 Oct 04 R. M. Murray, Caltech CDS 6

Solutions of Linear Systems: The Matrix Exponential

Scalar linear system, with no input

Matrix version, with no input

Matrix exponentialAnalog to the scalar case; defined by series expansion:

x Ax Buy Cx Du= += +

&( ) ???y t =

0(0)x ax

x xy cx=

==

&0( ) atx t e x= 0( ) aty t ce x=

0(0)x Ax

x xy Cx=

==

&0( ) Atx t e x= 0( ) Aty t Ce x=

2 31 12! 3!

Me I M M M= + + + +L P = expm(M)

initial(A,B,C,D,x0);

Page 7: CDS 101: Lecture 4.1 Linear Systemsmurray/books/AM08/lectures/L4-1_linsys.pdf · 18 Oct 04 R. M. Murray, Caltech CDS 4 Linear Systems Input/output linearity at x(0) = 0 yLinear systems

18 Oct 04 R. M. Murray, Caltech CDS 7

Stability of Linear Systems

Stability is determined by the eigenvalues of the matrix ASimple case: diagonal system

More generally: transform to “Jordan” form

Form of eigenvalues determines system behaviorLinear systems are automatically globally stable or unstable

x Ax Buy Cx Du= += +

&0( ) Atx t e x=

Q: when is the systemasymptotically stable?

0

lim ( ) 0t

x t→∞

=

1 0

0 n

x xλ

λ

⎡ ⎤⎢ ⎥= ⎢ ⎥⎢ ⎥⎣ ⎦

& O ⇒

1

0

0( )

0 n

t

t

ex t x

e

λ

λ

⎡ ⎤⎢ ⎥= ⎢ ⎥⎢ ⎥⎣ ⎦

OStable if λi · 0

Asy stable if λi < 0Unstable if λi > 0

1x T JTx−=&1 0

0 k

JJ

J

⎡ ⎤⎢ ⎥= ⎢ ⎥⎢ ⎥⎣ ⎦

O1 0

10

i

i

i

λ

⎡ ⎤⎢ ⎥= ⎢ ⎥⎢ ⎥⎣ ⎦

OAsy stable if Re(λi) < 0Unstable if Re( λi ) > 0

Indeterminate if Re( λi ) = 0

Page 8: CDS 101: Lecture 4.1 Linear Systemsmurray/books/AM08/lectures/L4-1_linsys.pdf · 18 Oct 04 R. M. Murray, Caltech CDS 4 Linear Systems Input/output linearity at x(0) = 0 yLinear systems

18 Oct 04 R. M. Murray, Caltech CDS 8

Eigenstructure of Linear Systems

-1 -0.5 0 0.5 1-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

x1

x2

-1 -0.5 0 0.5 1-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

x1

x2

-1 -0.5 0 0.5 1-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

x1

x2

-1 -0.5 0 0.5 1-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

x1

x2

Real e-values

Re(λi) < 0Real e-values

Re(λi) < 0

Re(λj) > 0

Complex e-values

Re(λi) = 0

Complex e-values

Re(λi) < 0

Page 9: CDS 101: Lecture 4.1 Linear Systemsmurray/books/AM08/lectures/L4-1_linsys.pdf · 18 Oct 04 R. M. Murray, Caltech CDS 4 Linear Systems Input/output linearity at x(0) = 0 yLinear systems

18 Oct 04 R. M. Murray, Caltech CDS 9

Step and Frequency Response

Effect of eigenstructure on step response

Complex eigenvalues with small real part lead to oscillatory response Frequency of oscillations ≈ ωi

Effects of eigenstructure on frequency response

Eigenvalues determine “break points” for frequency responseComplex eigenvalues lead to peaks in response function near ωi

x Ax Buy Cx Du= += +

&( ) 1( )u t t= ( ) sin( )u t A tω=

Real Axis

Imag

Axis

Pole-zero map

-15 -10 -5 0 5-2

-1

0

1

2

Time (sec.)

Am

plitu

de

Step Response

0 5 10 15 20 25 300

0.05

0.1

0.15

0.2

Frequency (rad/sec)

Phas

e (d

eg);

Mag

nitu

de (d

B)

Bode Diagrams

-100

-50

0

10 -1 10 0 10 1

-200

-100

0

T≈2π/ωpωp

≈ωp

Page 10: CDS 101: Lecture 4.1 Linear Systemsmurray/books/AM08/lectures/L4-1_linsys.pdf · 18 Oct 04 R. M. Murray, Caltech CDS 4 Linear Systems Input/output linearity at x(0) = 0 yLinear systems

18 Oct 04 R. M. Murray, Caltech CDS 10

Computing Frequency Responses

Technique #1: plot input and output, measure relative amplitude and phase

Use MATLAB or SIMULINK to generateresponse of system to sinusoidal outputGain = Ay/AuPhase = 2π · ΔT/TNote: In general, gain and phase willdepend on the input amplitude

Technique #2 (linear systems): use MATLAB bode commandAssumes linear dynamics in statespace form:

Gain plotted on log-log scaledB = 20 log10 (gain)

Phase plotted on linear-log scale

x Ax Buy Cx Du= += +

&

0 5 10 15 20-1.5

-1

-0.5

0

0.5

1

1.5 uyAu

Ay

ΔTT

Frequency (rad/sec)

Phas

e (d

eg)

Mag

nitu

de (d

B)-60-50-40-30-20-10

01020

0.1 1 10-360

-270

-180

-90

0

bode(A,B,C,D)

Page 11: CDS 101: Lecture 4.1 Linear Systemsmurray/books/AM08/lectures/L4-1_linsys.pdf · 18 Oct 04 R. M. Murray, Caltech CDS 4 Linear Systems Input/output linearity at x(0) = 0 yLinear systems

18 Oct 04 R. M. Murray, Caltech CDS 11

Example: Electrical Circuit

Derivation based on Kirchoff’s laws for electrical circuits (Ph 2)Sum of currents at nodes = 0:

Rewrite in terms of new states: vc1=v2, vc2=v3 – v1

2 1 2 2 31

1 2

dv v v v vCdt R R

− −= − 3 1 3 2

22

( )d v v v vCdt R− −

= −

1 2 3

~vi vo

“Bridged Tee Circuit”

R1 R2

C1

C2

1 11 1 2 1 21 1 2

2 22

2 2 2 2

1 1 1 11 1 1

1 1c c

ic c

c

v vC R R C Rd vC R Rv vdt

VC R C R

⎡ ⎤⎛ ⎞ ⎡ ⎤− + − ⎛ ⎞⎢ ⎥⎜ ⎟ +⎡ ⎤ ⎡ ⎤ ⎢ ⎥⎜ ⎟⎝ ⎠⎢ ⎥= + ⎝ ⎠⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎢ ⎥⎣ ⎦ ⎣ ⎦ ⎢ ⎥− −⎢ ⎥ ⎣ ⎦⎢ ⎥⎣ ⎦

[ ] 1

2

0 1 co i

c

vv v

v⎡ ⎤

= +⎢ ⎥⎣ ⎦

Page 12: CDS 101: Lecture 4.1 Linear Systemsmurray/books/AM08/lectures/L4-1_linsys.pdf · 18 Oct 04 R. M. Murray, Caltech CDS 4 Linear Systems Input/output linearity at x(0) = 0 yLinear systems

18 Oct 04 R. M. Murray, Caltech CDS 12

Linear Control Systems and Convolution

Impulse response, h(t) = CeAtBResponse to input “impulse”Equivalent to “Green’s function”

Linearity ⇒ compose response to arbitrary u(t) using convolutionDecompose input into “sum” ofshifted impulse functionsCompute impulse response for each“Sum” impulse response to find y(t)

Complete solution: use integral instead of “sum”

x Ax Buy Cx Du= += +

&( ) (0) ???Aty t Ce x= +

homogeneous

( )

0

( ) (0) ( ) ( )t

At A ty t Ce x Ce Bu d Du tτ

τ

τ τ−

=

= + +∫• linear with respect to initial

condition and input• 2X input ⇒ 2X output when

x(0) = 0

Page 13: CDS 101: Lecture 4.1 Linear Systemsmurray/books/AM08/lectures/L4-1_linsys.pdf · 18 Oct 04 R. M. Murray, Caltech CDS 4 Linear Systems Input/output linearity at x(0) = 0 yLinear systems

18 Oct 04 R. M. Murray, Caltech CDS 13

Matlab Tools for Linear Systems

Other MATLAB commandsgensig, square, sawtooth – produce signals of diff. typesstep, impulse, initial, lsim – time domain analysisbode, freqresp, evalfr – frequency domain analysis

A = [-1 1; 0 -1]; B = [0; 1];

C = [1 0]; D = [0];x0 = [1; 0.5];

sys = ss(A,B,C,D);initial(sys, x0);

impulse(sys);

t = 0:0.1:10;

u = 0.2*sin(5*t) + cos(2*t);lsim(sys, u, t, x0);

( )

0

( ) (0) ( ) ( )t

At A ty t Ce x Ce Bu d Du tτ

τ

τ τ−

=

= + +∫

Ampl

itude

Initial Condition Results

0 1 2 3 4 5 6 70

0.2

0.4

0.6

0.8

1

To: Y

(1)

Time (sec.)

Ampl

itude

Linear Simulation Results

0 1 2 3 4 5 6 7 8 9 10-0.5

0

0.5

1

To: Y

(1)

ltiview – lineartime invariantsystem plots

Page 14: CDS 101: Lecture 4.1 Linear Systemsmurray/books/AM08/lectures/L4-1_linsys.pdf · 18 Oct 04 R. M. Murray, Caltech CDS 4 Linear Systems Input/output linearity at x(0) = 0 yLinear systems

18 Oct 04 R. M. Murray, Caltech CDS 14

Linearization Around an Equilibrium Point

RemarksIn examples, this is often equivalent to small angle approximations, etcOnly works near to equili-brium point

( , )( , )

x f x uy h x u==

& z Az Bvw Cz Dv= += +

&

-2π 0 2π-2

0

2

x1

x2

Full nonlinear model

-0.3 -0.2 -0.1 0 0.1 0.2 0.3-0.4

-0.3

-0.2

-0.1

0

0.1

0.2

0.3

0.4

x1

x2

Linear model (honest!)

“Linearize” around x=xe

( , ) ( , )

( , ) ( , )

e e e e

e e e e

x u x u

x u x u

f fA Bx u

h hC Dx u

∂ ∂= =∂ ∂

∂ ∂= =∂ ∂

( , ) 0 ( , )e e e e e

e e e

f x u y h x uz x x v u u w y y

= == − = − = −

-0.3 -0.2 -0.1 0 0.1 0.2 0.3-0.4

-0.3

-0.2

-0.1

0

0.1

0.2

0.3

0.4

x1

x2

Page 15: CDS 101: Lecture 4.1 Linear Systemsmurray/books/AM08/lectures/L4-1_linsys.pdf · 18 Oct 04 R. M. Murray, Caltech CDS 4 Linear Systems Input/output linearity at x(0) = 0 yLinear systems

18 Oct 04 R. M. Murray, Caltech CDS 15

Local Stability of Nonlinear Systems

Asymptotic stability of the linearization implies local asymptotic stability of equilibrium point

Linearization around equilibrium point captures “tangent” dynamics

If linearization is unstable, can conclude that nonlinear system is locally unstableIf linearization is stable but not asymptotically stable, can’t conclude anything about nonlinear system:

Local approximation particularly appropriate for control systems designControl often used to ensure system stays near desired equilibrium pointIf dynamics are well-approximated by linearization near equilibrium point, can use this to design the controller that keeps you there (!)

( ) ( ( )) eex f x A x x o x x= = ⋅ − −+& higher order terms

3x x= ±& 0x =& • linearization is stable (but not asy stable)• nonlinear system can be asy stable or unstable

linearize

Page 16: CDS 101: Lecture 4.1 Linear Systemsmurray/books/AM08/lectures/L4-1_linsys.pdf · 18 Oct 04 R. M. Murray, Caltech CDS 4 Linear Systems Input/output linearity at x(0) = 0 yLinear systems

18 Oct 04 R. M. Murray, Caltech CDS 16

Example: Inverted Pendulum on a Cart

State:Input: u = FOutput: y = xLinearize according to previous formula around θ = πf

x

θ

m

M

, , ,x xθ θ&&

Page 17: CDS 101: Lecture 4.1 Linear Systemsmurray/books/AM08/lectures/L4-1_linsys.pdf · 18 Oct 04 R. M. Murray, Caltech CDS 4 Linear Systems Input/output linearity at x(0) = 0 yLinear systems

18 Oct 04 R. M. Murray, Caltech CDS 17

Summary: Linear Systems

Properties of linear systemsLinearity with respect to initial condition and inputsStability characterized by eigenvaluesMany applications and tools availableProvide local description for nonlinear systems

x Ax Buy Cx Du= += +

&u y

(0) 0x =

0 5 10-1

0

1

0 5 10-1

0

1

0 5 10-2

0

2

0 5 10-1

0

1

0 5 10-0.5

0

0.5

0 5 10-2

0

2

++

( )

0

( ) (0) ( ) ( )t

At A ty t Ce x Ce Bu d Du tτ

τ

τ τ−

=

= + +∫