Control of Nonlinear Dynamic Systems

54 downloads 0 Views 5MB Size Report
Dec 23, 2015 - 1.2.2 Definitions of Linear and Nonlinear Systems . ...... Phase plane analysis (covered in Chapter 2) is a graphical method for second order systems. ...... In the sequel, we denote by xT the transpose of vector x, that is, x =.
Control of Nonlinear Dynamic Systems J. Karl Hedrick Department of Mechanical Engineering The University of California at Berkeley Anouck Girard Department of Aerospace Engineering The University of Michigan at Ann Arbor *** DRAFT *** Copyright 2015, J.K. Hedrick and A. Girard December 23, 2015

ii

© 2015, J.K. Hedrick and A. Girard

Contents 1 Introduction 1.1 Linear Analysis of Physical Systems . . . . . . . . . . 1.1.1 Equilibrium Finding . . . . . . . . . . . . . . 1.1.2 Linearization . . . . . . . . . . . . . . . . . . 1.2 General Properties of Linear and Nonlinear Systems . 1.2.1 Sources of Nonlinearity . . . . . . . . . . . . . 1.2.2 Definitions of Linear and Nonlinear Systems . 1.2.3 Reminders on Linear Time Invariant Systems 1.2.4 Properties of Nonlinear Systems . . . . . . . . 1.2.5 Classification of Nonlinearities . . . . . . . . .

I

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

Analysis Techniques for Nonlinear Systems

2 Phase Plane Analysis 2.1 Phase Plane Analysis . . . . . . . . . 2.2 Lyapunov’s First Method . . . . . . . 2.3 Simplified Satellite Control Problem . 2.4 Introduction to Sliding Mode Control 2.5 Rotational Position Control of Servo 2.6 Further Reading . . . . . . . . . . . . 2.7 Homework Problems . . . . . . . . . 3 The Center Manifold Theorem 3.1 Bifurcations and Catastrophes 3.2 Flows and Invariant Subspaces 3.2.1 Linear Systems . . . . 3.2.2 Nonlinear Systems . . 3.3 Further Reading . . . . . . . . 3.4 Homework Problems . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . . iii

. . . . . . .

. . . . . .

. . . . . . .

. . . . . .

. . . . . . .

. . . . . .

. . . . . . .

. . . . . .

. . . . . . .

. . . . . .

. . . . . . .

. . . . . .

. . . . . . .

. . . . . .

. . . . . . .

. . . . . .

. . . . . . .

. . . . . .

. . . . . . .

. . . . . .

1 2 2 6 7 9 9 10 11 16

19 . . . . . . .

. . . . . .

. . . . . . .

. . . . . .

. . . . . . .

. . . . . .

. . . . . . .

. . . . . .

. . . . . . .

. . . . . .

. . . . . . .

. . . . . .

. . . . . . .

. . . . . .

. . . . . . .

. . . . . .

. . . . . . .

. . . . . .

. . . . . . .

. . . . . .

. . . . . . .

. . . . . .

. . . . . . .

23 23 25 28 34 40 44 44

. . . . . .

51 51 54 54 55 57 57

4 Controllability and Observability 4.1 Observability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1.1 Motivation and Review of Observability for Linear Systems . 4.1.2 Lie Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . 4.1.3 Observability for Nonlinear Systems . . . . . . . . . . . . . . 4.2 Controllability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.1 Motivation and Review of Controllability for Linear Systems 4.2.2 Lie Brackets . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.3 Controllability for Nonlinear Systems . . . . . . . . . . . . . 4.3 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4 Homework Problems . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Stability 5.1 Lyapunov Theory . . . . . . . . . . . . . . . . . . . . . . . 5.1.1 Fundamentals and Definitions . . . . . . . . . . . . 5.1.2 The Second Method of Lyapunov . . . . . . . . . . 5.2 LaSalle’s Invariance Theorem, Invariant Sets, and Domains 5.2.1 LaSalle’s Invariance Principle . . . . . . . . . . . . 5.2.2 Invariant Sets . . . . . . . . . . . . . . . . . . . . . 5.2.3 Domains of Atraction . . . . . . . . . . . . . . . . . 5.3 Stability for Time-Varying Systems . . . . . . . . . . . . . 5.4 Lyapunov Stability in Pictures . . . . . . . . . . . . . . . . 5.5 Frequency Domain Stability Criteria . . . . . . . . . . . . 5.6 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . 5.7 Homework Problems . . . . . . . . . . . . . . . . . . . . .

II

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . of Attraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . .

61 61 61 63 64 67 67 67 69 74 74

. . . . . . . . . . . .

77 77 77 78 84 84 85 86 96 102 102 102 105

Nonlinear Control Techniques

111

6 Feedback Linearization 6.1 Single-Input, Single-Output Systems . . . . . . . . . 6.1.1 Input-Output Linearization . . . . . . . . . . 6.1.2 Input/State Linearization (SISO Systems) . . 6.2 Feedback Linearization for MIMO Nonlinear Systems 6.2.1 Internal Dynamics . . . . . . . . . . . . . . . 6.2.2 Dynamic Extension . . . . . . . . . . . . . . . 6.3 Feedback Linearization: A Review . . . . . . . . . . . 6.3.1 Input/Output Feedback Linearization . . . . . 6.3.2 Input/State Feedback Linearization . . . . . . 6.4 Further Reading . . . . . . . . . . . . . . . . . . . . . 6.5 Homework Problems . . . . . . . . . . . . . . . . . . iv

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

117 117 117 124 130 132 134 136 136 138 141 142

© 2015, J.K. Hedrick and A. Girard

7 Sliding Mode Control 7.1 Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . 7.1.1 Second-Order System Example . . . . . . . . . . 7.1.2 Basic Concepts . . . . . . . . . . . . . . . . . . . 7.1.3 Systems in Canonical Form . . . . . . . . . . . . 7.1.4 Smoothing . . . . . . . . . . . . . . . . . . . . . . 7.1.5 General Nonlinear Systems not in Canonical Form 7.2 Adaptive Sliding Mode Control . . . . . . . . . . . . . . 7.2.1 Adaptive SMC: An Example . . . . . . . . . . . . 7.2.2 General Adaptive SMC SISO Formulation . . . . 7.3 MIMO Sliding Mode Control . . . . . . . . . . . . . . . . 7.3.1 Special Case ( Inspired by Robotics) . . . . . . . 7.3.2 General MIMO Nonlinear Control . . . . . . . . . 7.4 Discrete Time Sliding Mode Control . . . . . . . . . . . . 7.5 Further Reading . . . . . . . . . . . . . . . . . . . . . . . 7.6 Homework Problems . . . . . . . . . . . . . . . . . . . . 8 Observer Design 8.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . 8.2 Review of Linear Observers . . . . . . . . . . . . . 8.2.1 Deterministic (Luenberger) Observer . . . . 8.2.2 Stochastic (Kalman-Bucy) Filter) . . . . . . 8.3 Nonlinear Observer Classification . . . . . . . . . . 8.4 Deterministic, Lyapunov-Based Nonlinear Observers 8.4.1 Lipschitz Continuity . . . . . . . . . . . . . 8.4.2 Thau’s Method . . . . . . . . . . . . . . . . 8.4.3 Alternative Approach: Ragahvan’s Method . 8.5 Exact Linearization and Geometric Observers . . . 8.5.1 Systems with no Control Input . . . . . . . 8.6 Sliding Observers . . . . . . . . . . . . . . . . . . . 8.7 Nonlinear Compensators . . . . . . . . . . . . . . . 8.8 Further Reading . . . . . . . . . . . . . . . . . . . . 8.9 Homework Problems . . . . . . . . . . . . . . . . .

III

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

153 153 153 158 163 166 178 179 179 183 187 187 190 206 211 211

. . . . . . . . . . . . . . .

217 217 219 219 219 220 221 221 222 226 230 230 231 236 238 238

Appendix

A Mathematical Preliminaries A.1 Sets . . . . . . . . . . . . . . . A.2 Metric Spaces . . . . . . . . . . A.3 Vector Spaces . . . . . . . . . . A.3.1 Linear Independence and A.3.2 Subspaces . . . . . . . .

245 . . . . . . . . . . . . Basis . . . . v

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

247 247 247 248 250 251

© 2015, J.K. Hedrick and A. Girard

A.3.3 Normed Vector Spaces . . . . . . A.4 Matrices . . . . . . . . . . . . . . . . . . A.5 Basic Topology . . . . . . . . . . . . . . A.5.1 Basic Topology in a Metric Space A.5.2 Basic Topology in Rn . . . . . . . A.6 Sequences . . . . . . . . . . . . . . . . . A.7 Functions . . . . . . . . . . . . . . . . . A.8 Differentiability . . . . . . . . . . . . . . A.8.1 Useful Theorems . . . . . . . . . A.9 Lipschitz Continuity . . . . . . . . . . . A.10 Contraction Mapping . . . . . . . . . . . A.11 Solution of Differential Equations . . . . A.12 References and Further Reading . . . . . Bibliography

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

252 254 258 258 259 260 261 264 266 267 269 271 275 277

vi

© 2015, J.K. Hedrick and A. Girard

Chapter 1 Introduction Few physical systems are truly linear. The most common method to analyze and design controllers for a system is to start with linearizing the system about some point, which yields a linear model, and then to use linear control techniques. However, there are systems for which the nonlinearities are important and cannot be ignored. For these systems, nonlinear analysis and design techniques exist and can be used. These techniques are the focus of this book. We concern ourselves with systems that can be written in the following general form, where x is the state of the system, u is the control input, w is a disturbance, and f is a nonlinear function:

x˙ = f (t, x, u, w),

(1.1)

with x ∈ Rn , u ∈ Rm , w ∈ Rp and t ∈ R is time. We are considering dynamical systems that are modeled by a finite number of coupled, first-order differential equations. The notation above is a vector notation, and allows us to represent the system in a compact form. In many cases, the disturbance is not considered explicitly in the system analysis, that is, we consider the system described by the equation

x˙ = f (t, x, u).

(1.2)

In some cases we look at the properties of the system when f does not depend explicitly on u, that is,

x˙ = f (t, x).

(1.3)

This is called the unforced response of the system. This does not necessarily mean that the input to the system is zero. It could be that the input has been specified as a function of time, u = u(t), or as a given feedback function of the state, u = u(x), or as a function of 1

both. When f does not explicitly depend on t, that is, if x˙ = f (x), the system is said to be autonomous or time invariant. An autonomous system is invariant to shifts in the time origin. We call x the vector of state variables of the system. The state variables represent the minimum amount of information that needs to be retained at any time t in order to determine the future behavior of a system. Although the number of state variables is unique (that is, it has to be the minimum and necessary number of variables), for a given system, the choice of state variables is not.

1.1

Linear Analysis of Physical Systems

The linear analysis approach starts with considering the general nonlinear form for a dynamic system, and seeking to transform this system into a linear system for the purposes of analysis and controller design. This transformation is called linearization and is possible at a selected operating point of the system. Equilibrium points are an important class of solutions of a differential equation. They are defined as the points x0 such that

x˙ 0 = 0.

(1.4)

A good place to start the study of a nonlinear system is by finding its equilibrium points. This in itself might be a formidable task. A nonlinear system may have more than one equilibrium point. Linearization is performed about an equilibrium point of the system. This allow one to characterize the behavior of the solutions in the neighborhood of the equilibrium point.

1.1.1

Equilibrium Finding

We consider systems that can be written in the following general form, where x ∈ Rn is the state of the system, u ∈ Rm is the control input, and f : Rn × Rm → Rn is a nonlinear function,

x˙ = f (x, u).

(1.5)

Let u = ue be constant. At an equilibrium point,

f (xe , ue ) = 0.

(1.6)

To obtain the equilibrium points, one has to solve n algebraic equations in n unknowns. 2

© 2015, J.K. Hedrick and A. Girard

The Global Implicit Function Theorem The global implicit function theorem provides conditions for uniqueness of an equilibrium point. Theorem 1.1 (Global Implicit Function Theorem) Consider the system described by

x˙ = f (xe , ue ).

(1.7)

∂f . J(x) = ∂x e

(1.8)

Let the Jacobian of f be defined as

Then, the solution xe of f (xe , ue ) = 0 is unique for a fixed ue if: 1. For all x, det(J(x)) 6= 0, 2. ||f (x, ue )|| → ∞ as ||x|| → ∞. Remark 1.1 Note that in general these conditions are difficult to evaluate, particularly the first. Note that the conditions in the theorem can be checked against linear systems for intuition. This is a common approach in nonlinear systems theory that we use throughout the book. Let x˙ = Ax. Is xe = 0 unique? In this case, J = A, and assuming det A 6= 0, the second condition is automatically true since f = Ax. Numerical Methods for Equilibrium Finding We seek numerical solutions to f (xe ) = 0, assuming a fixed ue . There are many methods available, including, but not limited to, 1. Random search methods, 2. Methods that require analytical gradients (often the best), 3. Methods that compute numerical gradients (often the easiest). Two popular ways of computing numerical gradients are the method of Newton-Raphson, and the steepest descent method. Usually both methods are used in combination. 3

© 2015, J.K. Hedrick and A. Girard

Newton’s Method This is also sometimes known as the method of Newton-Raphson. We want to find solutions to the equation f (xe ) = 0. We have a value xi at the ith iteration, and an error, ei , such that ei = f (xi ). We want an iterative algorithm such that xi+1 = xi + ∆xi .

(1.9)

Expand f (xi+1 ) in a first-order Taylor series expansion, so that ∂f ∆xi , f (xi+1 ) ≈ f (xi ) + ∂x xi = f (xi ) + J(xi )∆xi .

(1.10) (1.11)

Let us ask for (not necessarily get):

f (xi+1 ) = αf (xi ) = αei , 0 < α < 1.

(1.12)

αei = ei + J(xi )∆xi ,

(1.13)

Then,

that is, we get the expression of for the Newton-Raphson iteration, ∆xi = J −1 (xi )(α − 1)ei .

(1.14)

Note that one needs to evaluate (easy) and invert (possibly hard) the Jacobian. Newton’s method has good convergence properties near xe , but can cause large initial errors. Steepest Descent Techniques Steepest descent techniques are sometimes also referred to as “hill climbing.” They work by defining a scalar function of the error, then choosing ∆xi to guarantee a reduction in this scalar at each step. Let L = eT e = f T f,

(1.15)

which is a guaranteed positive scalar. We attempt to minimize L. We start by expanding L in a first-order Taylor series expansion, 4

© 2015, J.K. Hedrick and A. Girard

∂L L(i + 1) ≈ L(i) + ∆xi , ∂x xi

(1.16)

∂f ∂L ∂f T f = = 2f T . ∂x ∂x ∂x

(1.17)

and

We want to impose the condition L(i + 1) < L(i). This implies

 ∆xi = −β

∂L ∂x

T , β > 0,

(1.18)

where β is a scalar. This implies

 L(i + 1) ≈ L(i) − β

∂L ∂x



∂L ∂x

T , β > 0,

(1.19)

and

xi+1 = xi + ∆xi .

(1.20)

Hence, the steepest descent iteration is given by

∆xi = −2βJ T (xi )f (xi ).

(1.21)

Steepest descent methods require one to evaluate J but not invert it (good). In general they have good starting but poor convergence properties. Combined Newton and Steepest Descent Techniques Usually, Newton’s method and steepest descent techniques are combined as

  ∆xi = ρ1 ∆x1,N + ρ2 ∆xi,SD = ρ1 J −1 (xi )(α − 1)ei + ρ2 −2βJ T (xi )f (xi ) ,

(1.22)

where ρ1 and ρ2 are variable weights. 5

© 2015, J.K. Hedrick and A. Girard

1.1.2

Linearization

If we write x, u and w as a constant term, followed by a perturbation, in the following form: x = x0 + δx, u = u0 + δu, w = w0 + δw.

(1.23) (1.24) (1.25)

We first seek equilibrium points that satisfy the following property f (x0 , u0 , w0 ) = 0.

(1.26)

We then perform a multivariable Taylor series expansion about one of the equilibrium points (x0 , u0 , w0 ). Without loss of generality, assume the coordinates are transformed so that x0 = 0. “HOT” designates Higher Order Terms. Then, ∂f ∂f ∂f x˙ 0 + δ x˙ = f (x0 , u0 , w0 ) + δx + δu + δw + HOT. ∂x 0 ∂u 0 ∂w 0

(1.27)

At equilibrium, x˙ 0 = f (x0 , u0 , w0 ) = 0,

(1.28)

∂f ∂f ∂f δ x˙ = δx + δu + δw + HOT. ∂x 0 ∂u 0 ∂w 0

(1.29)

∂f ∂f ∂f , B= , Γ= , A= ∂x 0 ∂u 0 ∂w 0

(1.30)

so that

We can set

where A is of dimension n × n, B is n × m, and Γ is n × p. We obtain a linear model for the system about the equilibrium point (x0 , u0 , w0 ) by neglecting the higher order terms: δ x˙ ≈ Aδx + Bδu + Γδw.

(1.31)

Now many powerful techniques exist for controller design, such as optimal linear state space control design techniques, H∞ control design techniques, etc. These produce a feedback law of the form 6

© 2015, J.K. Hedrick and A. Girard

δu = −Gδx,

(1.32)

u = u0 − G(x − x0 ).

(1.33)

so that

Evaluation and simulation is performed in the sequence shown in Figure 1.1.

Figure 1.1: Linearized system design framework.

Assume that the simulation did not yield the expected results. Then the higher order terms that were neglected must have been significant. Two types of problems may have arisen. First, the existence of a Taylor series is not guaranteed. The function (and the nonlinearities of the system) must be smooth and free of discontinuities. Hard (non-smooth or discontinuous) nonlinearities, for example the functions shown in Figure 1.2, may be caused by friction, gears etc. Second, some systems have smooth nonlinearities but wide operating ranges, for example as shown in Figure 1.3. Yet linearizations are only valid in a neighborhood of the equilibrium point. A common example of this sort of system is engine maps. The nonlinear design framework is summarized in Figure 1.4.

1.2

General Properties of Linear and Nonlinear Systems

In this section, we consider general properties of linear and nonlinear systems. We consider the existence and uniqueness of equilibrium points, the stability of equilibrium points, and the properties of the forced response. We also present a broad classification of nonlinearities. 7

© 2015, J.K. Hedrick and A. Girard

Figure 1.2: Examples of “hard” nonlinearities.

Figure 1.3: Smooth nonlinearity over a wide operating range. Which slope should be chosen for the linearization?.

8

© 2015, J.K. Hedrick and A. Girard

Figure 1.4: Nonlinear system design framework.

1.2.1

Sources of Nonlinearity

Before we start a discussion of general properties of linear and nonlinear systems, let us briefly consider standard sources of nonlinearities. Many physical quantities, such as a vehicle’s velocity, or electrical signals, have an upper bound. When that upper bound is reached, linearity is lost. The differential equations governing some systems, such as some thermal, fluidic, or biological systems, are nonlinear in nature. It is therefore advantageous to consider the nonlinearities directly while analyzing and designing controllers for such systems. Mechanical systems may be designed with backlash – this is so that a very small signal produces no output (for example, in gearboxes). In addition, many mechanical systems are subject to nonlinear friction. Relays, which are a part of many practical control systems, are inherently nonlinear. Finally, ferromagnetic cores in electrical machines and transformers are often described with nonlinear magnetization curves and equations.

1.2.2

Definitions of Linear and Nonlinear Systems

Linear systems must verify two properties, superposition and homogeneity. The principle of superposition states that for two different inputs, x and y, in the domain of the function f , f (x + y) = f (x) + f (y). 9

(1.34)

© 2015, J.K. Hedrick and A. Girard

The property of homogeneity states that for a given input, x, in the domain of the function f , and for any real number k,

f (kx) = kf (x).

(1.35)

Any function that does not satisfy superposition and homogeneity is nonlinear. A system

x˙ = f (x)

(1.36)

is nonlinear if the function f is nonlinear. It is worth noting that there is no unifying characteristic of nonlinear systems, except for failure to satisfy the two above-mentioned properties.

1.2.3

Reminders on Linear Time Invariant Systems

Linear Time Invariant (LTI) systems are commonly described by the equation

x˙ = Ax + Bu.

(1.37)

Here, x is the vector of n state variables, u is the control input, A is a matrix of size n × n, and B is a matrix of appropriate dimensions. The equation determines the dynamics of the response. It is sometimes called a state-space realization of the system. We assume that the reader is familiar with basic concepts of system analysis and controller design for LTI systems. Equilibrium Points An important notion when considering system dynamics is that of an equilibrium point. Equilibrium points are considered for autonomous systems (no control input). Definition 1.1 A point x0 in the state space is an equilibrium point of the autonomous system x˙ = Ax if when the state x reaches x0 , it stays at x0 for all future times. For an LTI system, the equilibrium point(s) are the solutions of

Ax0 = 0.

(1.38)

If A has rank n, then x0 = 0. Otherwise, the solution lies in the null space of A. 10

© 2015, J.K. Hedrick and A. Girard

Stability Consider the unforced response of an LTI system, that is, consider the governing equation x˙ = Ax.

(1.39)

Assuming A has rank n, the equilibrium point x0 = 0 of the system is stable (in the sense of Lyapunov) if and only if for all i in [1, n], Re(λi ) < 0, where the λi are the eigenvalues of A. Note that the above statement is not formal; there are many kinds of stability (for example, bounded input, bounded output) and many kinds of tests. Forced Response

Figure 1.5: Input-output system representation as a block diagram.

The analysis of forced response for linear systems is based on the principle of superposition and the application of convolution. It is an input-output description, as shown in Figure 1.5; hence the system is described by x˙ = Ax + Bu.

(1.40)

For example, consider the sinusoidal response of LTIS, that is, the response of an LTIS to a sinusoidal input. The output of the LTIS will also be a sinusoid. However, the output sinusoid’s amplitude is different than that of the input and the signal also exhibits a phase shift. The Bode plot is a graphical representation of these changes, an example of which is shown in Figure 1.6. For LTIS, the sinusoidal response is unique and single-valued. As another example, consider the stochastic response of LTIS. If the input into the system is a Gaussian, then the output is also a Gaussian. This is a useful result.

1.2.4

Properties of Nonlinear Systems

Equilibrium Points Reminder: A point x0 in the state space is an equilibrium point of the autonomous system x˙ = f (x) if when the state x reaches x0 , it stays at x0 for all future time. That is, for a nonlinear system, the equilibrium points are the solutions of the equation: f (xe ) = 0. 11

(1.41) © 2015, J.K. Hedrick and A. Girard

Figure 1.6: Example of a Bode plot. The horizontal axis is frequency, ω. The vertical axis of the top plot represents the magnitude of |y/u| (in dB, that is, 20 log of), and the lower plot represents the phase shift.

12

© 2015, J.K. Hedrick and A. Girard

One has to solve n nonlinear algebraic equations in n unknowns. There might be between 0 and infinity solutions. Example 1.1 (Pendulum) Consider the pendulum shown in Figure 1.7, whose dynamics are described by mL2 θ¨ + k θ˙ + mgL sin θ = 0.

(1.42)

Figure 1.7: Pendulum.

If we plot the angular position against the angular speed, we obtain a phase-plane plot, as shown in Figure 1.8, and as is described in more details in Chapter 2.

Figure 1.8: Phase plane plot for pendulum.

Example 1.2 (Mass with Coulomb Friction) Consider the mass with Coulomb friction shown in Figure 1.9, whose dynamics are described by 13

© 2015, J.K. Hedrick and A. Girard

m¨ x + bx˙ + kx = −F0 sgn(x), ˙

(1.43)

where the behavior of the function sgn(x) ˙ is shown in Figure 1.9. A phase portrait showing the finite equilibrium zone is shown in Figure 1.9,

Figure 1.9: Mass with Coulomb Friction.

Stability One must take special care to define what is meant by stability. For nonlinear systems, stability is considered about an equilibrium point, in the sense of Lyapunov or in an inputoutput sense. Initial conditions can affect stability (this is different than for linear systems), and so can external inputs. Finally, it is possible to have limit cycles. A limit cycle is a unique, self-excited oscillation. It is also an isolated closed trajectory in the state-space. In general, a limit cycle is an unwanted feature in a mechanical system, as it causes fatigue. Note that in other application domains, for example in communications, a limit cycle might be a desirable feature. Example 1.3 (Limit cycle) Consider the system described by the block diagram in Figure 1.10. The phase portrait corresponding to the system shown in Figure 1.10 is shown in Figure 1.11. Note that a limit cycle is different from a linear oscillation, as shown in Figure 1.12. For a LTIS, if you perturb the initial conditions slightly, the orbit changes. This is different than for limit cycles, as shown in Figure 1.13. The limit cycle is a stability boundary. Stability depends on the initial conditions. The limit cycle is an equilibrium trajectory. 14

© 2015, J.K. Hedrick and A. Girard

Figure 1.10: Block diagram for system exhibiting limit cycle behavior.

Figure 1.11: Limit cycle behavior.

Figure 1.12: Oscillations of linear system.

Figure 1.13: Limit cycle as a stability boundary.

15

© 2015, J.K. Hedrick and A. Girard

Forced Response For nonlinear systems, the principle of superposition does not hold in general. For example, for initial conditions x0 , the system may be stable, but for initial conditions 2x0 , the system could be unstable. Typical forced response behavior is shown in Figure 1.14. Given a sinusoidal input, the output is generally formed of a sinusoidal output with different magnitude and phase, as in the linear system case, combined with higher harmonics. Sometimes the higher harmonics are negligible, and sometimes not. Furthermore, the ratio of output to input magnitude is not unique, unlike in the linear systems case. Furthermore, it may not be single valued, that is, there may be jump phenomena, as shown in Figure 1.15.

Figure 1.14: Typical sinusoidal response of a nonlinear system.

1.2.5

Classification of Nonlinearities

The simplest nonlinearities are single-valued, time invariant, as shown in Figure 1.16. “Memory” or hysteresis nonlinearities, as shown for example in Figure 1.17, have memory. In general, a nonlinearity with memory may be caused by not having included all the state information in our functional representation. In the example of Figure 1.17, the force depends on the direction that we are moving in. A final distinction has to do with single-input versus multiple input nonlinearities, as shown in Figure 1.18. At this point, the reader is encouraged to review the mathematical preliminaries. 16

© 2015, J.K. Hedrick and A. Girard

Figure 1.15: Jump phenomenon.

Figure 1.16: Examples of single-valued, time-invariant nonlinearities.

Figure 1.17: Example of a system with hysteresis.

17

© 2015, J.K. Hedrick and A. Girard

Figure 1.18: Single input versus multiple input nonlinearities.

18

© 2015, J.K. Hedrick and A. Girard

Part I Analysis Techniques for Nonlinear Systems

19

In this first section of the manuscript, we consider analysis techniques for nonlinear systems. Theoretical analysis is usually the cheapest way to explore a nonlinear system’s characteristics. Simulation is important for nonlinear systems, of course, but it should be guided by theory. Blind simulation may produce misleading results, especially given the rich behaviors of nonlinear systems, which may depend on initial conditions and inputs. The design of nonlinear controllers is usually based on analysis techniques. Analysis methods allow one to assess the performance of nonlinear controllers, and may suggest directions for modifications if necessary. Note that there are no universal techniques for analysis of any and all nonlinear systems. In the time domain, direct solution of nonlinear ordinary differential equations is often impossible. In the frequency domain, transformations used for linear systems do not apply in general. Methods used for nonlinear system analysis are broadly in four categories: phase plane analysis, the center manifold theorem, controllability and observability assessment, and Lyapunov theory (stability). We consider these in turn in the following chapters. Phase plane analysis (covered in Chapter 2) is a graphical method for second order systems. It studies the system trajectories in a two dimensional plane, the phase plane, and allows one to visually (qualitatively) observe the motion patterns of the system. It is applicable to all nonlinearities. The center manifold theorem (covered in Chapter 3) ... Controllability and observability (covered in Chapter 4) ... Lyapunov theory (covered in Chapter 5) is comprised of two distinct families of methods. The indirect method starts with linearizing the nonlinear system about an equilibrium point. Under technical conditions, the stability properties of the nonlinear system in the vicinity of the equilibrium point are the same as that of the linearization. This provides a theoretical justification for the widespread use of linear system theory. The direct method of Lyapunov is a powerful tool that relies on a generalization of the concept of energy. The motion of a mechanical system is stable if the total mechanical energy decreases for all times. Hence, we aim to construct a scalar, energy like function (a Lyapunov function), and check whether it decreases for all times. This is a very general method, but it can be difficult to find a Lyapunov function. If one succeeds, however, this method can be used for controller design.

21

22

© 2015, J.K. Hedrick and A. Girard

Chapter 2 Phase Plane Analysis 2.1

Phase Plane Analysis

Phase plane analysis is a technique that gives physical insight into the qualitative behavior of second-order systems by representing solution trajectories as curves in the plane. Consider the second-order system described by

x˙ 1 = p(x1 , x2 ), x˙ 2 = q(x1 , x2 ),

(2.1) (2.2)

where x1 and x2 are states of the system, and p and q are nonlinear functions of the states. The phase plane is a plane that admits x1 and x2 as coordinates, and by doing so “eliminates” time. We then consider the behavior of dx2 q(x1 , x2 ) . = dx1 p(x1 , x2 )

(2.3)

We look for equilibrium points (sometimes called singular points) of the system, that is, points at which

p(x1e , x2e ) = 0, q(x1e , x2e ) = 0.

(2.4) (2.5)

Example 2.1 Find the equilibrium point(s) of the system described by x¨ = (x − a)2 + x˙ 3 . We start by putting the system in the standard form by setting x1 = x, x2 = x: ˙ 23

(2.6)

x˙ 1 = x2 , x˙ 2 = (x1 − a)2 + x32 .

(2.7) (2.8)

Looking at the slope of the phase plane trajectory yields dx2 (x1 − a)2 + x32 = . dx1 x2

(2.9)

This yields the equilibrium point

x1e = a, x2e = 0.

(2.10) (2.11)

We then investigate the linear behavior about an equilibrium (singular) point by setting

x1 = x1e + δx1 , x2 = x2e + δx2 .

(2.12) (2.13)

Hence,

δ x˙ 1 δ x˙ 2

∂p = δx1 + ∂x1 e ∂q δx1 + = ∂x1 e

∂p δx2 , ∂x2 e ∂q δx2 . ∂x2 e

(2.14) (2.15)

We then set ∂p ∂p ∂q ∂q a= , b= , c= , d= . ∂x1 e ∂x2 e ∂x1 e ∂x2 e

(2.16)

Therefore,

δ x˙ 1 = aδx1 + bδx2 , δ x˙ 2 = cδx1 + dδx2 .

(2.17) (2.18)

This is the general form of a second-order linear system. Next, we obtain the characteristic equation 24

© 2015, J.K. Hedrick and A. Girard

(λ − a)(λ − d) − bc = 0,

(2.19)

which admits the roots

λ1,2

p (a + d)2 − 4(ad − bc) =a+d± . 2

(2.20)

This yields the six possible cases shown in Table 2.1. λ1 , λ1 , λ1 , λ1 , λ1 , λ1 ,

λ2 λ2 λ2 λ2 λ2 λ2

real and negative real and positive real and opposite signs complex with negative real parts complex with positive real parts complex with zero real parts

stable node unstable node saddle point stable focus unstable focus center

Table 2.1: Possible cases for phase plane analysis.

Example 2.2 (Stable Node) The behavior of a stable node is illustrated in Figure 2.1. Trajectories typically start along the fast eigenvector, then come in along the slow one. Note that trajectories cannot cross eigenvectors – eigenvectors are a solution to the differential equation, so when one reaches an eigenvector, one can only “come in” on it asymptotically. Example 2.3 (Saddle Point) The behavior of a saddle point is illustrated in Figure 2.2. Saddle points are unstable. Example 2.4 (Stable Focus) The behavior of a stable focus is illustrated in Figure 2.3. Example 2.5 (Center) The behavior of a center is illustrated in Figure 2.4.

2.2

Lyapunov’s First Method

We now consider the limits of validity of local stability analysis. This result deals with stability of a nonlinear system about an equilibrium point and is due to Lyapunov. It is often called Lyapunov’s first method. Consider the system described by x˙ = f (x).

(2.21)

Write x = xe + δx. Then, 25

© 2015, J.K. Hedrick and A. Girard

Figure 2.1: Stable node.

Figure 2.2: Saddle point.

26

© 2015, J.K. Hedrick and A. Girard

Figure 2.3: Stable focus.

Figure 2.4: Center.

27

© 2015, J.K. Hedrick and A. Girard

∂f δx + h(xe , δx), δ x˙ = ∂x e

(2.22)

δ x˙ = Aδx + h(xe , δx).

(2.23)

so that

Lyapunov proved that the eigenvalues of A indicate “local” stability of the nonlinear system about the equilibrium point if: 1. The linear terms “dominate,” that is,

||h(xe , δx)|| = 0. ||δx||→0 ||δx|| lim

(2.24)

2. There are no eigenvalues with zero real part. Example 2.6 (Intuition) For intuition, consider the system x˙ = ax + bx3 .

(2.25)

If x is small enough, then ax >> bx3 . As a thought experiment, the reader is invited to consider what happens if a = 0.

2.3

Simplified Satellite Control Problem

Consider the simplified satellite control problem illustrated in Figure 2.5, with the rotational dynamics of the satellite given by I θ¨ = T,

(2.26)

where I is moment of inertia of the satellite about the axis under consideration, and T is the torque provided by the thrusters. In the 1960s, a spacecraft such as the one shown in Figure 2.5 was launched and deployed. The control system for the satellite was designed as follows; let ˙ θ¨ = U (θ, θ), 28

(2.27) © 2015, J.K. Hedrick and A. Girard

Figure 2.5: Simplified satellite control problem.

that is, let U = T /I. Further, let θdes = 0. Then, let ˙ U = −c1 θ − c2 θ.

(2.28)

After approximately one month, the spacecraft ran out of propellant. Why? It is cold in space, and the thruster valves froze open. If θ and θ˙ were small, there was not enough torque to break the ice that formed, the valves froze open, and the propellant escaped. A simple, albeit inelegant, solution is to use either relay and/or bang-bang control, as shown in Figure 2.6.

Figure 2.6: Bang-bang control for simplified satellite control problem.

Figure 2.7: Phase portrait for simplified satellite control problem, case 1 (U = 0).

29

© 2015, J.K. Hedrick and A. Girard

The control strategy has three possible cases: U = 0, U = +Um , and U = −Um . We consider each in turn, and then the design of a switching strategy between the cases. Case 1: U = 0. Then, θ¨ = U = 0, and θ˙ = constant. The satellite just floats, and the phase portrait is as shown in Figure 2.7. ¨ and hence Case 2: U = +Um . Recall that U = θ, U θ¨ dθ˙ . = = dθ θ˙ θ˙

(2.29)

Figure 2.8: Phase portrait for simplified satellite control problem, case 2 (U = +Um ).

Figure 2.9: Phase portrait for simplified satellite control problem, case 3 (U = −Um ).

In this particular case, U = +Um , and Um dθ˙ = , dθ θ˙ 30

(2.30) © 2015, J.K. Hedrick and A. Girard

that is, θ˙ dθ˙ − Um dθ = 0,

(2.31)

θ˙2 − Um θ = constant. 2

(2.32)

and

The phase portrait is a family of curves depending on the specific initial conditions, as shown in Figure 2.8. Case 3: U = −Um . Similarly, for U = −Um , the phase portrait is shown in Figure 2.9. Design of the Switching Law. The next step in controller design is to choose a switching law. A simple switching law might be U = −Um sgn θ,

(2.33)

as shown in Figure 2.10.

Figure 2.10: Possible switching law for simplified satellite control problem.

This is clearly not a good choice as it yields high amplitude motions that would likely use up the satellite’s propellant quickly. One can calculate the optimal switching curve, as shown in Figure 2.11. Another, simple possibility is as shown in the block diagram of Figure 2.12, that is, U = −Um sgn(θ˙ + aθ).

(2.34)

This yields the phase portrait shown in Figure 2.13. Note that it is important to pick a > 0, or the phase portrait is as shown in Figure 2.14 (unstable). On the switching line, for the case a > 0, we have 31

© 2015, J.K. Hedrick and A. Girard

Figure 2.11: Possible switching law for simplified satellite control problem.

Figure 2.12: Block diagram for a second possible switching law for the simplified satellite control problem.

Figure 2.13: Phase portrait for a straight line switching law for the simplified satellite control problem (a > 0).

32

© 2015, J.K. Hedrick and A. Girard

Figure 2.14: Phase portrait for a straight line switching law for the simplified satellite control problem (a < 0).

θ˙ + aθ = 0.

(2.35)

θ˙avg + aθavg = 0,

(2.36)

θavg (t) = θ0 e−at ,

(2.37)

On average,

so that

and on average the trajectory goes to the origin. The final control law is shown in block diagram form in Figure 2.15.

Figure 2.15: Block diagram for final switching law for the simplified satellite control problem.

33

© 2015, J.K. Hedrick and A. Girard

2.4

Introduction to Sliding Mode Control

Note that Sliding Mode Control (SMC) is also sometimes called Variable Structure Control (VSC). Consider the system governed by the equation θ¨ = u.

(2.38)

Inspired by the previous section, we select a control law of the form u = −Um sgn(s),

(2.39)

˙ The problem is then to design the switching surface s. The simple choices where s = s(θ, θ). s = θ and s = θ˙ do not yield the desired performance, as shown in Figures 2.16 and 2.17, respectively.

Figure 2.16: Phase portrait for s = θ.

The choice given in the previous section, though, s = θ˙ + aθ, yields good performance, as long as a > 0. When s > 0, we need s˙ < 0 to go back to the line s = 0. Similarly, when s < 0, we need s˙ > 0 to get back to the line s = 0, as shown in Figure 2.18. We have θ¨ = u = −Um sgn(s),

(2.40)

θ¨ = −Um sgn(θ˙ + aθ).

(2.41)

hence

Furthermore, 34

© 2015, J.K. Hedrick and A. Girard

˙ Figure 2.17: Phase portrait for s = θ.

Figure 2.18: Phase portrait for s = θ˙ + aθ, a > 0.

35

© 2015, J.K. Hedrick and A. Girard

s = θ˙ + aθ,

(2.42)

˙ s˙ = θ¨ + aθ.

(2.43)

so that

The argument given above indicates that we care about the region where ss˙ < 0. We have ˙ ss˙ = (θ˙ + aθ)(−Um sgn(θ˙ + aθ) + aθ).

(2.44)

ss˙ < 0 =⇒ −Um + aθ˙ < 0.

(2.45)

Let s > 0. Then,

Hence, if s > 0, ss˙ < 0 if and only if Um . θ˙ < a

(2.46)

Extending this argument to the case s < 0 yields the chatter zone shown in Figure 2.19.

Figure 2.19: Chattering zone for sliding mode controller. Any perturbation away from the thick line results in ss˙ < 0.

Example 2.7 Consider the system θ¨ = u + d, 36

(2.47) © 2015, J.K. Hedrick and A. Girard

Figure 2.20: Desired behavior for controlled system.

where d(t) is an unknown disturbance. The disturbance d is, however, bounded, so that |d(t)| < dm .

(2.48)

The goal is to design a controller that guarantees the type of response shown in Figure 2.20. We wish to investigate whether it is possible to guarantee this response, assuming no bounds on u, and if it is possible, to design a controller. The desired behavior is a first-order response. Let s = τ θ˙ + θ. If s = 0, we have the desired response. Hence our goal is to drive s to zero. If u appears in the equation for s, set s = 0 and solve for u. This does not happen here. If it is not the case, differentiate the equation for s until u appears. The first derivative of s is ˙ s˙ = τ θ¨ + θ, ˙ = τ (u + d) + θ, ˙ = τ u + τ d + θ.

(2.49) (2.50) (2.51)

We want to meet the condition ss˙ < 0, that is ˙ < 0. (τ θ˙ + θ)(τ u + τ d + θ)

(2.52)

θ˙ u = − − (η + dm ) sgn(τ θ˙ + θ). τ

(2.53)

We therefore select u to be

The first term drives the error to zero. The second term is called the switching term. The parameter η is a tuning parameter that governs convergence speed. The phase portrait of the controlled system is shown in Figure 2.21. Once the system trajectory crosses the s = 0 line, the goal is met, and the system “slides” along the line. Hence the name “sliding mode control.” 37

© 2015, J.K. Hedrick and A. Girard

Figure 2.21: Phase portrait for controlled system.

Remark 2.1 Note that the switching surface s does not have to be a straight line. It is, however, a common choice in many practical problems, as it keeps the problem analyzable. Example 2.8 (Nonlinear switching surface) Consider the system x¨ = u.

(2.54)

Figure 2.22: Bang-bang approach.

The double integrator dynamics may describe a cart whose acceleration is directly controlled by a force applied on the cart. Our control goal may be, for example, to make a cart reach a given position at zero velocity in minimal time. The request for a minimal time solution suggests using a bang-bang approach, as shown in Figure 2.22. This can be obtained, for example, with the following expression for s: 1 s(x, x) ˙ = x| ˙ x| ˙ + Um x = 0, 2 38

(2.55)

© 2015, J.K. Hedrick and A. Girard

Figure 2.23: Bang-bang sliding surface.

Figure 2.24: Block diagram for bang-bang approach.

39

© 2015, J.K. Hedrick and A. Girard

as shown in Figure 2.23. This corresponds to the block diagram in Figure 2.24. Logic is missing from this analysis for the case when s is exactly equal to zero. In practice, for a continuous time system such as that portrayed above, this case is never reached.

2.5

Rotational Position Control of Servo

In this section we present a classical example of phase plane analysis, adapted from [3].

Figure 2.25: Rotational position control of servo – block diagram.

Figure 2.26: Desired behavior for rotational position control of servo.

Consider the rotational position control of a servo, described by the block diagram shown in Figure 2.25. Assume the control gain K is chosen to yield the desired behavior shown in Figure 2.26.

Figure 2.27: Effect of dry friction on rotational position control of servo.

We consider first the effect of dry friction. In that case, the block diagram of Figure 2.25 is modified as shown in Figure 2.27. The governing equation is 40

© 2015, J.K. Hedrick and A. Girard

I θ¨o = −B sgn(θ˙o ) − Kθo .

(2.56)

For simplicity and without lack of generality, assume that I = 1. Then, 1 ¨ B θo + θo = − sgn(θ˙o ), K K

(2.57)

  B ˙ K −θ − sgn( θ ) ˙ o o K dθo = . dθo θ˙o

(2.58)

which yields

Figure 2.28: Model of dry friction.

Figure 2.29: Singular points for rotational position control of servo with dry friction.

Here the friction function is as shown in Figure 2.28. There are an infinite number of singular points, as shown in Figure 2.29. When θ˙o > 0, we have 41

© 2015, J.K. Hedrick and A. Girard

Figure 2.30: Phase portrait for rotational position control of servo with dry friction.

B 1¨ θo + θo = − , K K

(2.59)

that is, we have an undamped linear oscillation (a center). Similarly, when θ˙o < 0, we have B 1¨ θo + θo = , K K

(2.60)

which is another center. The resulting phase portrait is as shown in Figure 2.30. From a controls perspective, dry friction results in an offset, that is, a loss of static accuracy. To get accuracy back, it is possible to introduce dither into the system. Dither is a highfrequency, low-amplitude disturbance. An analogy would be tapping an offset scale with one’s finger to make it return to the correct value. The effect of dither on the phase portrait is as shown in Figure 2.31. On average, the effect of dither “pulls you in.” Here, dither is a linearizing agent, transforming Coulomb friction into viscous friction. Now consider our original rotational position control of servo problem, but with saturation instead of dry friction. The resulting block diagram is shown in Figure 2.32. There are three different zones created by the saturation function:  ¨ ˙  I θo + B θo + cθo = 0 for |θo | < a, I θ¨o + B θ˙o = −ac for θo > a,   ¨ I θo + B θ˙o = ac for θo < −a.

(2.61)

Therefore, for θo > a, in steady state, we have 42

© 2015, J.K. Hedrick and A. Girard

Figure 2.31: Phase portrait for rotational position control of servo with dry friction and dither.

Figure 2.32: Block diagram for rotational position control of servo with saturation.

Figure 2.33: Phase portrait for rotational position control of servo with saturation.

43

© 2015, J.K. Hedrick and A. Girard

ac θ˙o,ss = − , B

(2.62)

and for θo < −a, in steady state, we have ac θ˙o,ss = . B

(2.63)

The phase portrait is as shown in Figure 2.33. In this particular case, the effect of saturation is not destabilizing. However, saturation affects the performance by “slowing it down.” Note that we are assuming that the system was stable to start with, before we applied saturation. Problems may appear if one is not operating in the linear region, which indicates that the gain should be reduced in the saturated region. Note that there are systems for which saturation causes instability.

2.6

Further Reading

2.7

Homework Problems

Problem 2.1 (Linear Phase Portraits – Orbits and Foci) In this problem, we use analytic and numerical techniques to study phase portraits of second order linear equations of the form

x˙ = Ax.

(2.64)

If you are using Matlab, the “phasemaker.m” file given below may help you make computer generated phase portraits. Of course, you should feel free to use any other software package if you prefer. Case 1: Stable, distinct, real eigenvalues: Find the eigenvalues and associated eigenvectors for the A matrix   −7/3 −2/3 A= −4/3 −5/3

(2.65)

Sketch (by hand) what the plot should look like, labeling the slow eigenvector and the fast eigenvector. Then, run “phasemaker.m” to check your answer. Attach the plot. Diagonalization of A matrix Above, we used the basis {[1 0]T , [0 1]T } to express the state. Find a new basis {t1 , t2 }, with t1 ∈ R2 , so that the new “A” matrix is diagonal. That is, if x = [t1 t2 ]z, where z represents the coordinates of x in the new basis, then we would like the equation for z˙ to be 44

© 2015, J.K. Hedrick and A. Girard

Figure 2.34: Solid lines come from the diagonalized system. Dotted lines come from transforming the points of the trajectories of the non-diagonalized system.

45

© 2015, J.K. Hedrick and A. Girard

decoupled. Plug the diagonal “A” matrix into “phasemaker.m” to plot the phase portrait of the system in the new basis. Transformation of the state trajectories Now, change the A matrix in “phasemaker.m” back to   −7/3 −2/3 A= −4/3 −5/3

(2.66)

as above. Then, apply a transformation matrix inside the for-loop, directly to the trajectory vector called state, so that the trajectories are transformed to look like those of the diagonalized system. Write down what transformation you used. Overlay this phase plot with that from the diagonalized system. Your result should look like Figure 2.34. Crossing eigenvectors Write a sentence or two explaining why state trajectories cannot cross eigenvectors. Take a moment to check that this is the case for the plots you just generated. Case 2: Only one eigenvector: improper node: Find the eigenvalues and associated eigenvectors of the A matrix   −1 1 A= . 0 −1

(2.67)

Sketch, and then plot with “phasemaker.m” the phase portrait for the system . Is the eigenvector crossed? Can generalized eigenvectors be crossed? Case 3: Orbits and foci: Consider the second-order system      σ ω x1 x˙ 1 = x˙ 2 −ω σ x2

(2.68)

with 

σ ω A= −ω σ

 (2.69)

We study the phase portrait in polar coordinates

r=

q

x21 + x22

(2.70)

and  φ = arctan

46

x2 x1

 .

(2.71) © 2015, J.K. Hedrick and A. Girard

1. Show that r˙ = σr and φ˙ = −ω and write one or two sentences interpreting these results. 2. Create an A matrix that has a phase portrait consisting of counterclockwise orbits. Plot using Matlab. (The file “phasemaker.m” can be used.) Include the plot. 3. Create an A matrix that has a phase portrait consisting of a clockwise focus. Plot using Matlab. (The file “phasemaker.m” can be used.) Include the plot.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% phasemaker.m: Makes phase plots by running simulations repeatedly %% with different initial conditions and plotting them %% on the same graph %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Amount of time to run each simulation tfinal = 15; % Parameters of a rectangle of initial conditions. % resolution, a smaller or larger "window", etc xmin = -0.05; xmax = 0.05; num xpoints = 20;

Adjust here for more

ymin = -0.05; ymax = 0.05; num ypoints = 20; % Make matrix with x and y coordinates of the ICs on perimeter of rectangle xpoints = linspace(xmin, xmax, num xpoints); ypoints = linspace(ymin, ymax, num ypoints); ics = [

xpoints' xmax*ones(num ypoints,1) xpoints' xmin*ones(num ypoints,1)

ymax*ones(num xpoints,1); ... ypoints'; ... ymin*ones(num xpoints,1); ... ypoints' ];

% Create a linear system A = [ -1 1 ;... 0 -1 ]; B = [ 0 0]'; C = eye(2); D = 0; linsys = ss(A,B,C,D); % Run simulation inside a "for" loop. If running a linear simulation, use % the "initial" command. If running a nonlinear one, download "xprime.m" and % use the "ode23" line.

47

© 2015, J.K. Hedrick and A. Girard

figure(1); hold on; % Keep the same plot on the screen so we can overlay them for i = 1:length(ics), % Choose a simulation routine %[junk,junk,states] = initial(linsys,ics(i,:)',tfinal); % for problem 1 [junk,states] = ode23('xprime',tfinal,ics(i,:)'); % for problem 3 states = states'; % turns states into a matrix of size 2 x (n time points) states = states; % Insert transformation here for problem 1 plot(states(1,:),states(2,:)); end axis([-3,3,-3,3]);

Problem 2.2 (Damped Pendulum) Consider the damped pendulum shown in Figure 2.35, where the pendulum mass, m and length, l are chosen so that mgl = ml2 = 1.

Figure 2.35: Damped pendulum.

The equations of motion are given by θ˙ = ω, ω˙ = − sin θ − bω,

(2.72) (2.73)

where θ is the angular position in radians, ω is the angular velocity (in rad/s) and b is the damping coefficient. 1. Determine all the equilibrium points. 2. Qualitatively determine the stability and the characteristics of the equilibrium points for all possible non-negative values of b. 48

© 2015, J.K. Hedrick and A. Girard

Problem 2.3 (Nonlinear Phase Portraits) Consider the system given by x˙ 1 = (2 − x1 − 2x2 )x1 , x˙ 2 = (2 − 2x1 − x2 )x2 .

(2.74) (2.75)

Draw the phase portrait of the system, first by hand and then using a computer. Proceed as follows: 1. Find the four equilibria. 2. Linearize the equations symbolically about the point (x10 , x20 ). That is, define δx1 = x1 − x10 , δx2 = x2 − x20 and put the equations in the form: 

   δ x˙ 1 δx1 =0+A . δ x˙ 2 δx2

(2.76)

3. For each of the equilibria, use Matlab to find the eigenvalues and associated eigenvectors. Classify the equilibrium and write a phrase describing how it behaves. 4. Try to guess how the nonlinear state trajectories connect the equilibria together. 5. You may use the file “xprime.m,” along with “phasemaker.m,” to check your answer. A good place to start is to use xmax = 0.1, xmin = −0.1, ymax = 0.1, ymin = −0.1, but to set the axis range (at the bottom of “phasemaker.m”) to about plus or minus 10. Turn in the plot.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % xprime.m: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function xdot = xprime(t,x) x1 = x(1); x2 = x(2); x1dot = (2 - x1 - 2*x2)*x1; x2dot = (2 - 2*x1 - x2)*x2; xdot = [x1dot x2dot]';

49

© 2015, J.K. Hedrick and A. Girard

50

© 2015, J.K. Hedrick and A. Girard

Chapter 3 The Center Manifold Theorem 3.1

Bifurcations and Catastrophes

Definition 3.1 A bifurcation is a qualitative change in the nature of the solution trajectories of a nonlinear system due to a parameter change. A catastrophe is a sudden jump between equilibrium surfaces. Example 3.1 Consider the first-order system described by x˙ = −(x3 + c1 x + c2 ) = f (x, c),

(3.1)

  c c= 1 . c2

(3.2)

where

This example is due to Carr. For this example, a “potential function” Φ exists, obtained from

f =−

∂Φ , ∂x

(3.3)

that is, Z Φ=−

f dx =

x4 x2 + c1 + c2 x. 4 2

(3.4)

Stable equilibrium points are minima of Φ. For instance, let us set c1 = −3. Varying c2 yields the geometries shown in Figure 3.1. 51

Figure 3.1: System behaviors for bifurcation example.

52

© 2015, J.K. Hedrick and A. Girard

Note that we have a possible “jump” condition for |c2 | = 2. The system has one equilibrium point for |c2 | > 2, and three equilibrium points for |c2 | < 2. Furthermore, the system displays hysteresis. The equilibrium solutions separate (“bifurcate”) from each other at a bifurcation surface, defined by

f (x, c) = 0,

(3.5)

∂ 2Φ ∂f (x, c) = = 0, ∂x ∂x2

(3.6)

the equilibrium condition, and

the “jump” condition. For our example, x3 + c1 x + c2 = 0, 3x2 + c1 = 0.

(3.7) (3.8)

Eliminating x in these equations yields the equation for the bifurcation surface, 1 3 1 2 c + c = 0. 27 1 4 2

(3.9)

The parameter c1 is called a splitting factor, as shown in Figure 3.2. If c1 < 0, a catastrophe can occur. If c1 > 0, no catastrophes can occur. Note that it is possible to plot threedimensional curves showing xeq as a function of c1 and c2 , and this results in interesting geometries.

Figure 3.2: Splitting factor influence on bifurcation example.

53

© 2015, J.K. Hedrick and A. Girard

Remark 3.1 Applying these techniques to higher-order systems becomes difficult. For example, consider the system

x˙ = f (x, u), u = −cx,

(3.10) (3.11)

x˙ = f (x, u).

(3.12)

or

Does this system exhibit bifurcations and/or catastrophes? The center manifold theorem will provide a method to reduce the dimensionality of a system when analyzing bifurcations or catastrophes. It is an extension of results on flows and invariant subspaces, that we review in the following section.

3.2 3.2.1

Flows and Invariant Subspaces Linear Systems

Consider the linear system described by

x˙ = Ax,

(3.13)

x(x0 , t) = eAt x0 .

(3.14)

with solution

We can thing of eAt as a mapping from x0 into x(t), or as a flow generated by the vector field Ax. Further assume that A has n linearly independent eigenvectors vj , j = 1, ..., n, that is,

(λj I − A)vj = 0,

(3.15)

where the eigenvalues λj are defined by |λj I − A| = 0, j ∈ [1, n].

(3.16)

Then, the solution can be written as 54

© 2015, J.K. Hedrick and A. Girard

x(t) =

n X

αj eλj t vj ,

(3.17)

j=1

where the αj depend on the initial conditions. We see that certain solutions are invariant under eAt , namely, solutions starting along eigenvectors remain on them. Example 3.2 Consider a real eigenvector, and let x(0) = α1 v1 . Then, x(t) = α1 v1 eλ1 t

(3.18)

is a solution of the differential equation x˙ = Ax. The invariant subspaces of eAt are defined by the space spanned by the eigenvectors of A. It is useful to divide the subspaces into three classes: 1. The stable subspace, E s = span{v1s , ..., vns }, where λ1s , ..., λns have negative real parts, 2. The unstable subspace, E u = span{v1u , ..., vnu }, where λ1u , ..., λnu have positive real parts, 3. The center subspace, E c = span{v1c , ..., vnc }, where λ1c , ..., λnc have zero real parts. Note that ns + nu + nc = n. Solutions on E s have exponential decay, solutions on E u have exponential growth, and solutions on E c are either constant or oscillatory, as shown in Figure 3.3.

3.2.2

Nonlinear Systems

Consider the system described by x˙ = f (x),

(3.19)

where x ∈ Rn . Here, f (x) is a vector field. Let f (x) be sufficiently “smooth”, that is, assume that in some neighborhood of the equilibrium points, there exists a smooth “local flow” or mapping, Φt , such that x(t) = Φt (x0 , t).

(3.20)

Note that in the linear case, Φt = eAt x0 , The equilibrium points of the nonlinear system are given by 55

© 2015, J.K. Hedrick and A. Girard

Figure 3.3: Invariant subspaces of a linear system. Solutions cannot cross eigenvectors.

f (xe ) = 0.

(3.21)

∂f δ x˙ = δx , J(xe )δx ∂x e

(3.22)

Let x = xe + δx. Then,

defines the linearized system, where J(xe ) is the n × n Jacobian matrix. Theorem 3.1 (Lyapunov’s First Theorem) If J(xe ) has no eigenvalues with zero real parts, then Φt → eJt smoothly in some region about xe . Theorem 3.2 If J(xe ) has no eigenvalues with zero real parts, then there exist local stable and unstable manifolds of the nonlinear system, W s and W u , that are tangent to E s , E u at xe , as shown in Figure 3.4. Definition 3.2 (Warning: non rigorous) A k-dimensional manifold in Rn (with 1 ≤ k < n) is a solution to η(x) = 0,

(3.23)

where η is k × 1 and η : Rn → Rn−k is sufficiently smooth. 56

© 2015, J.K. Hedrick and A. Girard

Figure 3.4: Manifolds of the linear and nonlinear systems.

Example 3.3 The unit circle, {x ∈ R2 : x21 + x22 = 1},

(3.24)

is a 1-dimensional manifold in R2 . The unit sphere, {x ∈ Rn :

n X

x2i = 1},

(3.25)

1

is an (n − 1)-dimensional manifold in Rn . Definition 3.3 A manifold {η(x) = 0} is said to be an invariant manifold if η(x(0)) = 0 =⇒ η(x(t)) = 0 ∀t ∈ [0, t1 ],

(3.26)

where [0, t1 ] ⊂ R is a time interval over which the solution x(t) is defined.

3.3

Further Reading

Sastry chapter 7, Guckenheimer and Holmes chapters 1 and 3, Khalil.

3.4

Homework Problems

Problem 3.1 Consider the system modeled by y˙ = −y + (y + c)z, z˙ = y − (y + 1)z, 57

(3.27) (3.28)

© 2015, J.K. Hedrick and A. Girard

where  > 0 is small and 0 < c < 1. These equations are from a model of the kinetics of enzyme reactions. More information is available in Heinenkin, Tsuchiya and Aris, On the Mathematical Status of the Pseudo-Steady State Hypothesis of Biochemical Kinetics, Mathematical Biosciences, 1967. Stability of the Reduced Model For  = 0, the model reduces to one algebraic relation and one dynamical equation. Show that the resulting first-order system has a stable equilibrium at y = 0. Stability of the Perturbed System Next, we apply center manifold theory to show that the system remains stable for small values of  > 0. To make the algebra a little cleaner, we transform the dynamic model in three ways. First, we think of  as an additional state that is always constant, that is, d/ dt = 0. This gives us a third order system. Second,  T we define w = y − z, and let our new state vector be x = y  w . This is just a state transformation. Finally, we apply a time scaling, t = τ . These three steps yield an equivalent representation of the dynamics dy = (−y + (y + c)(y − w)), dτ d = 0, dτ dw = −w + y 2 − yw + (−y + (y + c)(y − w)). dτ

(3.29) (3.30) (3.31)

Linearized System Find the linearization of this third order system about the equilibrium point x = 0. What can you conclude about the stability of the third-order system? Center Manifold Approximation Here, the center manifold has dimension 2 and the stable manifold has dimension 1. Thus the center manifold is given by a function h such that w = h(y, ). Figure 3.5 gives a close approximation of this two-dimensional center manifold for the case c = 0.1. In this part of the problem, we find this center manifold approximation. Recall that the center manifold must pass through the origin and be tangent to the  − y plane. Hence,

h(0, 0) =

∂h ∂h (0, 0) = (0, 0) = 0. ∂y ∂

(3.32)

Figure 3.5 shows a second order approximation of the center manifold, h(y, ) ≈ a1 y 2 + a2 y + a3 2 ,

(3.33)

where the higher order terms have been neglected. Solve for the coefficients ai using the relation 58

© 2015, J.K. Hedrick and A. Girard

Figure 3.5: Approximate center manifold for c = 0.1.

∂h d ∂h dy dw = + . dτ ∂ dτ ∂y dτ

(3.34)

Stability of the Perturbed System The benefit of center manifold theory is that we can now determine the stability of the third-order system by looking at the dynamics on the center manifold, dy =  (−y + (y + c)(y − h(y, ))) , dτ d = 0. dτ

(3.35) (3.36)

We only need to examine the first of these two equations, since the second just says that  is constant in time. In terms of the original time scale, the first equation is dy = −y + (y + c)(y − h(y, )). dt

(3.37)

Substitute your second-order center manifold approximation into this first-order system and show that it is stable for small . Thus the original second-order system remains stable for small values of .

59

© 2015, J.K. Hedrick and A. Girard

60

© 2015, J.K. Hedrick and A. Girard

Chapter 4 Controllability and Observability We consider the notions in turn, and follow [4]. We start with observability as the mathematics involved are a little simpler. We first review results for linear systems, and then consider the mathematical tools necessary for nonlinear systems (Lie derivatives for observability, Lie brackets for controllability), and state the nonlinear results.

4.1

Observability

Intuitively, observability is concerned with whether, from observing sensor measurements for a finite period of time, the state can be reconstructed for previous times.

4.1.1

Motivation and Review of Observability for Linear Systems

Consider the system

x˙ = Ax,

(4.1)

z = M x,

(4.2)

where x ∈ Rn , and the measurement

where z ∈ Rp and p < n. For this system, we know that x(t) = eAt x0 .

(4.3)

We consider the following problem. For this system, given z(t) over the interval [0, T ], can x0 be determined? We start by checking dimensions: z(t) = M eAt x0 , where M is p × n, eAt is n × n, x0 is n × 1, and therefore z(t) is p × 1. Using the Cayley-Hamilton theorem yields 61

e

At

=

n−1 X

αk (t)Ak .

(4.4)

k=0

Note that the Cayley-Hamilton theorem can be applied to time-varying matrices if necessary. Therefore,

  z(t) = α0 (t)M + α1 (t)M A + ... + αn−1 M An−1 x0 .

(4.5)

Then, we can solve for x0 if the matrix O spans n-space, where 

M MA .. .



    O= .   n−1 MA

(4.6)

Such a global approach does not carry over to nonlinear systems. Instead, a local approach is used. For analogy, let us consider a local approach of observability for linear systems. Let

z(t) = M x(t) + v(t),

(4.7)

where v(t) is the measurement noise. Then, we have

z˙ = M x˙ = M Ax, z¨ = M A2 x, ··· = ··· , (n−1) z = M An−1 x.

(4.8) (4.9) (4.10) (4.11)

Let 

 z  ..   .  = Ox. z (n−1)

(4.12)

Then, the matrix O must have rank n for the linear system to be observable. TODO ——– missing a formal definition of observability 62

© 2015, J.K. Hedrick and A. Girard

4.1.2

Lie Derivatives

Definition 4.1 Let f : Rn → Rn be a vector field in Rn , and let h : Rn → R be a smooth scalar function. Then, the Lie derivative of h with respect to f is n

X ∂h ∂h f= fi . Lf h = ∇hf = ∂x ∂xi i=1

(4.13)

Remark 4.1 (Dimensions) Let us consider the dimensions of the Lie derivative: f has components 

 f1 (x)   f =  ...  , fn (x)

(4.14)

and h associates a scalar to each point in Rn . The Lie derivative is given by 

Lf h =

 ∂h ∂x1

···

∂h ∂xn

 f1 (x)  .   ..  ,

(4.15)

fn (x) that is, the Lie derivative is a scalar. Remark 4.2 (Lie derivatives of higher order) Note that, by convention, we let h = L0f h

(4.16)

be the Lie derivative of 0th order. We can define higher order Lie derivatives, for example L2f h =

∂ 1 [L h]f, ∂x f

(4.17)

and so on. Note that if x˙ = f (x), then ∂h ∂x ∂h = f = L1f h, h˙ = ∂x ∂t ∂x ∂ 1 ¨ = [Lf h]f = L2f h, h ∂x .. .. . = ., (k)

h

=

Lkf h. 63

(4.18) (4.19) (4.20) (4.21)

© 2015, J.K. Hedrick and A. Girard

Let us now revisit observability for linear systems using the Lie derivative notation. Let x˙ = Ax, so that, in nonlinear notation, f (x) = Ax. Let zi = Mi x with i ∈ [1, p]. The dimensions of Mi are 1 × n. Then, we can write zi = hi (x) = L0f hi ,

(4.22)

L1f hi ,

(4.23)

z˙i = .. . . = .., (k)

zi

(4.24)

= Lkf hi .

(4.25)

Define 

 L0f h1 · · · L0f hp  .. ..  , G =  ... . .  n−1 n−1 Lf h1 · · · Lf hp   M1 x ··· Mp x   .. .. .. =  , . . . n−1 n−1 M1 A x · · · Mp A x

(4.26)

(4.27)

and a gradient operator 

dL0f h1 · · ·  .. .. dG =  . . dLn−1 h · · · 1 f

 dL0f hp  ..  = O. . n−1 dLf hp

(4.28)

The matrix O must have rank n for the system to be observable.

4.1.3

Observability for Nonlinear Systems

Definition 4.2 Consider the system described by the state equation

x˙ = f (x, u)

(4.29)

and the measurement equation 

 h1 (x)   z = h(x) =  ...  . hp (x) 64

(4.30)

© 2015, J.K. Hedrick and A. Girard

two states x0 and x1 are called distinguishable if there exists an input function u∗ such that x0 6= x1 =⇒ z(x0 ) 6= z(x1 ),

(4.31)

that is, if the sensor readings are different, the states are also different. The system is called locally observable at point x0 if there exists a neighborhood of x0 such that every x in that neighborhood other than x0 is distinguishable from x0 . Theorem 4.1 Consider the system described by the state equation x˙ = f (x, u)

(4.32)

and the measurement equation 

 h1 (x)   z = h(x) =  ...  . hp (x)

(4.33)

Let G denote the set of all finite linear combinations of the Lie derivatives of h1 , ..., hp with respect to f for various values of u = u∗ constant. Let dG denote the set of all their gradients, evaluated at x0 . If we can find n linearly independent vectors within dG, then the system is locally observable. Let us consider the single measurement case for illustration. We have x˙ = f (x, u), z = h(x).

(4.34) (4.35)

Taking successive derivatives of z yields z = h = L0f h, z˙ = h˙ = L1 h, .. . = (n−1) z =

(4.36)

f

(4.37)

.. ., Ln−1 h. f

(4.38) (4.39)

Let 

 L0f h   l(x) =  ...  . Ln−1 h f 65

(4.40)

© 2015, J.K. Hedrick and A. Girard

Expanding in a first-order Taylor series about x0 for u = u0 yields ∂l(x, u0 ) l(x, u0 ) ≈ l(x0 , u0 ) + (x − x0 ). ∂x x=x0

(4.41)

∂l(x, u0 ) . dG = O = ∂x x=x0

(4.42)

Then, set

For local observability, the matrix O must have rank n. Example 4.1 Consider the system described by x21 x˙ 1 = + ex2 + x2 , 2 x˙ 2 = x21 , z = x1 .

(4.43) (4.44) (4.45)

From observation, does z contain sufficient information on x1 and x2 ? Since x1 = z, we have

ex2 + x2 = z˙ −

z2 , 2

(4.46)

by substitution into the first line. Clearly, if we had z = x2 , the system would not be distinguishable, since z˙ = x21 . But consider the case given above, with z = x1 . Then, z˙ = x21 , and  z¨ = 2x1 x˙ 1 = 2x1

 x21 x2 + e + x2 . 2

(4.47)

Let us then consider the rank test for z = h = x1 . We have 

 h G = , Lf h   x1 = , x˙ 1   x1 . = x21 + e x2 + x 2 2 66

(4.48) (4.49) (4.50)

© 2015, J.K. Hedrick and A. Girard

Then, 

1 0 O = dG = x1 ex2 + 1

 (4.51)

has rank 2 everywhere, hence the system is locally observable everywhere.

4.2

Controllability

Intuitively, a system being controllable means that one can get anywhere in the state space in a finite amount of time and with finite control effort.

4.2.1

Motivation and Review of Controllability for Linear Systems

For linear time-invariant systems, written x˙ = Ax + Bu,

(4.52)

with x ∈ Rn , the system is controllable if the matrix  C = B AB · · ·

An−1 B



(4.53)

has rank n. TODO ——– missing a formal definition of controllability

4.2.2

Lie Brackets

Definition 4.3 Consider two vector fields f (x) and g(x) in Rn . Then, the Lie bracket operation generates a new vector field: [f, g] = (ad1f , g) =

∂f ∂g f− g. ∂x ∂x

(4.54)

Remark 4.3 (Lie brackets of higher order) Lie brackets of higher order can be defined as follows: (ad1f , g) = [f, g],

(4.55)

(ad2f , g)

(4.56)

.. . f (adf , g)

= [f, [f, g]], . = .., = [f, (adk−1 f , g)].

(4.57) (4.58)

Note that the “ad” is read “adjoint.” 67

© 2015, J.K. Hedrick and A. Girard

Revisiting controllability conditions for linear systems using this notation, we have

x˙ = Ax + Bu, = Ax + B1 u1 + B2 u2 + ... + Bm um ,

(4.59) (4.60)

that is,

f (x) = Ax, gi (x) = Bi .

(4.61)

Then, using ∂f = A, ∂x ∂g ∂B = = 0, ∂x ∂x

(4.62) (4.63)

we obtain

x¨ = Ax, ˙

(4.64)

= A2 x +

m X

ABi ui ,

(4.65)

[f, Bi ]ui .

(4.66)

i=1

= A2 x −

m X i=1

For example,

[f, B1 ] = [Ax, B1 ], ∂B1 ∂(Ax) = Ax − B1 , ∂x ∂x = −AB1 .

(4.67) (4.68) (4.69)

Taking successive derivatives of x yields

x

(3)

3

= A x+

m X

A2 Bi ui ,

(4.70)

[ad2f , Bi ]ui .

(4.71)

i=1

= A3 x +

m X i=1

68

© 2015, J.K. Hedrick and A. Girard

Notice that this time the minus signs cancel out. Successive derivatives yield x(n) =

dn x , dtn n

= A x+

(4.72) m X

An−1 Bi ui ,

(4.73)

i=1 n

= A x + (−1)

n−1

m X

[adn−1 , Bi ]ui . f

(4.74)

i=1

Rewriting the classical controllability condition for linear systems yields  C = B1 B2 · · ·

Bm [ad1f , B1 ] · · ·

[ad1f , Bm ] · · ·

 [adn−1 , B ] . m f

(4.75)

Note that this is only a notation change. The Bi terms correspond to the “B” term in the original matrix, the “ad1f ” terms correspond to the “AB” term, and the “adn−1 ” terms f correspond to the “An−1 B” term. Applying a local approach to controllability for linear systems, let us assume that u is constant (the general case is not much more difficult, but one must carry terms with derivatives of u, for instance u, ˙ u¨ etc.). Then, x˙ = Ax + Bu, x¨ = A2 x + ABu, .. . . = .. x(n) = An x + An−1 Bu.

(4.76) (4.77) (4.78) (4.79)

For linear systems, the Cayley-Hamilton theorem makes it unnecessary to take higher-order derivatives.

4.2.3

Controllability for Nonlinear Systems

We consider the case of affine systems, that is, systems that can be written as

x˙ = f (x) +

m X

gi (x)ui .

(4.80)

i=1

The general case is much more involved as in given in [4]. Note that to study a system that is not affine, described by x˙ = f (x, u), it is sometimes possible to let τ u˙ + u = v, 69

(4.81) © 2015, J.K. Hedrick and A. Girard

and augment the state of the system to be z = [x u]T , and let v be the new control. Therefore, the augmented system is affine in (z, v), and tune τ for adequate performance. Theorem 4.2 The system with dynamics described by

x˙ = f (x) +

m X

gi (x)ui

(4.82)

i=1

is locally accessible about x0 if the accessibility distribution C spans n-space, where x ∈ Rn and C is defined by  C = g1 · · ·

gm [gi , gj ] · · ·

[adkgi , gj ] · · ·

[f, gi ] · · ·

 [adkf , gi ] .

(4.83)

Remark 4.4 The “gi ” terms are analogous to the “B” terms, the “[gi , gj ]” terms are new and from having a nonlinear system, the “[f, gi ]” terms correspond to the “AB” terms, etc. Remark 4.5 If f (x) = 0, then x˙ = system is controllable.

Pm

i=1

gi (x)ui , and if in this case C has rank n, then the

Figure 4.1: Axle model of vehicle kinematics.

Example 4.2 (Kinematics of an Axle) Consider the kinematics of an axle, as shown in Figure 4.1. Here, ψ is the yaw angle of the vehicle (axle), and x1 and x2 are the Cartesian locations of the axle’s center of gravity. The controls are u1 , the velocity of the axle, and u2 , the steering rate. Let the state vector be   x1  x = x2  . ψ 70

(4.84) © 2015, J.K. Hedrick and A. Girard

The dynamics are given by x˙ 1 = sin ψu1 , x˙ 2 = cos ψu1 , ψ˙ = u2 .

(4.85) (4.86) (4.87)

The system is in the form x˙ = f (x) + g1 u1 + g2 u2 ,

(4.88)

f (x) = 0,   sin ψ g1 (x) = cos ψ  , 0   0  0 . g2 (x) = 1

(4.89)

with

(4.90)

(4.91)

The accessibility distribution is   C = g1 g2 [g1 , g2 ] ,

(4.92)

where [g1 , g2 ] = −

∂g1 ∂g2 g2 + g1 ∂x ∂x

(4.93)

and in our case, ∂g2 = 0. ∂x

(4.94)

Hence,    0 0 cos ψ 0    0 0 − sin ψ 0 , [g1 , g2 ] = 0 0 0 1   cos ψ  = − sin ψ  . 0 71

(4.95)

(4.96)

© 2015, J.K. Hedrick and A. Girard

Therefore, 

 sin ψ 0 cos ψ C = cos ψ 0 − sin ψ  . 0 1 0

(4.97)

The matrix C has rank 3 everywhere, so the system is locally accessible everywhere, and f (x) = 0 (the system has free dynamics), so the nonlinear system is controllable. Remark 4.6 If a nonlinear system is linearized about an equilibrium point x0 and the linearization is controllable, then the nonlinear system is accessible at x0 . The converse is not true, that is, if the linearization is uncontrollable, the nonlinear system may still be locally accessible. Example 4.3 Consider the linear system

x˙ 1 = x2 , x˙ 2 = u.

(4.98) (4.99)

Then, 

     0 1 0 1 A= , B= , AB = , 0 0 1 0

(4.100)

  0 1 C= , 1 0

(4.101)

and the linear system is controllable. Now, let us consider the nonlinear system x˙ 1 = x22 , x˙ 2 = u.

(4.102) (4.103)

Is the nonlinear system controllable? Intuitively, the answer must be no, because x1 can only increase. But let us prove it. In our notation,  2 x2 f = , 0   0 g = , 1 72

(4.104) (4.105) © 2015, J.K. Hedrick and A. Girard

and therefore   g, [f, g] ,   0 −2x2 = . 1 0

C =

(4.106) (4.107)

The system is locally accessible everywhere except at x2 = 0. Trying higher order Lie brackets yields no new directions (all cause the rank of C to drop at x2 = 0). Example 4.4 Consider the system         x˙ 1 cos θx3 + sin θx4 0 0 x˙ 2  − sin θx3 + cos θx4  0 0  =  +   u1 +   u2 , x˙ 3    1 0 0 x˙ 4 0 0 1 where θ = θ(

(4.108)

p

x21 + x22 ). The system is in affine form x˙ = f (x) + g1 u1 + g2 u2 ,

(4.109)

where 

 cos θx3 + sin θx4 − sin θx3 + cos θx4  , f (x) =    0 0   0 0  g1 =  1 , 0   0 0  g2 =  0 . 1

(4.110)

(4.111)

(4.112)

Let   C = g1 , g2 , [f, g1 ], [f, g2 ] .

(4.113)

If C has rank 4, the system is locally accessible. The calculation is left to the reader as an exercise. 73

© 2015, J.K. Hedrick and A. Girard

4.3

Further Reading

4.4

Homework Problems

Figure 4.2: Magnetic Suspension of Problem 4.1.

Problem 4.1 Consider the magnetic suspension schematically represented in Figure 4.2. The input is a voltage source. The modeling details are omitted here. The equations of motion are x˙ = y,

(4.114) 2

αz + Fd (t), M (2x + β)2 2x + β 2yz z˙ = (u − Rz) + , α 2x + β

y˙ = g −

(4.115) (4.116)

where α = µ0 N 2 A and β = Lµ11 + Lµ22 . Furthermore, x is the displacement of the isolated mass measured from the magnet pole face, z is the current in the coil, and u is the voltage. The disturbance force is Fd (t). The parameters are as given in Table 4.1. Assume that we want to consider the system’s behavior about the equilibrium point (6.35× −4 10 m, 0m/s, z0 ). Equilibrium Point Find z0 and the corresponding equilibrium input u0 . Accessibility Verify that the system satisfies accessibility conditions at the above equilibrium point. Observability It is difficult, in general, to measure the coil current. We would also like to avoid measuring the rate of change of the air gap. Though we do not build an observer here, check whether the system states are observable from x locally around the equilibrium point.

74

© 2015, J.K. Hedrick and A. Girard

Mass M Area cross section A Coil resistance R Path length in core L1 Path length in mass L2 Permeability of free space µ0 Relative permeability of core µ1 Relative permeability of core µ2 Number of turns N

8.91 kg 0.00025 m2 3.0 Ω 0.28 m 0.05 m 1.26 × 10−6 Hm−1 10,000 100 800

Table 4.1: Parameters for the magnetic suspension of Problem 4.1.

Figure 4.3: Front Wheel Drive Car of Problem 4.2.

Problem 4.2 Consider the front wheel drive car described in Murray and Sastry, Steering Nonholonomic Systems using Sinusoids, IEEE Conference on Decision and Control, 1990. The kinematics of the car are given by x˙ = cos θ cos φu1 , y˙ = sin θ cos φu1 , φ˙ = u2 , 1 θ˙ = sin φu1 , l

(4.117) (4.118) (4.119) (4.120)

where u1 is the velocity of the front wheels in the direction that they are pointing, u2 is the steering velocity, x and y are the Cartesian coordinates of the back wheels, θ is the yaw angle of the car, and φ is the steering wheel angle relative to the car body, as shown in Figure 4.3. Controllability of the Linearization Is the linearized model (about u1 = u2 = x = y = 75

© 2015, J.K. Hedrick and A. Girard

θ = φ = 0) controllable? Accessibility Is the nonlinear system accessible? The following determinant should be useful:   cos θ cos φ cos θ sin φ −k sin θ det  sin θ cos φ sin θ sin φ k cos θ  = k 2 , ∀θ, φ. k sin φ −k cos φ 0

(4.121)

Controllability Is the nonlinear system controllable?

76

© 2015, J.K. Hedrick and A. Girard

Chapter 5 Stability 5.1 5.1.1

Lyapunov Theory Fundamentals and Definitions

We consider the case of unforced, autonomous systems, described by

x˙ = f (x).

(5.1)

We do not consider disturbances, and in a first time we restrict the analysis to systems that do not have an explicit time dependence. We consider equilibrium points of the system, obtained as described in Chapter 1 by solving

f (xe ) = 0.

(5.2)

As previously, we then consider perturbations about the equilibrium points:

x = xe + δx, ∂f δx, δ x˙ ≈ ∂x e ∂f J = . ∂x

(5.3) (5.4) (5.5)

e

As discussed in Chapter 3, if no eigenvalues of J have zero real parts, local stability can be determined from the eigenvalues of J. If at least one eigenvalue has zero real part, the center manifold theorem can be used to determine local stability. In this chapter, we consider the question of global stability. 77

Definition 5.1 (Stability in the Sense of Lyapunov) For simplicity, assume that we consider an equilibrium point at the origin, xe = 0. (If this is not the case, the equilibrium point can be moved to the origin through appropriate coordinate transformation.) The equilibrium xe = 0 is stable if and only if ∀ > 0, ∀t0 ≥ 0, ∃δ(, t0 ) > 0 : ||x(t0 )||2 < δ =⇒ ||x(t)||2 <  ∀t ≥ t0 .

(5.6)

Furthermore, the equilibrium xe = 0 is asymptotically stable if and only if 1. xe = 0 is a stable equilibrium, 2. ∀t0 ≥ 0, ∃δ(t0 ) : ||x(t0 )||2 < δ =⇒ limt→+∞ ||x(t)|| = 0. Finally, the equilibrium xe = 0 is uniformly stable if and only if 1. xe = 0 is a stable equilibrium, 2. δ(, t0 ) = δ(). Stability in the sense of Lyapunov is illustrated in Figure 5.1.

Figure 5.1: Stability in the sense of Lyapunov.

5.1.2

The Second Method of Lyapunov

The second method of Lyapunov was originally proposed by Aleksandr Lyapunov around 1890 to investigate local stability (stability “in the small”), and was later extended to cover 78

© 2015, J.K. Hedrick and A. Girard

global stability (stability “in the large”). Using this method, stability can be determined without explicitly solving for the system solutions, through the generalization of an “energy” argument, possibly to non-energetic systems. The difficulty of the method rests in finding a suitable Lyapunov function. Definition 5.2 A scalar function is said to be positive definite if and only if V (0) = 0 and V (x) > 0 ∀x 6= 0.   x1 Example 5.1 Assume that x = . Note that while x is a vector, V (x) is a scalar x2 function. Let V1 (x) = x21 + x22 .

(5.7)

The scalar function V1 is positive definite. However, let us consider V2 (x) = x21 .

(5.8)

The scalar function V2 is positive, but not definite. For instance, x1 = 0 and x2 = 10 yields V2 = 0. This property is called semi-definiteness. Intuition for the Second Method of Lyapunov Consider a second order system with state variables (x1 , x2 ). Let V (x1 , x2 ) be a positive definite scalar function. Then, if V (x1 , x2 ) always decreases, it must reach zero eventually, as shown in Figure 5.2. Hence, for a stable system, all trajectories must move so that the values of V are decreasing. This is similar to energy arguments for the stability of mechanical systems. To relate V and the system dynamics, we compute V˙ as n



X ∂V ∂V + x˙ i , = ∂t ∂xi i=1

(5.9)

∂V + ∇V T f. ∂t

(5.10)

=

The second term in this expression relates V to the system dynamics. For example, for a second order system, we get     f x˙ f (x) = 1 = 1 , f2 x˙ 2

(5.11)

and 79

© 2015, J.K. Hedrick and A. Girard

Figure 5.2: Intuition for stability in the sense of Lyapunov.

∇V T =

 ∂V ∂x1

∂V ∂x2



.

(5.12)

For our intuitive condition to hold, we need V˙ to be negative definite. Note that V˙ is the rate of change of the scalar field V along the flow of the vector field f , that is, for V = V (x) (and with no explicit dependence on t), V˙ is the Lie derivative of V , as encountered in Chapter 4: ∂V ∂x = Lf V. V˙ = ∂x ∂t

(5.13)

The Second Method of Lyapunov Theorem 5.1 (Lyapunov’s Second Method) Consider the system described by

x˙ = f (x, t),

(5.14)

with f (0, t) = 0 ∀t. If a scalar function is defined such that: 1. V (0, t) = 0, 2. V (x, t) is positive definite, that is, there exists a continuous, non-decreasing scalar function α(x) such that α(0) = 0 and ∀x 6= 0, 0 < α(||x||) < V (x, t), 80

© 2015, J.K. Hedrick and A. Girard

3. V˙ (x, t) is negative definite, that is, V˙ (x, t) ≤ −γ(||x||) < 0, where γ is a continuous non-decreasing scalar function such that γ(0) = 0, 4. V ≤ β(||x||), where β is a continuous non-decreasing function and β(0) = 0, that is, V is decrescent, and the Lyapunov function is upper bounded, 5. V is radially unbounded, that is, α(||x||) → ∞ as ||x|| → ∞, then, the equilibrium point xe = 0 is uniformly asymptotically stable in the large, and V (x, t) is called a Lyapunov function. Remark 5.1 It is very important to note that Theorem 5.1 provides a sufficient condition, not a necessary condition. Remark 5.2 (Relaxed Conditions) 1. Asymptotic stability requires V˙ negative definite; stability requires V˙ negative semidefinite. 2. The condition that V be decrescent yields uniformity for time-varying systems. 3. Global stability is given by the radially unbounded condition. Remark 5.3 The most difficult condition to obtain is that V˙ be negative definite. In many practical cases, V˙ is negative semi-definite, that is, the equilibrium point is stable but not asymptotically stable. Lyapunov Stability in Pictures Here we limit ourselves to autonomous systems (i.e., x˙ = f (x) and not x˙ = f (x, t)). We also limit ourselves to second order systems for ease of representation. The first three conditions in Theorem 5.1 dictate a shape for V as shown in Figure 5.3. A convenient way of visualizing Lyapunov functions is by using level sets, as shown in Figure 5.4. A level set is defined by lC = {x ∈ Rn : V (x) = C} = l(C).

(5.15)

To get intuition into the “radially unbounded” condition, consider the Lyapunov function

V (x) =

x21 + x22 2 1 + x1

(5.16)

for a second order system. The level sets of Lyapunov functions need not be closed contours in general. In our example, the contours are shown in Figure 5.5. In this particular case, for V > 1, tails of the contour trail off to infinity. These can cause stability issues. 81

© 2015, J.K. Hedrick and A. Girard

Figure 5.3: Lyapunov function.

Figure 5.4: Level sets of Lyapunov function.

82

© 2015, J.K. Hedrick and A. Girard

Figure 5.5: Level sets of example Lyapunov function.

Lyapunov Theory for Linear Systems Consider the linear system described by x˙ = Ax.

(5.17)

Assume that we would like to investigate the stability of this system using Lyapunov theory (this may not be the simplest way to do it, but we consider it for the sake of the argument). Let us select V = xT P x,

(5.18)

where P is a positive definite matrix. Then, V˙

= x˙ T P x + xT P x, ˙ T T = x (A P + P A)x.

(5.19) (5.20)

Further let AT P + P A = −Q,

(5.21)

where Q is a positive definite matrix. Then, if Q is positive definite, the linear system is globally asymptotically stable. Equation (5.21) is called the Lyapunov equation. To obtain a (P, Q) pair, one may: 1. Choose a P matrix that is positive definite, compute Q, and check if it is positive definite. This can be a time consuming approach since even if A is stable, not every P > 0 yields a Q > 0. 2. If A is stable, any Q > 0 yields a P > 0. The usual approach is to set Q = I, then solve for P . 83

© 2015, J.K. Hedrick and A. Girard

5.2 5.2.1

LaSalle’s Invariance Theorem, Invariant Sets, and Domains of Attraction LaSalle’s Invariance Principle

As discussed above, it can be difficult in practice to find a Lyapunov function with V˙ negative definite. Often, V˙ is negative semi-definite. A useful theorem, due to LaSalle and called the invariance principle, can be used in this case for autonomous or periodic systems. Theorem 5.2 (LaSalle’s Invariance Principle) Consider a system described by either x˙ = f (x) or x˙ = f (x, t + T ), where T is the period of the system. If V (x, t) = V (x, t + T ), V > 0, and V is radially unbounded, then if in addition V˙ is negative semidefinite (V˙ ≤ 0) and V˙ 6= 0 along any solution of the differential equation except the origin, then the origin is globally uniformly asymptotically stable in the sense of Lyapunov.

Figure 5.6: V˙ = 0 in LaSalle’s Invariance Principle.

The general idea is that trajectories cannot get “hung up” on V˙ = 0, or V constant. To visualize V˙ = 0, consider Figure 5.6. Whenever one of the vectors is tangent to a level set, then V will not decrease at that point in the plane. Note that the V˙ = 0 line is not an invariant set. Example 5.2 (Linear system) Consider the system given by

y˙ 1 = y2 , y˙ 2 = −y1 − ay2 , 84

(5.22) (5.23)

© 2015, J.K. Hedrick and A. Girard

with a > 0. Let us pick V (y) = y12 + y22 . Note that V is positive definite. Let us compute V˙ . Then, V˙

= 2y1 y˙ 1 + 2y2 y˙ 2 , = −2ay22 .

(5.24)

(5.25) (5.26)

Hence, V˙ is negative semi-definite. The system (for linear systems, one does not need to specify “equilibrium point”) is globally stable as per Theorem 5.1. Applying LaSalle’s Invariance Principle, V˙ = 0 =⇒ y2 = 0 =⇒ y˙ 2 = 0 =⇒ y1 = 0.

(5.27)

Therefore, the origin (0, 0) is globally asymptotically stable.

5.2.2

Invariant Sets

A More General Statement for Autonomous Systems Consider an autonomous system x˙ = f (x) with f continuous and let V be a scalar with continuous first partial derivatives. Assume that: 1. For some L > 0, the region ΩL defined by V (x) < L is bounded. 2. For all x in ΩL , V˙ ≤ 0. Then, let R be the set of all points within ΩL where V˙ = 0. Let M be the largest invariant set in R. Then, every solution x(t) originating in ΩL tends to M as t goes to infinity. Corollary (Reference: Slotine and Li) Theorem 5.3 Consider the system x˙ = f (x) with f (0) = 0. Assume that in a neighborhood Ω of the origin, 1. V (x) is locally positive definite, 2. V˙ (x) is negative semi-definite, 3. The set R = {x ∈ Ω : V˙ (x) = 0} contains no solutions to x˙ = f (x) apart for the origin. Then, the origin is asymptotically stable and the largest connected region of the form ΩL = {x ∈ Ω : V (x) < L} and ΩL ⊂ Ω is a domain of attraction. An example of the construction is shown in Figure 5.7. Note that R is not, in general, an invariant set, that is, if you start in R, you don’t necessarily stay in R. 85

© 2015, J.K. Hedrick and A. Girard

Figure 5.7: Construction of ΩL .

Global Invariant Set Theorem Theorem 5.4 Consider the system x˙ = f (x) with f (0) = 0. Assume that in a neighborhood Ω of the origin, 1. V (x) is locally positive definite, 2. V˙ (x) is negative semi-definite, 3. The set R = {x ∈ Ω : V˙ (x) = 0} contains no solutions to x˙ = f (x) apart for the origin. 4. V (x) is radially unbounded. Then, the origin is globally asymptotically stable.

5.2.3

Domains of Atraction

In many applications, it is not enough to determine that a given system has an asymptotically stable equilibrium point. Rather, it is important to find the region or domain of attraction of that point, or at least an estimate of it. Definition 5.3 (Domain of Attraction) Consider the system x˙ = f (x, t) with x(t0 ) = x0 . The domain of attraction of x0 at t0 is the set of all initial conditions x at time t0 , denoted Ωt (t, t0 , x) that satisfies lim Ωt (t, t0 , x) = x0 .

t→+∞

86

(5.28)

© 2015, J.K. Hedrick and A. Girard

For autonomous systems, let x0 = 0. Then, Ω = {x : lim Ωt (x) = 0}. t→+∞

(5.29)

Figure 5.8: Pendulum.

Example 5.3 Consider the pendulum shown in Figure 5.8. We consider first the (nonphysical) case of no friction. Then, the dynamics are given by mL2 θ¨ + mgL sin θ = 0,

(5.30)

g θ¨ + sin θ = 0. L

(5.31)

which can be rewritten as

Without lack of generality, let g/L = 1, so that the dynamics are θ¨ + sin θ = 0.

(5.32)

The equilibrium points are given by θ = ±nπ, θ˙ = 0. 87

(5.33) (5.34) © 2015, J.K. Hedrick and A. Girard

We choose to investigate the stability of the origin, (0, 0). One possible but uninteresting choice of Lyapunov function would be ˙ = θ2 + θ˙2 . V (θ, θ)

(5.35)

Instead, since this is a mechanical system, let us use the energy ˙ = (1 − cos θ) + 1 θ˙2 , V (θ, θ) 2

(5.36)

where the first term is the potential energy and the second term is the kinetic energy of the pendulum. The function is locally positive definite but not radially unbounded, hence results are local and not global. Computing V˙ yields V˙ = sin θθ˙ + θ˙θ¨ = 0

(5.37)

since from the dynamics, θ¨ + sin θ = 0. From a physical perspective, there is no dissipation mechanism, the energy has to be conserved, and therefore V˙ = 0 everywhere was predictable. LaSalle’s Invariance Principle provides no help here as V˙ = 0 everywhere. Adding some viscous damping in the bivot/bearing, the dynamics become θ¨ + k θ˙ + sin θ = 0.

(5.38)

Once again choosing the energy as a Lyapunov function candidate yields ˙ = (1 − cos θ) + 1 θ˙2 . V (θ, θ) 2

(5.39)

However, the expression for V˙ has now changed to V˙ = sin θθ˙ + θ˙θ¨ = −k θ˙2 .

(5.40)

The function V˙ is negative semi-definite, so the system is stable about its (0, 0) equilibrium point. Applying LaSalle’s Invariance Principle yields V˙ = 0 =⇒ θ˙ = 0 =⇒ θ¨ = 0,

(5.41)

V˙ = 0 =⇒ sin θ = 0 =⇒ θ = ±nπ.

(5.42)

and, from the dynamics,

88

© 2015, J.K. Hedrick and A. Girard

We seek ΩL , defined by V < L, that is the largest set of points for which the pendulum does not do a complete turn. A value of L can be obtained by substituting θ = ±nπ and θ˙ = 0 in the expression for V :

  1 ˙2 ˙ ΩL = (θ, θ) : (1 − cos θ) + θ < 2 , 2

(5.43)

as shown in Figure 5.9. The plot is seen in the phase plane in Figure 5.10. The region of attraction is “ellipsoid-looking,” even though it is not technically an ellipse. If the initial conditions are in this region, the pendulum stabilizes at (0, 0) and does not swing over the top.

Figure 5.9: Domain of attraction for pendulum example.

Figure 5.10: Domain of attraction for pendulum example, shown in the phase plane.

The region of attraction obtained here is very conservative, and does not depend on k. Points outside the “ellipse” may still be part of the domain of attraction, depending on k. Other techniques to construct domains of attraction are presented next. 89

© 2015, J.K. Hedrick and A. Girard

Trajectory Reversing Method Theorem 5.5 If x = 0 is an asymptotically stable equilibrium point for x˙ = f (x), then its (exact) region of attraction, Ωa , is an invariant set whose boundaries are formed by trajectories. One method to obtain domains of attraction, called the trajectory reversing method, uses backwards integration, and proceeds in two steps: 1. Find an approximate region Ωc , for instance using V (x) < c. 2. Starting from the boundary of Ωc , integrate x˙ = f (x) backwards in time (i.e., integrate x˙ = −f (x) forward in time). A graphical illustration for the pendulum example is shown in Figures 5.11 and 5.12.

Figure 5.11: Lyapunov function for pendulum example.

Figure 5.12: Trajectory reversing method to calculate the domain of attraction for pendulum example.

90

© 2015, J.K. Hedrick and A. Girard

“Alternative” Method Another method to estimate domains of attraction is due to Khalil and uses a quadratic Lyapunov function. Consider the system x˙ = f (x) with f (0) = 0. Let f (x) = Ax + f1 (x).

(5.44)

Assume that x = 0 is an asymptotically stable equilibrium point of the system. Then A is a stable matrix and has eigenvalues with negative real parts. Let V (x) = xT P x,

(5.45)

where P is a positive definite matrix. Then, V˙ (x) = = = =

x˙ T P x + xT P x, ˙ T T x (A P + P A)x + f1T P x + xT P f1 , xT (AT P + P A)x + 2xT P f1 , −xT Qx + 2xT P f1 .

(5.46) (5.47) (5.48) (5.49)

The xT P f1 and f1T P x terms are scalar, so their transposes are equal, V˙ is a scalar expression, and Q is positive definite. We are looking for the largest domain Ωc , defined by V (x) < c, such that V˙ is negative definite (or V˙ negative semi-definite and LaSalle’s Invariance Principle holds). We know that there is a ball Br = ||x||2 ≤ r such that V˙ is negative definite in Br . Let Ωc be contained in Br by choosing c = min V (x),

(5.50)

||x||2 =r

as shown in Figure 5.13. We have selected V (x) = xT P x, so, using the Rayleigh inequality from Appendix A, λmax (P )||x||22 ≥ V ≥ λmin (P )||x||22 .

(5.51)

c = λmin (P )r2 ,

(5.52)

Let

and assume that f1 is Lipschitz (or at least locally Lipschitz), that is, ||f1 ||2 < γ||x||2 , 91

(5.53) © 2015, J.K. Hedrick and A. Girard

Figure 5.13: Choice of domain in the “alternative” method.

where γ is the Lipschitz constant. (For more details, see Appendix A). Then, recalling that V˙ (x) = −xT Qx + 2xT P f1 ,

(5.54)

we must have that V˙ (x) ≤ −λmin (Q)||x||22 + 2λmax (P )γ||x||22 , ≤ − [λmin (Q) − 2γλmax (P )] ||x||22 .

(5.55) (5.56)

The quantity λmin (Q) − 2γλmax (P ) must be greater than zero. We have not explained how to choose Q yet. We want λmin (Q) to be as large as possible, and λmax (P ) to be as small as possible; that is, we want to maximize the ratio λmin (Q) . λmax (P )

(5.57)

The solution to this problem is to set Q = I, and let AT P + P A = −I. In summary, the procedure for the “alternative” method is: 1. Let x˙ = f (x) = Ax + f1 (x). 2. Solve AT P + P A = −I for P . 3. Set V (x) = xT P x and V˙ (x) = −xT Qx + 2xT P f1 . We want to find the largest ball on which V˙ < 0 (is negative definite), and find the radius r of that ball. 4. Set c = λmin (P )r2 . 5. Obtain Ωc = {x : V (x) < c} = {x : xT P x < λmin (P )r2 }. 92

© 2015, J.K. Hedrick and A. Girard

Example 5.4 Consider the system x˙ 1 = −2x1 + x1 x2 , x˙ 2 = −x2 + x1 x2 .

(5.58) (5.59)

The system has equilibrium points at both (0, 0) and (1, 2). We consider the equilibrium point at (0, 0) here. Linearizing about the origin yields   −2 0 A= 0 −1

(5.60)

with eigenvalues at −1 and −2, and hence from Lyapunov’s first method, the origin is an asymptotically stable equilibrium point. We want to calculate its domain of attraction. Using the “alternative method,” the system is already in the correct form. Solve the Lyapunov equation AT P + P A = −I

(5.61)

for P to yield 

 1/4 0 P = 0 1/2

(5.62)

V (x) = xT P x,

(5.63)

Let

and calculate V˙ as

V˙ (x) = −(x21 + x22 ) +



 1 2 2 x x2 + x1 x2 . 2 1

(5.64)

At this point, transform the Cartesian coordinates (x1 , x2 ) into polar coordinates (ρ, θ), that is, let

x1 = ρ cos θ, x2 = ρ sin θ.

(5.65) (5.66)

In this form, V˙ is 93

© 2015, J.K. Hedrick and A. Girard

  1 V˙ = −ρ + ρ cos θ sin θ sin θ + cos θ , 2 2

3

(5.67)

and we can use approximations to yield



1 3 1 ≤ −ρ + ρ | sin 2θ| sin θ + cos θ , 2 2 √ 5 3 ≤ −ρ2 + ρ, 4 2

(5.68) (5.69)

that is, V˙ ≤ 0 for 4 ρ < √ ≈ 1.8. 5

(5.70)

Let c = λmin (P )r2 ,  2 4 1 √ , = 4 5 = 0.8.

(5.71) (5.72) (5.73)

Then,

Ωc = {x : V (x) < c}, = {xT P x < 0.8},   1 4 1 2 = x : x1 + x2 < 0.8 , 4 2

(5.74) (5.75) (5.76)

as shown in Figure 5.14. Zubov’s Method Zubov’s method yields an exact solution for the domain of attraction. Theorem 5.6 The necessary and sufficient condition for ΩL to be the exact domain of attraction for an equilibrium point is the existence of two scalar functions V and Φ such that: 94

© 2015, J.K. Hedrick and A. Girard

Figure 5.14: Domain of attraction example.

1. V is positive definite and continuous in ΩL , Φ is positive definite and continuous for all x, 2. Within ΩL , 0 ≤ V < L and V (0) = 0, 3. Letting x˙ = f (x), we have V˙ = ∇V T f = Φ(V − L), and V (0) = 0. Note that Φ(x) is an arbitrary positive definite function and is chosen for convenience. Also, the third condition is a partial differential equation for V , ∂V f = Φ(V − L), V˙ = ∂x

(5.77)

with V (0) = 0. Example 5.5 This example is due to Hahn. Consider the second order system given by x˙ = −x + 2x2 y, y˙ = −y,

(5.78) (5.79)

where the first equation is nonlinear but the second is linear and stable. The origin is an equilibrium point, and its domain of attraction can be obtained by solving the PDE ∂V ∂V (2x2 y − x) + (−y) = Φ(V − L) ∂x ∂y

(5.80)

with initial condition V (0) = 0. 95

© 2015, J.K. Hedrick and A. Girard

Let us now select a function Φ(x, y). We pick Φ(x) = x2 + y 2 .

(5.81)

It can be shown that the exact solution for the domain of attraction is then, letting L = 1 and V = 1 define the boundary of Ω1 , x2 y2 V = 1 − exp − − 2 2(1 − xy) 

 ,

(5.82)

and the boundary of ω1 is defined by 1 − xy = 0, or xy = 1, as shown in Figure 5.15.

Figure 5.15: Boundary of domain of attraction obtained using Zubov’s construction method.

5.3

Stability for Time-Varying Systems

We now turn our attention to the stability of time-varying or non-autonomous systems, that is, systems described by x˙ = f (x, t).

(5.83)

Many practical time-varying systems arise from adaptive control problems. Let us consider a simple example. Example 5.6 Let x˙ = u + aw(t),

(5.84)

where a is an unknown constant and w(t) is a known, bounded function. We want x → xd (t) as t → ∞. To this effect, let 96

© 2015, J.K. Hedrick and A. Girard

u = x˙ d − (x − xd ) − a ˆ(t)w(t),

(5.85)

where a ˆ˙ (t) = (x − xd )w(t).We claim that with this control law, x → xd (t) as t → ∞ and a ˆ(t) is bounded, and offer the following sketch of proof. Define error coordinates for the system as e = x − xd , a ˜ = a−a ˆ.

(5.86) (5.87)

e˙ = −e + a ˜w(t), a ˜˙ = −ew(t).

(5.88) (5.89)

The error dynamics are given by

We want to show that x → xd as t → ∞, that is, e → 0 as t → ∞. Consider the Lyapunov function candidate V = e2 + a ˜2 .

(5.90)

This function is positive definite and decrescent. Its derivative is given by V˙ = −2e2 ,

(5.91)

hence the origin (e(0), a ˜(0)) is uniformly stable, that is, e(t) and a ˜(t) are bounded. For time-varying systems, Lyapunov’s send (direct) method requires that V be decrescent for uniform stability of an equilibrium point, and V˙ must be negative definite for asymptotic stability. In the event that V˙ ≤ 0, LaSalle’s Invariance Principle cannot be used for timevarying systems. A new result, Barbalat’s lemma, is sometimes used instead. Proposition 5.1 (Barbalat’s Lemma) If f (t) is differentiable and has a limit, that is, f → L as t → ∞, and if f˙ is uniformly continuous, then f˙ → 0 as t → ∞. Remark 5.4 (Need for uniform continuity condition) Note that f having a limit does not by itself imply that f˙ → 0 as t → ∞. For example, the function f (t) = e−t sin(e2t )

(5.92)

displays sinusoidal decrease to zero in an exponential envelope. Here, f˙ is infinite as t → ∞, reflecting faster and faster oscillations. 97

© 2015, J.K. Hedrick and A. Girard

Remark 5.5 If f¨ exists and is bounded, then f˙ is uniformly continuous. Proposition 5.2 (Lyapunov-Like Lemma (Slotine and Li)) If a scalar function V (x, t) has the following properties: 1. V (x, t) is lower bounded, 2. V˙ is negative semi-definite, 3. V˙ is uniformly continuous, (or V¨ is bounded) then V˙ → 0 as t → ∞. Remark 5.6 This result is very useful, particularly for adaptive systems. Example 5.7 Returning to Example 5.6, we showed earlier that e(t) and a ˜(t) were bounded. Then, if e(t) → 0 and e(t) ˙ → 0 as t → ∞, we must have that a ˜w(t) → 0, and if w(t) 6= 0, then a ˜ → 0 as t → ∞. Example 5.8 (Stability of Invariant Sets other than Equilibrium Sets (Slotine and Li)) Consider the system x˙ 1 = x2 − x1 (x41 + 2x22 − 10), x˙ 2 = −x31 − 3x52 (x41 + 2x22 − 10).

(5.93) (5.94)

We can prove that the set {(x1 , x2 ) : x41 + 2x22 = 10} is invariant, that is, if we start in this set, we stay in this set for all times. Indeed, d 4 (x1 + 2x22 − 10) = −(4x21 + 12x62 )(x41 + 2x22 − 10), dt = 0.

(5.95) (5.96)

To analyze the stability of the invariant set, we pick the Lyapunov function candidate V (x1 , x2 ) = (x41 + 2x22 − 10)2 .

(5.97)

V˙ = −8(x41 + 3x62 )(x41 + 2x22 − 10)2 .

(5.98)

Then,

The first parenthesis in (5.98) is zero at the origin. We can compute the set R to be  R = (0, 0) ∪ (x1 , x2 ) ∈ R2 : (x41 + 2x22 = 10) , 98

(5.99)

© 2015, J.K. Hedrick and A. Girard

Figure 5.16: Invariant set.

Figure 5.17: Set R.

99

© 2015, J.K. Hedrick and A. Girard

as shown in Figures 5.16 and 5.17. Consider L large, for example, Ω100 , that is, V (x) < 100. Then, all trajectories in Ω100 go to x41 + 2x22 = 10, since V > 0, V˙ < 0, and the only invariant set is x41 + 2x22 = 10. Hence the set x41 + 2x22 = 10 is a stable limit cycle. To prove that the origin of the system is unstable, note that V˙ is strictly negative except if x41 + 2x22 = 10

(5.100)

x41 + 3x62 = 0,

(5.101)

or if

in which case V˙ = 0. The first equation simply defines the limit cycle, while the second equation is verified only at the origin. Since both the limit cycle and the origin are invariant sets, the set M simply consists of their union. Thus, all system trajectories starting in the region ΩL converge either to the limit cycle, or to the origin. Moreover, the equilibrium point at the origin can be proven to be unstable. However, this result cannot be obtained from linearization, since the linearized system

x˙ 1 = x2 , x˙ 2 = 0,

(5.102) (5.103)

is only marginally stable. Instead, consider the region Ω100 , and note that while the origin (0, 0) does not belong to Ω100 , every other point in the region enclosed by the limit cycle is in Ω100 ; in other words, the origin corresponds to a local maximum of V . Thus, while the expression for V˙ is the same as before, the set M is just the limit cycle. Therefore, reapplication of the invariant set theorem shows that any state trajectory starting from the region within the limit cycle, excluding the origin, actually converges to the limit cycle. In particular, this implies that the equilibrium point at the origin is unstable. Example 5.9 (Asymptotic Stability with Time-Varing Damping (Slotine and Li)) Consider the second-order system whose dynamics are governed by

x¨ + c(t)x˙ + k0 x = 0,

(5.104)

that can represent a mass-spring-damper system (with mass 1), where c(t) ≥ 0 is a timevarying damping coefficient and k0 is a spring constant. Physical intuition may suggest that the equilibrium point (0, 0) is stable as long as the damping coefficient c(t) remains larger than a strictly positive constant (implying constant dissipation of energy), as in the case for autonomous nonlinear mass-spring-damper systems. However, this is not necessarily true. 100

© 2015, J.K. Hedrick and A. Girard

Indeed, consider the system x¨ + (2 + et )x˙ + x = 0.

(5.105)

One easily verifies that, for instance, with the initial condition x(0) = 2 and x(0) ˙ = 1, the −t solution is x(t) = 1 + e , which tends to x = 1 instead! Here, the damping increases so fast that the system gets “stuck” at x = 1. We can study the asymptotic stability of this class of systems using a Lyapunov analysis. Lyapunov stability of the origin of the system (though not its asymptotic stability) can be easily established by using the mechanical energy of the system as a Lyapunov function. Let us now use a different Lyapunov function to determine sufficient conditions for the asymptotic stability of the origin of the system (5.104). Consider the following positive definite function: (x˙ + αx)2 b(t) 2 + x, 2 2 √ where α is any positive constant smaller than k0 , and V (x, t) =

b(t) = k0 − α2 + αc(t).

(5.106)

(5.107)

The expression for V˙ can be easily computed as α V˙ = (α − c(t))x˙ 2 + (c(t) ˙ − 2k0 )x2 . 2 Thus, if there exist positive numbers α and β such that

(5.108)

c(t) > α > 0

(5.109)

c(t) ˙ ≤ β < 2k0 ,

(5.110)

and

then V˙ is negative definite. Assuming in addition that c is upper bounded (therefore guaranteeing the decrease of V ), the above conditions imply the asymptotic convergence of the origin of the system. It can be shown, that, actually, the technical assumption that c(t) be upper bounded is not necessary. For instance, the origin of the system x¨ + (2 + 8t)x˙ + 5x = 0

(5.111)

is asymptotically stable. 101

© 2015, J.K. Hedrick and A. Girard

5.4

Lyapunov Stability in Pictures

A summary of results on Lyapunov stability can be found in Figures 5.18, 5.19 and 5.20.

Figure 5.18: Summary of Lyapunov stability, Part 1.

5.5

Frequency Domain Stability Criteria

5.6

Further Reading

Khalil, Hahn, Zubov, LaSalle 102

© 2015, J.K. Hedrick and A. Girard

Figure 5.19: Summary of Lyapunov stability, Part 2.

103

© 2015, J.K. Hedrick and A. Girard

Figure 5.20: Summary of Lyapunov stability, Part 3.

104

© 2015, J.K. Hedrick and A. Girard

5.7

Homework Problems

Problem 5.1 (Stability of Phase Portraits) Consider a second order autonomous system x˙ = f (x). For each of the following types of equilibrium points, classify the equilibrium point as stable, asymptotically stable, or unstable. Justify your answers using phase portraits: 1. stable node, 2. unstable node, 3. stable focus, 4. unstable focus, 5. center, 6. saddle point. Problem 5.2 (Lyapunov’s Indirect Method) Lyapunov’s indirect method is useful in studying the stability of equilibria of nonlinear systems by looking at the linear system obtained from the Taylor series expansion of the system about the equilibrium point. However, when the linearized system has eigenvalues on the imaginary axis, once cannot say much about the stability of the original nonlinear system. Consider the system described by: 1 z˙1 = − z2 (z22 + 3z12 ), 4 1 z˙2 = − z1 (z12 + 3z22 ). 4

(5.112) (5.113)

1. Find the equilibrium point(s). 2. Jacobian linearization: Determine the Jacobian at the equilibrium point(s), and see if you can predict anything about the behavior of the original system. 3. Linear transformation: Consider the transformation x = T z where: 

 1/2 1/2 T = 1/2 −1/2

(5.114)

Verify that T is nonsingular – this implies that it is a valid coordinate transformation. Write down the nonlinear dynamics of the system in x coordinates. Can you improve your predictions on the behavior of the system now? Problem 5.3 Consider the damped pendulum of Problem 2.2, where b = 1.5. We seek to determine the region of stability around the origin in the space of (θ, ω) coordinates. 105

© 2015, J.K. Hedrick and A. Girard

1. Energy method (Lyapunov): Use the energy method and the invariance principle to get an estimate of the stability region. 2. Quadratic Lyapunov function: Improve on your previous estimate using a Lyapunov function candidate V = xT P x, where P is the solution of AT P + P A = −I, and A is the Hurwitz matrix from the linear part of the system. Sketch the improved region by hand. (Hint: in the process of finding an improved region such that V˙ < 0, you may need to expand θ − sin(θ) in a Taylor series and transform to polar coordinates θ = ρ cos(φ) and ω = ρ sin(φ).) 3. Time-reversed simulation: Now get your best estimate of the stability region using trajectory reversing techniques (using Matlab/Simulink or your favorite software). Attach the plot (not your hand sketch). Problem 5.4 Consider the system of equations given by x˙ 1 (t) = −x1 (t) − e−2t x2 (t), x˙ 2 (t) = x1 (t) − x2 (t).

(5.115) (5.116)

We select the Lyapunov function candidate V (t, x1 , x2 ) = x21 + (1 + e−2t )x22 .

(5.117)

What can you predict about the behavior of the solutions? Problem 5.5 We use the following statement from Slotine and Li, Applied Nonlinear Control, Theorem 3.5. Theorem 5.7 (Global Invariant Set Theorem) Consider the autonomous system x˙ = f (x) with f continuous, and let V (x) be a positive definite scalar function with continuous first partial derivatives. Assume that V (x) → ∞ as ||x|| → ∞, and that v˙ ≤ 0 over the whole state space. Let R be the set of all points where V˙ = 0 and let M be the largest invariant set in R. Then all solutions globally asymptotically converge to M as t → ∞. Consider the scalar system

x˙ = f (x)θ + u,

(5.118)

where f is a scalar nonlinear function, θ is an unknown constant, and u is any arbitrary input. We have access to the state x and the input u, and we want to identify θ. To this end, we use an educated guess to conjure the following set of dynamic equations. (These design techniques are discussed in Chapters 7 and 8.) 106

© 2015, J.K. Hedrick and A. Girard

First, the following (observer) system is built: xˆ˙ = f (x)θˆ + u + (x − xˆ),

(5.119)

where the “hats” denote estimates. Next, the adaptation law for identifying θ is chosen to be: ˙ θˆ = x˜f (x),

(5.120)

where x˜ = x− xˆ is the state estimation error, and θ˜ = θ− θˆ is the parameter estimation error. Our objective is to show that θˆ → θ and xˆ → x. The following positive definite function is chosen as our Lyapunov function candidate ˜ = 1 x˜2 + V (˜ x, θ) 2

1 ˜2 θ . 2

(5.121)

˜ = −˜ 1. Error dynamics: Obtain equations for the error dynamics, and show that V˙ (˜ x, θ) x2 along the error trajectories. 2. Definiteness of the Lyapunov function candidate: V˙ as given above is only a negative semi-definite (as opposed to definite) function. Why? 3. Invariant set theory: Establish that the set R, as given in the theorem, contains all ˜ such that x˜ = 0. points (˜ x, θ) 4. Largest invariant set: Prove that the largest invariant set M contains only the origin, ˜ = (0, 0). (Hint: If you get stuck, see Example 3.11 page 72 in Slotine and that is (˜ x, θ) ˜ → (0, 0). Li for similar work. Also, use the fact that u is arbitrary). Justify that (˜ x, θ) Is this equivalent to stating that θˆ → θ? Problem 5.6 We start with an example taken from Slotine and Li, Chapter 4. Our goal is to extend its conclusions. The closed loop error dynamics of an adaptive control system for a first order plant with one unknown parameter are e˙ = −e + θw(t), θ˙ = −ew(t),

(5.122) (5.123)

where e and θ are the two states of the closed loop dynamics, representing tracking error and parameter error respectively, and w(t) is a bounded continuous function (in the general case, the dynamics have a similar form, but e, θ and w(t) are vector quantities). Let us analyze the asymptotic behavior of this system. Consider the lower-bounded function 107

© 2015, J.K. Hedrick and A. Girard

V = e2 + θ 2 .

(5.124)

Its derivative is V˙

= 2e(−e + θw(t)) + 2θ(−ew(t)), = −2e2 , ≤ 0.

(5.125) (5.126) (5.127)

This implies that V (t) ≤ V (0), and, therefore, that e and θ are bounded. But the invariant set theorems (for example, LaSalles invariant set theorem) cannot be used because the dynamics are non-autonomous. Instead, we need to apply the “Lyapunov-like lemma” as discussed in class. (This is the same as Lemma 4.3 in Slotine and Li). This lemma applies Barbalat’s lemma, a general result from mathematical analysis, to stability analysis for non-autonomous systems. To use Barbalat’s lemma, let us check the uniform continuity of V˙ . The derivative of V˙ is V¨ = −4e(−e + θw(t)).

(5.128)

Hence V¨ is bounded, since w(t) is bounded by hypothesis and e and θ were shown to be bounded above. Therefore V˙ is uniformly continuous. Applying Barbalat’s lemma, we can conclude that e → 0 as t → ∞. Note that, although e converges to zero, the system is not asymptotically stable, because θ is only guaranteed to be bounded. 1. Parameter convergence: By making the additional assumption that the signal w(t) has bounded derivatives, and that it is bounded away from zero, show that θ → 0. (Hint: Start by using Barbalat’s lemma to show that e˙ → 0.) 2. Vector case: Now consider the vector case e˙ = Ae + bwT (t)θ, θ˙ = −wbT P e,

(5.129) (5.130)

where A is a stable n × n matrix, b is an n × 1 vector, and the n × 1 vectors e, w and θ are as defined previously. P is a symmetric positive definite matrix that satisfies AT P + P A < 0. Assuming that w(t) is a bounded signal, perform analysis similar to that shown above to prove that e → 0. 3. Parameter convergence for the vector case: Prove that the quantity wT (t)θ → 0 if w(t) has bounded derivatives. This should involve roughly the same procedure as in the scalar case, with the appropriate generalizations to deal with the matrix/vector quantities. 108

© 2015, J.K. Hedrick and A. Girard

4. Persistency of excitation: The results obtained above do not imply that θ → 0. Let us now suppose that there exist strictly positive constants, α and T , such that for all t > 0,

t+T

Z

w(τ )wT (τ ) dτ ≥ αI.

(5.131)

t

First use the parameter update law to show that θ˙ → 0. Note that θ˙ → 0 does not imply that θ(t) converges to a constant. (See Section 4.5 in Slotine and Li for some simple examples of this.) However, we can argue (mathematically) that θ(t) looks roughly like a constant as t → ∞. To simplify the proof, use the additional assumption that θ0 = limt→∞ θ(t) exists. (The ambitious student can prove the result without this ˙ assumption and using only θ(t) → 0). Based on these assumptions, show that the integral condition is sufficient to assure that θ(t) → 0. (You may want to read Section 8.2, Parameter Convergence Analysis in Slotine and Li). In other words, the given integral condition assures parameter convergence. In this case, the (regressor) signal w(t) is said to be persistently exciting. Generally speaking, persistency of excitation is a requirement for parameter convergence in adaptive control. Problem 5.7 (Circle Criterion) Study absolute stability, using the circle criterion, for each of the transfer functions given below. In each case, estimate the largest sector [α, β] for which the system is absolutely stable. 1. G(s) =

s2

s , −s+2

(5.132)

2. G(s) =

1 . (s + 1)(s + 3)

(5.133)

For the second plant, consider the case where α = 0 as well as the case where α < 0.

Problem 5.8 (Popov Criterion) Consider the feedback loop shown in Figure 5.21, where ψ is a time-invariant nonlinearity and the plant is given by

G(s) =

2(s − 1) . (s + 2)(s + 3)

(5.134)

The system is absolutely stable for the sector [0, β] if there exists η ≥ 0 such that 109

© 2015, J.K. Hedrick and A. Girard

Figure 5.21: Standard form of system for Popov analysis.

Z(s) = 1 + (1 + ηs)βG(s)

(5.135)

is strictly positive real. Equivalently, the system is absolutely stable if there exists η ≥ 0 such that 1 + Re(G(jω)) − ηω Im(G(jω)) > 0 β

(5.136)

for all ω. Graphically, if the Popov plot lies to the right of the line of slope 1/η (for some η ≥ 0) and crossing the horizontal axis at −1/β, then the feedback system is asymptotically stable for all ψ that lie in the sector [0, β]. Use a Popov plot to estimate the largest sector for which we can guarantee absolute stability. Generally, the results obtained from the Popov criterion are more conservative than those obtained by using the Nyquist criterion. Use a Nyquist plot to estimate the largest region of linear gains (that is, ψ(e) = ke, where k is the linear gain) for which the system is stable. For this particular plant, how does the Popov result compare with the Nyquist result?

110

© 2015, J.K. Hedrick and A. Girard

Part II Nonlinear Control Techniques

111

We now turn our attention to consider nonlinear control system design techniques. We start by describing some general issues involved in nonlinear control system design, emphasizing differences between linear and nonlinear control design problems. In the next chapters, we will consider a sampling of specific control methods available to designers. The objective of control design can be stated as follows: given a physical system to be controlled and the specifications of its desired behavior, construct a feedback control law to make the closed-loop system display the desired behavior. If the tasks of a control system involve large range and/or high-speed motions, nonlinear effects may be significant in the dynamics, and nonlinear control may be necessary to achieve the desired performance. Generally, the tasks of control systems can be divided into two categories, stabilization (or regulation), and tracking. In stabilization problems, a control system, sometimes called a stabilizer or a regulator, is designed so that the state of the closed-loop system is stabilized about an equilibrium point. Examples of stabilization tasks are altitude control of an airplane or position control of robot arms. In tracking control problems, the objective is to construct a controller (or tracker) such that the system output tracks a given time-varying trajectory. Problems such as making an aircraft fly along a specified path or making a robot hand draw straight lines or circles are typical tracking control tasks. Definition 5.4 (Asymptotic Stabilization Problem) Given a nonlinear dynamic system described by x˙ = f (x, u, t),

(5.137)

find a control law u such that, starting from anywhere in a region Ω, the state x tends to 0 as t → ∞. If the control law depends on the measurement signals directly, it is called a static control law. If it depends on the measurement through a differential equation, the control law is called dynamic, that is, there are dynamics in the control law. For example, in linear control, a proportional controller is a static controller, while a lead-lag controller is a dynamic controller. In the definition, we allow the size of the region Ω to be large; otherwise, the stabilization problem may be adequately solved using linear control. Also, if the objective is to drive the state to some non-zero set point, xd , we simply transform the problem by redefining the state as x − xd . 113

Definition 5.5 (Asymptotic Tracking Problem) Given a nonlinear dynamic system described by

x˙ = f (x, u, t), y = h(x),

(5.138) (5.139)

and a desired output trajectory, yd , find a control law for the input u such that starting from any state in a region Ω, the tracking errors y(t) − yd (t) go to zero, while the whole state x remains bounded. From a practical point of view, one may require that x actually remain “reasonably” bounded, and, in particular, within the range of validity of the system model. This may be verified analytically or in simulations. When the closed-loop system is such that proper initial states imply zero tracking error for all times, y(t) ≡ yd (t) ∀t ≥ 0,

(5.140)

the control system is said to be capable of perfect tracking. Asymptotic tracking implies that perfect tracking is asymptotically achieved. Exponential tracking convergence can be defined similarly. Throughout the rest of the notes, unless otherwise specified, we make the (mild) assumption that the desired trajectory yd and its derivatives up to a sufficiently high order (generally equal to the system’s order) are continuous and bounded. We also assume that yd (t) and its derivatives are available for online control computation. This latter assumption is generally satisfied by control tasks where the desired output yd (t) is planned ahead of time (for example, robot tracking tasks). Smooth time-histories are often generated themselves through a filtering process, automatically providing higher derivatives of the desired output. In some tracking tasks, however, the assumption is not satisfied, and a so-called reference model may be used to provide the required derivative signals. For example, in designing a tracking control system for the antenna of a radar to closely point towards an aircraft at all times, we only have the position of the aircraft ya (t) at a given time instant (assuming it is too noisy to be numerically differentiated). We can generate the desired position, velocity and acceleration to be tracked by the antenna using the second-order dynamics

y¨d (t) + k1 y˙ d + k2 yd = k2 ya (t),

(5.141)

where k1 and k2 are chosen positive constants. Then, the problem of following the aircraft is translated into the problem of tracking the output yd (t) of the reference model. The 114

© 2015, J.K. Hedrick and A. Girard

reference model serves the dual purpose of providing the desired output of the tracking system in response to the aircraft position measurements, and generating the derivatives of the desired output for tracker design. For the approach to be effective, the filtering process should be fast enough for yd (t) to closely approximate ya (t). Normally, tracking problems are more difficult to solve than stabilization problems, because in tracking problems the controller should not only keep the whole state stabilized, but also drive the system output towards the desired output. However, the two classes of problems are often related. For example, if we are to design a tracker for the plant

y¨ + f (y, ˙ y, u) = 0

(5.142)

such that e(t) = y(t) − yd (t) goes to zero, the problem is equivalent to the asymptotic stabilization of the system

e¨ + f (e, ˙ e, u, yd , y˙ d , y¨d ) = 0

(5.143)

whose state components are e and e. ˙ Clearly, the tracker design problem is solved is we know how to design a tracker for (5.143). Stabilization problems can often be regarded as a special case of tracking problem, with the desired trajectory being a constant. In model reference control, for example, a set point regulation problem is transformed into a tracking problem by incorporating a reference model to filter the supplied set point value and generate a time-varying output as the ideal response for the tracking control system. Desired Behavior In linear control, the desired behavior of a control system can be systematically specified, wither in the time domain (rise time, overshoot, settling time for a step command) or in the frequency domain (bandwidth, gain margin, phase margin). In linear control design, one first lays down the quantitative specification of the closed-loop system, and then synthesizes a controller that meets these specs. However, for nonlinear systems (except those equivalent to linear systems), systematic specification is much less obvious because the response of a nonlinear system to one command may not reflect its response to another command, and furthermore a frequency domain description is not possible. As a result, for nonlinear systems, one often looks instead for some qualitative specifications of the desired behavior in the operating region of interest. Computer simulation is an important complement to analytical tools in determining whether such specifications are met. A designer can consider the following characteristics: 1. Stability must be guaranteed for the nominal model (the model used for design), either in a local sense or in a global sense. The region of stability and convergence are also of interest. 115

© 2015, J.K. Hedrick and A. Girard

2. Accuracy and speed of response may be considered for some typical motion trajectories in the region of operation. For some classes of systems, appropriate controller design can guarantee consistent tracking accuracy independent of the desired trajectory. 3. Robustness is the sensitivity to effects not considered in the design, such as disturbances, measurement noise, unmodeled dynamics etc. The system should be able to withstand these neglected effects when performing the tasks of interest. 4. Cost of a control system is determined mainly by the number and type of actuators, sensors and computers necessary to implement t. Remarks: First, stability does not imply the ability to withstand persistent disturbances of even small magnitude. The reason is that stability of a nonlinear system is defined with respect to initial conditions, and only temporary disturbances may be translated as initial conditions. For example, a stable control system may guarantee an aircraft’s ability to withstand gusts, while being inept at handing wind shears of even small magnitude. This is different from linear control, where stability always implies the ability to withstand bounded disturbances (assuming that the system stays in its linear range). The effects of persistent disturbances on nonlinear system behavior are addressed by the concept of robustness. Second, the above qualities conflict to some extend, and a good control system often required effective trade offs.

116

© 2015, J.K. Hedrick and A. Girard

Chapter 6 Feedback Linearization Feedback linearization is an approach to nonlinear control design that has attracted lots of research in recent years. The central idea is to algebraically transform nonlinear systems dynamics into (fully or partly) linear ones, so that linear control techniques can be applied. This differs entirely from conventional (Jacobian) linearization, because feedback linearization is achieved by exact state transformation and feedback, rather than by linear approximations of the dynamics. The basic idea of simplifying the form of a system by choosing a different state representation is not completely unfamiliar; rather it is similar to the choice of reference frames or coordinate systems in mechanics.

6.1 6.1.1

Single-Input, Single-Output Systems Input-Output Linearization

Consider a single-input, single-output (SISO) nonlinear system of the form x˙ = f (x) + g(x)u, y = h(x),

(6.1) (6.2)

where x ∈ Rn and u and y are scalars. Then, ∂h x, ˙ ∂x = dh.(f + gu), = Lf h + Lg hu.

y˙ =

(6.3) (6.4) (6.5)

If Lg h = 0, we keep taking derivatives of y until the output u appears. Note that if the output never appears, then u does not affect the output! Taking the second derivative of y yields 117

d (Lf h), dt = L2f h + Lg (Lf h).u.

y¨ =

(6.6) (6.7)

Assuming Lg (Lf h) = 0, we obtain y = h(x) = L0f h,

(6.8)

y˙ = L1f h + Lg hu = L1f h, L2f h

Lg (L1f h)u

L2f h,

= + y¨ = .. . . = .., y (r) = Lrf h + Lg (Lr−1 f h)u = v,

(6.9) (6.10) (6.11) (6.12)

where Lg (Lr−1 f h) 6= 0. The letter r designates the relative degree of y=h(x), that is, the n lowest integer for which Lg (Lr−1 f h) 6= 0 in a region of R where we want to do control. Let α(x) = Lrf h(x), β(x) =

(6.13)

Lg (Lr−1 f h).

(6.14)

Then, dr y = α(x) + β(x)u, dtr

(6.15)

where β(x) 6= 0. The quantity v(x) = α(x) + β(x)u is called the synthetic input or synthetic control ; we have y (r) = v.

(6.16)

We have an r-integrator linear system, as shown in Figure 6.1, of the form Y (s) 1 = r. V (s) s

(6.17)

We can now design a controller for this system, using any linear controller design method. The physical control u is related to the synthetic control v by 118

© 2015, J.K. Hedrick and A. Girard

Figure 6.1: Linear relationship between y and v.

u(x) =

1 (v − α(x)). β(x)

(6.18)

Any linear method can be used to design v. For example,

v1 = −

r−1 X

ck Lkf h,

(6.19)

k=0

which yields dr y dr−1 y + cr−1 r−1 + · · · + c0 y = 0, dtr dt

(6.20)

or

v2 = −

r−1 X k=0

ck Lkf h

  Z 1 τ + Kc (yd − y) + (yd − y) dt , τ 0

(6.21)

which yields   Z dr y dr−1 y 1 τ + cr−1 r−1 + · · · + c0 y = Kc (yd − y) + (yd − y) dt , dtr dt τ 0

(6.22)

and Kc and τ are PI parameters that can be tuned online to allow tracking and account for model error. One can foresee problems with this approach: 1. It requires a perfect model, with perfect derivatives (one can anticipate robustness problems). 2. If r < n, we have internal dynamics. 119

© 2015, J.K. Hedrick and A. Girard

Internal Dynamics Assume r < n and that there are some internal dynamics. We know that dk y = Lkf h, k = 0, ..., r − 1. k dt

(6.23)

The “linearized part” of the system is in a canonical form, that is, let   z1 z2    z =  ..  , . zr

(6.24)

where z1 = y = L0f h,

(6.25)

L1f h,

(6.26)

z2 = y˙ = .. . . = .., zr = y (r−1) = Lr−1 f h,

(6.27) (6.28)

and

z˙r = α(x) + β(x)u = v.

(6.29)

z˙ = Az + Bv,

(6.30)

Then,

where A and B are in controllable canonical form, that is,  0 0   A =  ...  0 0

0 1 .. .

··· 0 .. .

0 ··· 0 ···

0 0

1 0 .. .

 0 · · ·  ..  , .   1 0

(6.31)

and 120

© 2015, J.K. Hedrick and A. Girard

  0 0     B =  ...  .   0 1

(6.32)

If r < n we have decoupled a subspace of Rn , namely an r-dimensional subspace z ∈ Rr . Clearly we need to be concerned about the rest of the “internal” dynamics. Let   z x= . ξ

(6.33)

The normal forms theorem (REFERENCE?) tells us that there exists a nonsingular ξ such that: ξ˙ = ψ(z, ξ).

(6.34)

Note that the internal dynamics are not a function of u. Thus ξ˙ = ψ(z, ξ) defines the unobservable internal dynamics whose stability must be evaluated. This can be difficult to   z do. Note that it is not a problem if x = produces ξ ξ˙ = ψ(z, ξ, u),

(6.35)

because we have designed u = f (z), so that ψ˙ = ψ(z, ξ). A special case of internal dynamics is called the zero dynamics, that is, the case when z = 0 =⇒ ξ˙ = ψ(0, ξ).

(6.36)

Clearly the stability of (6.36) is easier to check than for a general z(t). It is straightforward to show that for linear systems x˙ = Ax + Bu, y = Cx,

(6.37) (6.38)

the eigenvalues of the zero dynamics are the transfer function zeroes of H(s) = Y (s)/U (s) = C(sI − A)−1 B.

(6.39)

Thus a non-minimum phase linear system would have unstable zero dynamics. Therefore by analogy we define a minimum phase nonlinear system as one whose zero-dynamics are stable [?]. 121

© 2015, J.K. Hedrick and A. Girard

Input/Output Linearization Procedure Consider the system described by x˙ = f (x) + g(x)u, y = h(x).

(6.40) (6.41)

Input/Output Feedback Linearization proceeds as follows: 1. Differentiate y until the first time u appears in the equation for one of the derivatives of r,

y (r) = α(x) + β(x)u.

(6.42)

y (r) = v,

(6.43)

2. Choose u to yield

where v is the synthetic input, and

u=

1 (−α(x) + v) . β(x)

(6.44)

3. Then the system has the form Y (s) 1 = r. V (s) s

(6.45)

Design a linear controller for this r-integrator linear system. 4. Check the internal dynamics for stability. Example 6.1 (Non-minimum Phase Dynamic System) Consider the system x˙ 1 = x2 + x31 + u, x˙ 2 = −u, y = x1 .

(6.46) (6.47) (6.48)

Then, 122

© 2015, J.K. Hedrick and A. Girard

y˙ = x˙ 1 , = x2 + x31 + u, , v.

(6.49) (6.50) (6.51)

Then, u appears in the first derivative of y, r = 1, and let y˙ = v = x2 + x31 + u.

(6.52)

u = −x2 − x31 + v,

(6.53)

We also have

and in our notation, α(x) = x31 + x2 and β(x) = 1. We now select a control law for the r-integrator system. Assuming we want to send y to zero exponentially, let us select, for instance, v = −λy,

(6.54)

y˙ = −λy.

(6.55)

u = −λy − y 3 − x2 ,

(6.56)

x˙ 2 = x2 + λy + y 3 = x2 + λx1 + x31 .

(6.57)

that is,

We have

that is,

The zero dynamics (for y = x1 = 0) are unstable, and the original nonlinear dynamic system is non-minimum phase. Remark 6.1 If the internal dynamics are unacceptable, then we can: 1. Try and find a different output with the same relative degree, but better internal dynamics. 2. Try and find a transformation that has no internal dynamics (called input/state). 123

© 2015, J.K. Hedrick and A. Girard

6.1.2

Input/State Linearization (SISO Systems)

Consider again the system x˙ = f (x) + g(x)u,

(6.58)

where x ∈ Rn and u is a scalar. We study the existence of a transformation z = φ(x) such that z ∈ Rn , φ is a diffeomorphism (a one to one transformation between z and x), and the transformed system is linear, that is, z˙ = Az + Bv,

(6.59)

v = α(x) + β(x)u,

(6.60)

with

v ∈ R, and β(x) 6= 0. We can further require that the system be in Brunowski (controllable) form, that is,  0 0   A =  ...  0 0

0 1 .. .

··· 0 .. .

0 ··· 0 ···

0 0

1 0 .. .

 0 · · ·  ..  , .   1 0

(6.61)

and   0 0     B =  ...  ,   0 1

(6.62)

where A is n × n and B is n × 1. We first consider the existence of a scalar output y = z1 (x) such that y has relative degree n. If y = z1 (x), then ∂z1 x, ˙ ∂x ∂z1 = (f + gu), ∂x = Lf z1 (x) + Lg z1 u.

z˙1 =

124

(6.63) (6.64) (6.65)

© 2015, J.K. Hedrick and A. Girard

We want z˙1 to be a function of x only, and not x and u. Therefore, we require that Lg z1 = 0, and we have z˙1 = z2 = Lf z1 ,

(6.66)

   0  Lf z1 z1 z2  L1 z1    =  f . .. .. . .

(6.67)

and

This suggests a structure in the transformation. Taking additional derivatives, d 1 (L z1 ), dt f = L2f z1 + (Lg L1f z1 )u, = z3

z˙2 =

(6.68) (6.69) (6.70)

if Lg (L1f z1 ) = 0. Continuing the pattern as we want relative degree n yields z˙n−1 = zn

(6.71)

if Lg (Ln−2 z1 ) = 0, and f z˙n = Lnf z1 + Lg (Ln−1 z1 )u, f = α(x) + β(x)u , v,

(6.72) (6.73)

with Lg (Ln−1 z1 ) 6= 0. Therefore, we are searching for a scalar z1 (x) such that: f Lg (Lkf z1 ) = 0

(6.74)

Lg (Ln−1 z1 ) 6= 0. f

(6.75)

   0  Lf z1 z1  ..   ..  z = φ(x) =  .  =  .  , z1 Ln−1 zn f

(6.76)

for k = 0, ..., n − 2, and

This yields

125

© 2015, J.K. Hedrick and A. Girard

and furthermore

z˙ = Az + Bv,

(6.77)

which is linear with no internal dynamics. Is there a test to determine the existence of z1 ? There is, and it depends on f and g as x˙ = f (x)+g(x)u. To obtain the test, we need to use two standard results from mathematics, Jacobi’s identity and the theorem of Frobenius, which we present in turn. Jacobi’s Identity A convenient relationship [8] is called Jacobi’s identity: Ladf g (h) = Lf Lg (h) − Lg Lf (h).

(6.78)

adif g = [f, adi−1 f g],

(6.79)

ad1f g = [f, ad0f g] = [f, g].

(6.80)

Remember,

so

Repeated use of this identity allows us to keep the conditions in first order in z1 . For k = 0, we have Lg (L0f z1 ) = Lg (z1 ) = 0,

(6.81)

∂z1 ∂z1 ∂z1 g1 + g2 + ... + gn = 0, ∂x1 ∂x2 ∂xn

(6.82)

that is,

 T where g = g1 · · · gn . Equation (6.82) is a first order partial differential equation (PDE) for z1 . For k = 1, we have Lg (L1f z1 ) = 0,

(6.83)

that is, 126

© 2015, J.K. Hedrick and A. Girard

 Lg

∂z1 ∂z1 ∂z1 f1 + f2 + ... + fn ∂x1 ∂x2 ∂xn

 = 0,

(6.84)

which can be written as  ∇

 ∂z1 ∂z1 ∂z1 f1 + f2 + ... + fn .g = 0. ∂x1 ∂x2 ∂xn

(6.85)

The resulting equation is a second-order PDE in z1 , and larger values of k yield higher order PDEs. However, by repeated use of Jacobi’s identity [8], we have ∀k ∈ [0, n − 2], Lg (Lkf z1 ) = 0 ⇔ Ladkf g z1 = 0

(6.86)

This can be rewritten as  ∇z1 · g adf g · · ·

adn−2 g f

T

= 0.

(6.87)

The advantage of this transformation is that all the PDEs in (6.87) are first order in z1 . The Theorem of Frobenius Theorem 6.1 (Theorem of Frobenius) Given the system x˙ = f (x)+g(x)u, with u scalar, there exists a scalar z1 (x) of relative degree n that is a solution to (6.87), or ∀k ∈ [0, n − 2], Ladkf g z1 = 0, if and only if:  1. g adf g · · ·

adn−1 g f

T

has rank n,

 2. g adf g · · ·

adn−2 g f

T

is involutive.

(6.88)

Definition 6.1 (Involutive) A linear independent set of vectors (f1 , · · · , fm ) is involutive if and only if

∀i, j ∈ N, ∃αijk , [fi , fj ] =

m X

αijk (x)fk (x),

(6.89)

k=1

that is, when you take Lie brackets of vectors in the set, no new vectors are generated. 127

© 2015, J.K. Hedrick and A. Girard

Remark 6.2 In practice, it is often hard to find z1 . Example 6.2 We revisit Example 6.1 in light of our new theory. Recall that we have x˙ 1 = x2 + x31 + u, x˙ 2 = −u,

(6.90) (6.91)

  x2 + x31 , f= 0

(6.92)

and hence n = 2,

and 

 1 g= . −1

(6.93)

We seek a scalar z1 (x1 , x2 ) of relative degree be 2. Frobenius’ theorem indicates that such a scalar exists if and only if 1. [g, [f, g]] has rank 2, 2. g is involutive. The second condition is met trivially in this case. Considering the first condition yields     1 −3x21 + 1 g [f, g] = , 1 0

(6.94)

since ∂g ∂f f− g, ∂x  ∂x   2   0 0 x2 + x31 3x1 1 1 = − . 0 0 0 0 0 −1

[f, g] =

(6.95) (6.96)

Therefore, [g, [f, g]] has rank 2 as long as √ x1 6= ±

3 . 3

(6.97)

To find z1 , we only have one term to consider since n = 2, that is, 128

© 2015, J.K. Hedrick and A. Girard

∇z1 · g = 0,

(6.98)

that is,

 ∂z1 ∂x1

∂z1 ∂x2





 1 = 0, −1

(6.99)

and hence ∂z1 ∂z1 = . ∂x1 ∂x2

(6.100)

z1 = x1 + x2

(6.101)

By inspection,

meets the condition. Let us check that it has relative degree 2: z1 = x1 + x2 , z˙1 = x˙ 1 + x˙ 2 , = x2 + x31 , = z2 , z¨1 = z˙2 , = x˙ 2 + 3x21 x˙ 1 , = 3x21 (x2 + x31 ) + (3x21 − 1)u.

(6.102) (6.103) (6.104) (6.105) (6.106) (6.107) (6.108)

Hence u appears for the first time in the second derivative of z1 , and z1 indeed has relative degree 2. We can now use the same procedure as for I/O feedback linearization. We have z1 = x1 + x2 , z˙1 = x2 + x31 , z¨1 = 3x21 (x2 + x31 ) + (3x21 − 1)u, , v.

(6.109) (6.110) (6.111) (6.112)

 1 2 3 v − 3x (x + x ) . 2 1 1 3x21 − 1

(6.113)

Hence,

u=

129

© 2015, J.K. Hedrick and A. Girard

A possible choice of control for this problem may be to let z1d be constant, and choose v = −c1 z˙1 − c2 (z1 − z1d ),

(6.114)

z¨1 + c1 z˙1 + c2 z1 = c2 z1d .

(6.115)

yielding

However, the original problem required control of y = x1 , not z1 = x1 + x2 . We can write z1d = x1d + x2d ,

(6.116) √ let x1d be chosen as in the previous example (and away from ± 3/3), and, since we want z˙1d = 0 (from z1d constant), we have x2d + x31d = 0.

(6.117)

z1d = x1d − x31d ,

(6.118)

Therefore,

as shown in Figure 6.2.

6.2

Feedback Linearization for MIMO Nonlinear Systems

For multiple-input, multiple-output (MIMO) nonlinear systems and their feedback linearization, the ideas are similar to the SISO case, even though the notation can get cumbersome quickly. To attempt to alleviate this somewhat, let us consider a square system (where the number of inputs is equal to the number of outputs = m). We have

x˙ = f +

m X

gi ui ,

(6.119)

1

y =

 h1 · · ·

hm

T

.

(6.120)

Then,

∀k ∈ [1, m], y˙ k = Lf hk +

m X

Lgi hk uk .

(6.121)

i=1

130

© 2015, J.K. Hedrick and A. Girard

Figure 6.2: Behavior of x1 and x2 in Example 6.2.

Let rk be the relative degree of each output, that is, at least for some i, Lgi (Lrfk −1 hk ) 6= 0.

(6.122)

Let J(x) be an m × m matrix such that Lg1 (Lrf1 −1 h1 )  .. J(x) =  . 

 Lgm (Lrf1 −1 h1 )  .. . .

··· .. .

Lg1 (Lfrm −1 hm )

(6.123)

Lgm (Lrfm −1 hm )

···

J(x) is called the invertibility matrix or decoupling matrix, and we assume that it is nonsingular. Let dr1 y1 dtr1

  yr = 

.. .

drm ym dtrm

  ,

(6.124)

where y r is an m × 1 vector, nd  Lrf1 h1   l(x) =  ...  , 

(6.125)

Lrfm hm 131

© 2015, J.K. Hedrick and A. Girard

where l(x) is also an m × 1 vector. Then we have: y r = l(x) + J(x)u = v,

(6.126)

where v is the synthetic input (v is m × 1), and the “physical” input, u, is given by u = J −1 (v − l).

(6.127)

We obtain m decoupled integrator chains, dr1 y1 = v1 , dtr1 .. . . = .., drm ym = vm . dtrm

(6.128) (6.129) (6.130)

The synthetic input v can be chosen many different ways using linear design techniques. Potential difficulties with this technique include the facts that the model needs to be “good enough”, and there may be internal dynamics.

6.2.1

Internal Dynamics

The notation gets complicated, but the principles are the same as in the SISO case. If m X

rk , rT < n,

(6.131)

k=1

we have “unobservable” internal dynamics of order n − rT . We can place the system into the form z1i = hi , z˙1i = z2i , .. . . = .., z˙ri i = Lrfi hi +

(6.132) (6.133) (6.134) m X

Lgk Lrfi −1 hi uk , vi ,

(6.135)

k=1

for i ∈ [1, m]. The superscript notation denotes which output we are considering. We write 132

© 2015, J.K. Hedrick and A. Girard



 z11  ..   .   r1   z1   .   .   .   1  x =  zm , .   ..z rm   m   ξ   1   ..   .  ξn−rT

(6.136)

and we have

z˙ = Az + Bv, ξ˙ = ψ(ξ, z) + P (ξ, z)u, y r = l(x) + J(x)u = v,

(6.137) (6.138) (6.139)

where z is r × 1 and ξ is (n − rT ) × 1. Note that the representation for x may not be unique. Furthermore, unlike in the SISO case, u appears in the internal dynamics. The zero dynamics are defined by z = 0. We had y r = l + Ju,

(6.140)

u∗ = −J −1 l.

(6.141)

and if z = 0, then y r = 0, and

The output is identically equal to zero if we set the control equal to zero (at all times). Thus, the zero dynamics are given by ξ˙ = ψ(ξ, 0) − P (ξ, 0)J −1 (ξ, 0)l(ξ, 0),

(6.142)

and their stability can be checked. If difficult, the linearized zero dynamics, ¯ ξ˙ = Aξ,

(6.143)

133

© 2015, J.K. Hedrick and A. Girard

can be checked for stability.

6.2.2

Dynamic Extension

If J(x) is singular, a dynamic extension algorithm can often be used to generate a nonsingular decoupling matrix by adding a dynamic compensator [8]. Example 6.3 We consider the steering of an axle, as taken from John Hauser’s PhD Dissertation, UCB, 1989 [?].

Figure 6.3: Steering control of axle.

The dynamics are x˙ 1 = (cos ψ)u1 , x˙ 2 = (sin ψ)u1 , ψ˙ = u2 ,

(6.144) (6.145) (6.146)

where ψ is the yaw angle of the vehicle, x1 and x2 are the Cartesian locations of the wheels, u1 is the velocity of the front wheels, in the direction that they are pointing, and u2 is the steering velocity. We showed in Chapter 4 that the system is controllable (f = 0). We take the outputs to be y1 = x1 , y2 = x2 , and the dynamics in matrix form are      y˙ 1 cos ψ 0 u1 = , y˙ 2 sin ψ 0 u2   u = J 1 . u2

(6.147) (6.148)

The matrix J is clearly singular (it has rank 1). 134

© 2015, J.K. Hedrick and A. Girard

Let us extend the state by considering u1 = x3 , u˙ 1 = x˙ 3 = u3 , where u3 is the acceleration of the axle. Then, letting the state be [x1 x2 x3 ψ]T , we have x˙ 1 x˙ 2 x˙ 3 ψ˙

= = = =

(cos ψ)x3 , (sin ψ)x3 , u˙ 1 = u3 , u2 ,

(6.149) (6.150) (6.151) (6.152)

and in standard form,       x3 cos ψ 0 0  x3 sin ψ  0 0      f =  0  , g1 = 1 , g2 = 0 , 0 0 1

(6.153)

x˙ = f + g1 u3 + g2 u2

(6.154)

where

in the extended state space. As stated above, let y1 = x1 and y2 = x2 . Then,      y¨1 cos ψ −u1 sin ψ u3 = , y¨2 sin ψ u1 cos ψ u2   u = Jnew 3 . u2

(6.155) (6.156)

and the Jnew (x) matrix is non-singular for u1 > 0 (as long as the axle is moving). Let us design a controller for this example. Let y¨1 = v1 , y¨2 = v2 .

(6.157) (6.158)

Then,      v1 cos ψ −u1 sin ψ u3 = , v2 sin ψ u1 cos ψ u2   u = Jnew 3 . u2 135

(6.159) (6.160)

© 2015, J.K. Hedrick and A. Girard

Given y1d (t) and y2d (t), a decoupling control law, for example, v1 = −c1 y˙ 1 − c2 (y1 − y1d ), v2 = −c3 y˙ 2 − c4 (y2 − y2d )

(6.161) (6.162)

ensures that y1 → y1d and y2 → y2d . The control u is given by     u3 v −1 = Jnew (x) 1 . u2 v2

(6.163)

Note that we have a dynamic feedback controller (the controller has dynamics, not just gains, in it).

6.3 6.3.1

Feedback Linearization: A Review Input/Output Feedback Linearization

Consider the system

x˙ = f (x) + g(x)u, y = h(x) = L0f h.

(6.164) (6.165)

Then, y˙ = L1f h + Lg (L0f h)u.

(6.166)

Assume that for k = 0, · · · , r − 2, we have Lg (Lkf h) = 0,

(6.167)

df y = Lkf h, dtk

(6.168)

Lg (Lr−1 f h) 6= 0.

(6.169)

that is, we have

and further assume that

136

© 2015, J.K. Hedrick and A. Girard

The integer r is the relative degree of y. (Note: r ≤ n, where x ∈ Rn . Assume for now that r < n.) Then, dr y = Lrf h + Lg (Lr−1 f h)u, dtr = α(x) + β(x)u, = v.

(6.170) (6.171) (6.172)

Then, u=

1 (−α(x) + v). β(x)

(6.173)

The process is summarized in block diagram form for a SISO system in Figure 6.4. To simplify the picture, it was assumed that β(x) = 1.

Figure 6.4: Summary of SISO I/O Feedback Linearization Process.

Next, we must consider the internal dynamics. Because r < n, there are n − r “unobservable” states ξ. The internal dynamics obey 137

© 2015, J.K. Hedrick and A. Girard

ξ˙ = ψ(ξ, z),

(6.174)

where

z˙1 = z2 , .. . . = .., z˙r−1 = zr , z˙r = v.

(6.175) (6.176) (6.177) (6.178)

The stability of the internal dynamics can be difficult to ascertain. In that case, one may consider the zero dynamics, ξ˙ = ψ(ξ, 0),

(6.179)

δ ξ˙ = Jδξ.

(6.180)

or even the linearized zero dynamics,

Internal dynamics in the SISO case are illustrated in Figure 6.5. The system

x˙ = f + gu, y = h

(6.181) (6.182)

is said to be non-minimum phase if ξ˙ = ψ(ξ, 0) is unstable.

6.3.2

Input/State Feedback Linearization

In input/state feedback linearization, we attempt to find a scalar function z1 (x) that has relative degree equal to n. If we can find such a function, then we can follow the procedure for input/output feedback linearization, that is,

z˙1 = z2 , .. . . = .., z˙n−1 = zn , z˙n = v, 138

(6.183) (6.184) (6.185) (6.186) © 2015, J.K. Hedrick and A. Girard

Figure 6.5: Internal Dynamics.

139

© 2015, J.K. Hedrick and A. Girard

and v = Lnf z1 + Lg(Ln−1 z1 )u, f = α(x) + β(x)u.

(6.187) (6.188)

Furthermore, z and x are related by 

 L0f z1   z =  ...  , Ln−1 z1 f

(6.189)

z˙ = Az + Bv,

(6.190)

and

where A and B are in controllable canonical form, that is,  0 0   A =  ...  0 0

0 1 .. .

··· 0 .. .

0 ··· 0 ···

0 0

1 0 .. .

 0 · · ·  ..  , .   1 0

(6.191)

and   0 0     B =  ...  .   0 1

(6.192)

v = α(x) + β(x)u,

(6.193)

Then,

or

u=

1 (v − α). β 140

(6.194) © 2015, J.K. Hedrick and A. Girard

The conditions for z1 (x) to have relative degree n are: Lg (Lkf z1 (x)) = 0, k ∈ [0, n − 2],

(6.195)

Lg (Ln−1 z1 (x)) 6= 0. f

(6.196)

and

Conditions (6.195) and (6.196) yield high-order PDEs for z1 (x). But the conditions can be transformed into first-order PDEs by repeated use of Jacobi’s identity, Ladf g (h) = Lf Lg (h) − Lg Lf (h),

(6.197)

where adf g = [f, g]. Conditions (6.195) and (6.196) are then equivalent to Ladf g (z1 ) = 0, k ∈ [0, n − 2],

(6.198)

or  ∇z1 · g adf g · · ·

adn−2 g f

T

= 0.

(6.199)

The theorem of Frobenius states that a solution to (6.199) exists if and only if  1. g adf g · · ·

adn−1 g f

T

has rank n,

 2. g adf g · · ·

adn−2 g f

T

is involutive.

A linear independent set of vectors (f1 , · · · , fm ) is involutive if and only if

∀i, j ∈ N, ∃αijk , [fi , fj ] =

m X

αijk (x)fk (x).

(6.200)

k=1

Remark 6.3 Note that we have not discussed methods to tackle robustness in feedback linearization techniques. We address some in Chapter 7.

6.4

Further Reading

Sastry, Isidori, Slotine and Li, Nijmeijer and van der Schaft, John Hauser UCB PhD 1989 141

© 2015, J.K. Hedrick and A. Girard

Figure 6.6: Fluid tank for Problem 6.1.

6.5

Homework Problems

Problem 6.1 (Feedback Linearization Example) This intuitive example illustrating the concept of feedback linearization is taken from Slotine and Li. Consider the problem of controlling the height, h, of fluid in the tank shown in Figure 6.6. With the fluid level starting at some initial height, h0 , the goal is to choose the input flow rate, u, that brings h as close as possible to hd , the desired height. The tank has a crosssectional area, A(h), which is a function of the height of the fluid in the tank. A spigot at the bottom of the tank √ leaks fluid at a rate proportional to the square root of the height of fluid in the tank, Qout = a 2gh, where a is a constant of proportionality and g is the acceleration of gravity. Conservation of mass gives the following nonlinear differential equation governing the height of fluid in the tank: A(h)h˙ = u − a

p

2gh.

(6.201)

1. Feedback linearization: For this system, the first step of feedback linearization is already complete: the output, h, has already been differentiated enough times that the input, u, appears explicitly in the differential equation’s right hand side. Let v denote the “synthetic input” and find an expression for u in terms of the problem parameters and v so that the dynamics resulting from this choice of u are h˙ = v.

(6.202)

2. Choice of synthetic input: Define the height error as ˜ = h − hd . h 142

(6.203) © 2015, J.K. Hedrick and A. Girard

Now choose the synthetic input, v, so that the resulting closed-loop error dynamics are

˜˙ + αh ˜ = 0, h

(6.204)

where α is some positive constant. This implies that the height error decays exponentially to zero (with rate α). 3. Control law: Substitute our choice of synthetic input v into the expression above for u ˜ α, A(h) and the problem to arrive at a final control law, u, which is a function of h, constants. This control law tells us how to choose the input flow, u, to achieve the desired fluid level in the tank. It has two terms that can be interpreted as follows: (a) “Provides an input flow that makes up for the output flow, Qout , according to our model of the output flow.” (b) “Provides an input flow that brings the fluid to the desired level according to the desired linear dynamics that we choose above.” Attach the correct label to each of the two terms. 4. Potential problems: In class, we discussed two potential problems with this type of control scheme. What were they? Explain in one or two sentences how they might affect us here. Problem 6.2 (Input–Output and Input–State Linearization) Consider the plant       x˙ 1 a sin x2 0 = + u, 2 x˙2 −x1 1 y = h(x) = x2 ,

(6.205) (6.206)

where y is the output which we need to stabilize around a constant reference value, yref , through the choice of the control input, u. We are able to sense both x1 and x2 . Let 

a sin x2 f (x) = −x21

 (6.207)

and   0 g(x) = . 1

(6.208)

We design two controllers for this problem: 143

© 2015, J.K. Hedrick and A. Girard

1. an input/output linearizing controller 2. an input/state linearizing controller. This is to familiarize you with both design procedures and to allow you to directly compare the advantages and disadvantages of each controller. 1. Input/Output linearizing controller Follow the procedure below to design an input/output linearizing controller. We work a general case and our specific example in parallel.

(a) Find expressions for the derivatives of the output: For a general system x˙ = f (x) + g(x)u, y = h(x) with relative degree r, verify that the derivatives of the output are given by the equations below.

y = L0f h,

(6.209)

L1f h L2f h

(6.210)

y˙ =

+ Lg hu,

y¨ = + Lg (L1f h)u = L2f h, .. . . = .., y (r) = Lrf h + Lg (Lr−1 f h)u,

(6.211) (6.212) (6.213)

with

Lg h Lg (L1f h) .. . r−1 Lg (Lf h)

= 0, = 0, . = .., 6= 0.

(6.214) (6.215) (6.216) (6.217)

Then, find the relative degree and first r derivatives of the output for our particular system. Note that if r is less than the plant state dimensions, we have to be aware of internal dynamics when we design our I/O linearizing controller. (b) Transform state equations so that the derivatives of the output are the states: Define a new state vector, x0 , that consists of z-states and ξ-states as follows: 144

© 2015, J.K. Hedrick and A. Girard

       0 x = T (x) =      

z1 z2 .. .





y y˙ .. .





L0f h L1f h .. .



                      (r−1)   r−1  zr   y   Lf h  = = , ξ1   ψ1 (x)   ψ1 (x)       ξ2   ψ2 (x)   ψ2 (x)      ..  .. ..    .   . . ξn−r ψn−r (x) ψn−r (x)

(6.218)

where the ψ1 (x), ..., ψn−r (x) functions are chosen so that T (x) is a diffeomorphism and so that the input doesn’t affect the ξ1 , ..., ξn−r states directly, that is, Lg ψi = 0 for i = 1, ..., n − r. What do the ξ states represent? For our example, find T (x). (Hint: This sounds hard, but it turns our to be quite easy for our example. You shouldn’t have to work very hard at all to find a ψ1 (x) that works.)  T (c) Choose a linearizing input: Define z = z1 z2 · · · zr . For the general case, write down what z˙ is, and then choose u (in terms of a “synthetic input” v) so that z and the output are governed by 

0 0   z˙ =  ...  0 0  y = 1

0 1 .. .

··· 0 .. .

0 ··· 0 ···

0 0

1 0 .. .

0 ···

   0 0    · · · 0   .. z + ..  v, . .     0 1 0 1

 0 0 z.

(6.219)

(6.220)

Then, find u for our specific example and verify that the equations for the z-state and output take the expected form. For our example, write the differential equation governing the ξ-state. Is the ξ-state observable from the output, y? Before we linearized the input to output relationship, was x1 observable at the output? What was the effect of our input to output linearization on the x1 state? Draw a block diagram for our input/output linearized system, showing v, y, integrators, the z-state and the ξ-state. (d) Design a linear control law: For our example, propose a simple law for choosing v so that y approaches the reference point yref . For the general case, describe how you might choose v. (e) Evaluate the controller: For our example, write the closed-loop dynamics in terms of the original x1 , x2 state variables. If the reference yref is not zero, do you anticipate any problems with this controller? Describe. 145

© 2015, J.K. Hedrick and A. Girard

2. Input/State linearizing controller As we discovered above, the input/output linearizing controller used a state transformation that put some of the states in controllable canonical form, but essentially ignored others. Here, we seek a state transformation that puts the entire system in controllable canonical form. Alternatively, we can think of this as a search for a new output, ynew = hnew (x), so that the system has relative degree n with respect to this new output. Then the procedure above puts all of the states in controllable canonical form. Again, we work a general case in parallel with our example. (a) Write desired form for the transformed state equations: We are given the n state dynamic system, x˙ = f (x) + g(x)u with output y = h(x) and relative degree r < n. We want to create a new output, ynew = hnew (x), so that the new relative degree is n. Then, following the procedure for input/output linearization, the state transformation    0    ynew Lf hnew z1  z2   y˙ new   L1 hnew     f    z = T (x) =  ..  =  ..  =   ..  .  .   . (n−1) n−1 zn Lf hnew ynew

(6.221)

gives z-coordinate state equations in controllable canonical form  0 0   z˙ =  ...  0 0  ynew = 1

0 1 .. .

··· 0 .. .

0 ··· 0 ···

0 0

1 0 .. .

0 ···

   0 0    · · · 0 ..  z +  ..  v, . .     0 1 0 1

 0 0 z,

(6.222)

(6.223)

where, following the approach for input/output linearization, the physical input u and the synthetic output v are related by

u(x) =

1 Lg (Ln−1 hnew (x)) f

 −Lnf hnew (x) + v .

(6.224)

For our system, write the desired z-coordinate state equations in terms of z and v. Also, write the state transformation z = T (x) in terms of Lie derivatives of the soon-to-be-found new output function, hnew (x). 146

© 2015, J.K. Hedrick and A. Girard

(b) Find PDEs that must be verified by the state transformation: To put the system into the desired form, the system must have relative degree n with respect to the new output, ynew = hnew (x). Referring to step (1a) for the design of the input/output linearizing controller, we see that for the system to have relative degree n, we need for the input u not to appear until the nth differentiation of the new output. This is expressed by the following n equations:

Lg hnew Lg (L1f hnew ) .. . n−2 Lg (Lf hnew )

= 0, = 0, . = .., = 0

(6.225) (6.226)

Lg (Ln−1 hnew ) 6= 0. f

(6.229)

(6.227) (6.228)

Write the corresponding equations for our specific example. Do these look easy to solve? You needn’t solve them at this point. (c) Simplify PDEs and invoke Frobenius’ Theorem: Use the definitions of Lie derivatives and Lie brackets to show that

Ladf g hnew = Lf (Lg hnew ) − Lg (Lf hnew ).

(6.230)

Now, we use this fact to show that for the general case, the Lie derivative conditions of the previous step have a Lie bracket equivalent as follows:

Lad0f g hnew = 0,

(6.231)

Lad1f g hnew = 0,

(6.232)

Lad2f g hnew = 0, .. . . = .., Ladn−2 g hnew = 0.

(6.233) (6.234) (6.235)

f

(Its OK to show it for the first three equations and then to explain how your argument would extend to the (n − 1)th equation.) Notice that the nth equation from the previous step, Lg (Ln−1 hnew ), has been left behind. We will return to it f in a moment. Show that this Lie bracket condition can be written as follows: ∂hnew  g adf g ad2f g · · · ∂x 147

  adn−2 g = 0 0 0 ··· f

 0 .

(6.236)

© 2015, J.K. Hedrick and A. Girard

Under what conditions discussed in class does hnew (x) satisfying this equation exist? Write this equation for our specific example and check the conditions for existence of a solution. (d) Solve for the new output/transformation: For our example, solve for a hnew (x) that satisfies the equation you just wrote. (There are many solutions – pick an easy one). Then, find the transformation, T (x), that transforms the state so that      0  ynew Lf hnew z1  z2   y˙ new   L1 hnew       f  z = T (x) =  ..  =  ..  =   .. .  .    . (n−1) n−1 zn Lf hnew ynew

(6.237)

Finally, write the equations of motion, in z-coordinates, plug in for the input, and check to be sure that they are in controllable canonical form. What is the new output? Are there any states which are not visible through the output? List three similarities and/or differences that you have discovered between input/output and input/state linearization. Problem 6.3 (Magnetic Suspension) We consider here the magnetic suspension example from Problem 4.1. We design an input/state linearizing controller for this problem. 1. Conditions for full state linearization Show that the system satisfies the conditions for full state linearizability (check the rank and involutivity conditions). We already calculated the Lie brackets that you need for this question as part of Problem 4.1. They were:  0 g =  0 , 

(6.238)

2x+β α



0



∂g ∂f 2z f− g =  M (2x+β)  , ∂x ∂x (2x+β)2 R α2   2z − M (2x+β)   0 ad2f g =  . 2y(2x+β)R (2x+β)3 R2 4z 2 − M (2x+β)2 + α2 α3 adf g =

(6.239)

(6.240)

If you are doing things correctly, there isn’t too much algebra involved here. 2. Linearizing output: Using Problem 6.2 to guide you, set up the partial differential equations that the “output” has to satisfy, and solve them. You should be able to solve for the output by inspection. (Does this physical output make sense?) Call this output h. 148

© 2015, J.K. Hedrick and A. Girard

3. Linearizing control law: Calculate the linearizing control law based on the output h that you obtained in the previous section. Assume that you know Fd and F˙ d . Check that the transformed state equations are linear and controllable. 4. Tracking control: Extend this control law to enable h to track some reference trajectory hd . For a simple desired trajectory (say, a simple sine wave), simulate the plant and observe the results. (You can allow your controller access to derivatives of hd if you wish). Vary the resistance R around its nominal value (your controller should not know that R has changed!) and look at the performance. The files “suspension.m” and “runsuspension.m” provided below may help you get started.

function xprime = suspension(t, x) % suspension.m %Model for magnetic suspension %Input/State Linearizing control % %This function takes the current simulation time and the %current state as inputs, and it outputs the state %derivates which ode45 (or other matlab ode solver) then %integrates. %Define constants g = 9.81; R0 = 3; %nominal--used in controller R = 3; %actual physical value M = 8.91; mu0 = 1.26e-6; mu1 = 1e4; mu2 = 100; L1 = .28; L2 = .05; A = 25e-5; N = 800; alfa = mu0*Nˆ2*A; beta = L1/mu1+L2/mu2; %Calculate disturbance Fd = .01*sin(.3*t); Fd1 = .003*cos(.3*t); %Calculate desired trajectory for tracking controller. %This is a good desired trajectory to start with hd = 6.35e-4+1e-4*sin(t); hd1 = 1e-4*cos(t); hd2 = -1e-4*sin(t); hd3 = -1e-4*cos(t); %Transform to linearized states

149

© 2015, J.K. Hedrick and A. Girard

xb = 2*x(1)+beta; %Just a notational convenience since %we're constantly dividing by (2*x1+beta) z = [ ]; %NEEDS TO BE COMPLETED %Calculate control action v = %YOUR CONTROL LAWS HERE u = %YOUR CONTROL LAWS HERE %Equations of xprime(1,1) = xprime(2,1) = xprime(3,1) =

motion for plant given in HW2 x(2); g-alfa*x(3)ˆ2/M/xbˆ2+Fd; xb/alfa*(u-R*x(3))+2*x(2)*x(3)/xb;

%State derivative of integral of u. This is a hack to get %ode45 to store the input u for us. If we want to plot u %later, we do the following % dx=diff(x(:,4)) % dt=diff(t) % Then u = dx./dt and we can: plot(t(2:end),u); xprime(4,1) = u;

%% run suspension.m % Set up and call ODE solver x0=[0;0;.1;0]; tspan=[0 8]; options=odeset('MaxStep',.01); [t,x]=ode45('suspension',tspan,x0,options); % Plot data plot(t,6.35e-4+1e-4*sin(t),':',t,x(:,1)) title('Input/State Linearizing Control (Nominal Case)') xlabel('Time [s]') ylabel('Displacement [m]')

Problem 6.4 (Automotive Engine Control) Consider the following 2-state model of an automotive engine coupled to a transmission and wheels. This model, while being simple enough, captures the important dynamics of vehicle motion when the engine is in constant gear. (The interested problem-doer can look up: Automotive Powertrain Modeling for Control, D. Cho and J.K. Hedrick, ASME Transactions on Dynamical Systems, Measurements and Control, Vol 111, December 1989.) Without going into the modeling details, the following are the state equations of interest:

m ˙ a = c1 T C(α) − c2 ωe ma , 1 ω˙ e = (Ti − Tf − Td − Tr ), Je 150

(6.241) (6.242)

© 2015, J.K. Hedrick and A. Girard

Figure 6.7: Desired speed trajectory for Problem 6.4.

where ma is the mass of air in the intake manifold, in kg, ωe is the engine speed, in rad/s, T C(α) is the throttle characteristic depending on the throttle angle α, and our control, with ( T C(α) =

1 − cos(1.14α − 1.06) if α ≤ 79.46 deg, 1 if α > 79.46 deg,

(6.243)

Je is the effective vehicle inertia reflected onto the engine, and Je = 36.42kg.m2 , Ti = c3 ma is the engine indicated torque, in Nm, Tf = 0.1056ωe + 15.1 is the engine friction torque, in Nm, Td = c4 ωe2 is the torque due to wind drag, in Nm, and Tr = 21.5N m is the torque due to rolling resistance at the wheels. Both Td and Tr have been reflected back to the engine side. The ci are system constants. For a fourth gear operation with the assumptions that there is no slip at the wheel and that the transmission shaft is rigid, typical values of the ci are c1 = 0.6kg/s, c2 = 0.0952, c3 = 47469N m/kg, and c4 = 0.0026N ms2 . We also have the following algebraic relationship between the engine speed and the vehicle speed (in m/s):

v = 0.1289ωe .

(6.244)

Our objective is to design an engine-speed tracking controller so that a step change from 40mph to 60mph in the desired vehicle speed is achieved smoothly. Assume that at t = 0, the vehicle is in fourth gear and its speed is maintained at a constant 40mph. 1. Equilibrium point: Find the equilibrium values of ωe , ma and α for a steady vehicle speed of 40mph. 2. Desired trajectory: We need a desired trajectory for ωed . We would like ωed to be such that if the tracking were perfect, the change in speed is smooth with no overshoot, and 151

© 2015, J.K. Hedrick and A. Girard

the maneuver takes about 5 seconds. Such a desired trajectory can be obtained from a filter of the following type: ωn2 s2 + 2ξωn s + ωn2

(6.245)

Select values for ξ and ωn so that the desired trajectory looks “nice” during the speed transition, as in Figure 6.7. Plot ωed for your design. 3. Input/Output linearizing controller: Design an input/output linearizing controller so that ωe tracks ωed . What is the relative degree of the system with respect to the output ωe ? Why did we decide to use an input/output linearizing controller in this situation? 4. Simulations: Simulate the following scenario with your controller (see Figure 6.7), and show plots of the tracking performance and of the control, α. (a) The vehicle travels at 40mph from t = 0 to t = 2 seconds. (b) The command for the speed change is given at t = 2 seconds. The files you used in the previous problem can be modified for this problem. Your controller implementation needs the first and second derivatives of the desired trajectory. You can obtain these from the filter states. Be careful to set the various initial conditions appropriately for the simulation. Also, notice that α is in degrees!

152

© 2015, J.K. Hedrick and A. Girard

Chapter 7 Sliding Mode Control Sliding mode control is a control method that is applicable to nonlinear dynamic systems, applicable to tracking or regulation problems, and directly takes robustness issues (e.g., modeling errors, unknown disturbances, etc.) into account as part of the design process. Other names for the method exist, most predominantly Variable Structure Systems (VSS). Historically, the method first appeared in the USSR in the 1960s, with the work of Fillipov and Utkin. It was used in Japan in the 1970s for control of D.C. servos. It was then used in the United States starting in the 1980s, with first applications in robotics.

7.1

Basic Concepts

We introduce and motivate the method through a second-order system example, then consider basic concepts, the development of the theory for a general class of nonlinear systems in canonical form, and smoothing techniques.

7.1.1

Second-Order System Example

Consider the system governed by

x¨ = f (x, t) + d(t) + u,

(7.1)

where f is a nonlinear function, d represents a time-varying disturbance, and u is the control input. We separate f and d into known parts (denoted with a subscript “m”, for “model”), and unknown parts, denoted ∆, so that

f (x, t) = fm (x, t) + ∆f (x, t), d(t) = dm (t) + ∆d(t). We select the state vector 153

(7.2) (7.3)

  x x= . x˙

(7.4)

The control objective is to have x(t) → xd (t), with the error going to zero exponentially, even though we don’t have a perfect model. Define the error as

 = x(t) − xd (t).

(7.5)

S , ˙ + λ.

(7.6)

(t) = (t1 )e−λ(t−t1 ) ,

(7.7)

Let S, the sliding surface, be

If S = 0 for some finite t ≥ t1 ,

and the error goes to zero exponentially with time constant 1/λ. This is consistent with the control objective. Computing the first derivative of S yields S˙ = ¨ + λ, ˙ = x¨ − x¨d + λ, ˙ = fm + ∆f + dm + ∆d + u − x¨d + λ. ˙

(7.8) (7.9) (7.10)

The control input u appears in the equation for the first derivative of S. We say that S has relative degree 1. This is a desirable property of sliding surfaces. We select u to cancel out the known terms:

u = −fm − dm + x¨d − λ˙ + u˜,

(7.11)

where the u˜ term is present to deal with the uncertainties. Then, S˙ = ∆f + ∆d + u˜.

(7.12)

To make S → 0 in finite time, we need bounds on the uncertainties, ∆f and ∆d. For example, 154

© 2015, J.K. Hedrick and A. Girard

|∆f | ≤ α(x, t) > 0, |∆d| ≤ β(t) > 0.

(7.13) (7.14)

We then select a Lyapunov function candidate. For example, we could select V = S 2 , which ˙ Therefore, to make V˙ negative definite, we need to pick u such that leads to V˙ = 2S S. S S˙ < 0. Calculating S S˙ yields ¨ d + λ). S S˙ = S(fm + ∆f + dm + ∆d + u − X ˙

(7.15)

u = −fm − dm + x¨d − λ˙ + u˜.

(7.16)

S S˙ = S(∆f + ∆d + u˜).

(7.17)

As before, let

Then,

We now consider the worst case uncertainties, that is, ∆f = α(x, t) sgn(S), ∆d = β(t) sgn(S).

(7.18) (7.19)

Then, we have S S˙ ≤ |S|(α + β) + S u˜,

(7.20)

and we need this quantity to be strictly negative. Therefore, select u˜ to be u˜ = −(η + α + β) sgn(S),

(7.21)

where η is a tuning parameter. This choice of control input guarantees that S S˙ ≤ −ηS sgn(S) < 0.

(7.22)

The full expression for the control input, u, is u = −fm − dm + x¨d − λ˙ − (η + α(x, t) + β(t)) sgn(S). 155

(7.23)

© 2015, J.K. Hedrick and A. Girard

Note that because of the sgn function, the control is discontinuous. Assume that we encounter the worst-case scenario, and that S S˙ = −ηS sgn(S),

(7.24)

S˙ = −η sgn(S).

(7.25)

so that

Figure 7.1: Worst-case scenario for sliding surface of second-order example.

Let S(0) > 0. Then, S(t) = S(0) − ηt,

(7.26)

S(t1 ) = 0

(7.27)

t1 =

S(0) , η

(7.28)

t1 =

|S(0)| η

(7.29)

as shown in Figure 7.1, and

when

and S(t) → 0 as t → ∞. In general,

156

© 2015, J.K. Hedrick and A. Girard

is finite. Then, we have

S S˙ ≤ −ηS sgn(S) < 0,

(7.30)

S S˙ ≤ −η|S|.

(7.31)

that is,

Equation (7.31) is referred to as the sliding condition.

Figure 7.2: Sliding mode for second-order example.

For times larger than t1 , we enter the sliding mode, as shown in Figure 7.2. In this mode, the system chatters with zero amplitude and infinite frequency on average. Mathematically, SAV ≈ 0,

(˙ + λ)AV = 0,

(7.32)

˙AV + λAV = 0,

(7.33)

AV (t) = (t1 )e−λ(t−t1 ) .

(7.34)

therefore

and

Remark 7.1 We get perfect disturbance rejection and robustness to model error.

157

© 2015, J.K. Hedrick and A. Girard

Figure 7.3: Summary of sliding control for second-order example.

Remark 7.2 We have a Lyapunov-based controller design, as shown in Figure 7.3. By design, 1 V = S2 2

(7.35)

V˙ = S S˙ < 0.

(7.36)

and

The equilibrium point is guaranteed to be asymptotically stable. Later, we smooth out the sgn(S) term.

7.1.2

Basic Concepts

Consider the system (or plant) described by

x˙ = f (x) + g(x)u,

(7.37)

with x ∈ Rn and u ∈ Rm . Next, we define the desired dynamics, 158

© 2015, J.K. Hedrick and A. Girard

S(x) = 0,

(7.38)

with S ∈ Rp , and p ≤ m. Here, p is the number of outputs. Often, one chooses p = m. In that case, the problem is called “square.” In general, we define a scalar, linear stable ordinary differential equation (possibly nonlinear) such that S(x) = 0 represents the desired behavior.

Figure 7.4: Possible choice for desired behavior.

For example, one may pick S(x) = Cx as shown in Figure 7.4, where C is 1 × n, and the ci are coefficients to be chosen. Usually, once chooses S = D(x), where D is a (linear) differential operator, for example,

S = x˙ + λx.

(7.39)

x(t) = x(0)eλt .

(7.40)

Then, if S = 0, we have

In general, we define a reaching phase (S 6= 0) and a sliding phase (or mode), Saverage = 0, as shown in Figure 7.5. To make S = 0 an attractive surface, we select a Lyapunov function candidate, 1 V = S 2. 2

(7.41)

Note that V is only a true Lyapunov function candidate if it is a function of all states. Otherwise, it is Lyapunov-like. Then, 159

© 2015, J.K. Hedrick and A. Girard

Figure 7.5: Reaching phase and sliding phase.

˙ V˙ = S S.

(7.42)

If V˙ < 0, that is, if S S˙ < 0, then S → 0. For sliding control, we seek a control u such that S S˙ ≤ −η|S|.

(7.43)

As mentioned previously, this equation is called the sliding condition. It results in S(t) going to zero in finite time t0 . Consider the case S S˙ = η|S|.

(7.44)

(By definition, |S| = S sgn(S).) Further assume that S 6= 0. Then, S˙ = −η sgn(S).

(7.45)

S(t) = S(0) − ηt,

(7.46)

If S > 0, S˙ = −η, so that

as shown in Figure 7.5, and the sliding mode is reached in time

t0 ≤

S(0) , η

(7.47)

as shown in Figure 7.6. 160

© 2015, J.K. Hedrick and A. Girard

Figure 7.6: Reaching phase and sliding phase shown in the phase plane.

Figure 7.7: Fillipov construction.

161

© 2015, J.K. Hedrick and A. Girard

Remark 7.3 (Fillipov Construction) Some references [8] mention the “Fillipov construction” to study the motion in the sliding surface. Let x˙ = f (x, t).

(7.48)

favg = αf+ + (1 − α)f− ,

(7.49)

Then, on the sliding surface,

that is, favg is a convex combination of f+ and f− , as shown in Figure 7.7. where α is the formal residence time on the side S > 0. Note that system trajectories must be tangent to the S = 0 surface. The discontinuity in the control at the sliding surface is what led to the name Variable Structure Control. Remark 7.4 (Equivalent control) Utkin [?] defines an “equivalent control” to study the average behavior on the sliding surface. Let x˙ = f + gu,

(7.50)

where x ∈ Rn and u ∈ Rm . Further, let S = Cx, with S ∈ Rp , and let p = m. If we are sliding, then S ≡ 0, hence S˙ ≈ 0, or S˙ = ∇S.x˙ = 0.

(7.51)

S˙ = ∇S.x, ˙ = C x, ˙ = C(f + gu).

(7.52) (7.53) (7.54)

But

Therefore, on the S = 0 and S˙ = 0 surface, we can solve for the smooth u∗ , also called the equivalent control, by solving C(f + gu∗ ) = 0,

(7.55)

u∗ = −(Cg)−1 Cf,

(7.56)

or

assuming Cg is invertible, and the dynamics on the sliding surface are given by x˙ avg = (I − g(Cg)−1 C)favg , Cxavg = 0. 162

(7.57) (7.58)

© 2015, J.K. Hedrick and A. Girard

7.1.3

Systems in Canonical Form

Let us now consider a general class of nonlinear systems in a special canonical form: x˙ 1 x˙ 2 .. . x˙ n

= x2 , = x3 , . = .. = f (x, t) + b(x, t)u + d(t),

(7.59) (7.60) (7.61) (7.62)

where x ∈ Rn and the last equation is a scalar equation. Further, let S(x) = C T x, = c1 x 1 + c2 x 2 + · · · + cn x n , dn−1 = c1 x1 + c2 x˙ 1 + cn n−1 x1 . dt

(7.63) (7.64) (7.65)

A convenient choice of the ci is to let  = x1 and have the ci be such that  S≡

n−1 d +λ x1 , dt

(7.66)

that is, to place all the poles at −λ. For example, if n = 2, we have S = x˙ 1 + λx1 , for n = 3, we have s = x¨1 + 2λx˙ 1 + λ2 x1 , and so on. Remark 7.5 Note that S = 0 defines a linear ODE with “bandwidth” λ, thus once we capture S on S = 0, we have substituted the nonlinear system with a linear one, S = 0. Remark 7.6 We can define a tracking control problem by defining x˜1 = x1 − x1d (t),

(7.67)

where x1d (t) is the desired trajectory, and letting  S≡

n−1 d +λ x˜1 . dt

(7.68)

We can now formally state our problem: given the nonlinear dynamics (7.59) - (7.62) and the desired sliding mode (7.68), choose u such that it satisfies the sliding condition S S˙ ≤ −η|S|, 163

(7.69) © 2015, J.K. Hedrick and A. Girard

with S(t1 ) = 0, t1 = |S(0)|/η, and, in the sliding mode, Savg = 0, implying x˜1avg → 0 as t → ∞. Note that |S| = S sgn(S). Now, letting S = c1 x˜1 + · · · + cn x˜n ,

(7.70)

assume we have chosen the ci such that  S=

n−1 d +λ x˜1 , dt

(7.71)

that is, c1 = λn−1 , ..., cn = 1. Compute S˙ as S˙ = c1 x˜˙ 1 + · · · + cn x˜˙ n ,

(7.72) n

= c1 x˜2 + · · · + cn−1 x˜n + f (x, t) + b(x, t)u + d(t) −

d x1d . dtn

(7.73)

For a perfect model, we want S˙ = −η sgn(S).

(7.74)

Solving for u yields

u=−

 1  (n) c1 x˜2 + · · · + cn−1 x˜n − x1d + f + d + η sgn(S) . b(x, t)

(7.75)

Remark 7.7 The sliding control law (7.75) contains three parts: (n)

1. c1 x˜2 + · · · + cn−1 x˜n − x1d inserts the desired dynamics, 2. +f + d cancels out known nonlinearities and disturbances, 3. +η sgn(S) guarantees the sliding surface is reached and adds robustness. Modeling Errors, Uncertainties and Unknown Disturbances Assume that we let f = fˆ + ∆f,

(7.76)

where ∆f contains the modeling errors, and we bound ∆f by 164

© 2015, J.K. Hedrick and A. Girard

|∆f | ≤ α(x) > 0.

(7.77)

(n)

(i)

Further, assume that we do not know d(t) or x1d (even though we assume x1d is known for i ∈ [0, n − 1]), but that we know bounds on these quantities, |d(t)| ≤ β(t) > 0, (n) |x1d (t)|

≤ γ(t) > 0.

(7.78) (7.79)

We can modify (7.75) to ensure that S S˙ ≤ −η 0 |S|

(7.80)

by considering the worst case model error,

∆f = α sgn(S), d = β sgn(S), (n)

x1d

= −γ sgn(S),

(7.81) (7.82) (7.83)

to yield  1  ˆ c1 x˜2 + · · · + cn−1 x˜n + f + (η + α + β + γ) sgn(S) . u=− b(x, t)

(7.84)

Figure 7.8: Chattering solution.

165

© 2015, J.K. Hedrick and A. Girard

Remark 7.8 Let k(x, t) = η + α + β + γ. Then, k increases as the uncertainty increases. This leads to larger control discontinuities, and possibly to a chattering solution, as shown in Figure 7.8. Remark 7.9 The sgn(S) term tells us the right way to “push.” Furthermore, we have converted an nth order control problem into a first order control problem.

7.1.4

Smoothing

In some mechanical systems, the implementation of a discontinuous controller can lead to the excitation of un-modeled dynamics. If the chattering frequency is well above that of the un-modeled dynamics, this may not be a problem. However, concerns about chattering exciting un-modeled modes has led to the development of smoothing methods. A number of methods are available, but here we focus on the use of boundary layers [8].

Figure 7.9: Saturation function.

One possibility for smoothing is to replace the sgn(S) function in the control law (7.84) by the function sat(S/φ), as shown in Figure 7.9. The smooth control law is then given by 1 u=− b(x, t)

   S (n) c1 x˜2 + · · · + cn−1 x˜n + fˆ + dˆ − xˆ1d + k sat , φ

(7.85)

assuming f = fˆ + ∆f, d = dˆ + ∆d, (n)

x1d

(n)

(7.86) (7.87) (n)

= xˆ1d + ∆x1d .

166

(7.88)

© 2015, J.K. Hedrick and A. Girard

Figure 7.10: Boundary layer.

Remark 7.10 For S small, we can no longer guarantee that S S˙ < 0. In other words, using sgn(S) guarantees S → 0 in finite time. Using sat(S/φ) guarantees that one reaches a “boundary layer” in finite time, and that once the boundary layer is reached, the trajectories stay inside the boundary layer, as illustrated in Figure 7.10.

Figure 7.11: Definition of ∆S, the distance from the boundary layer.

Note that for now, φ is assumed to be constant. To analyze the effects of the saturation term, let   S ∆S , S − φ sat , φ

(7.89)

that is, ∆S is the distance from the boundary layer, as shown in Figure 7.11. Inside the boundary layer, that is, for |S| < φ, let ∆S = 0. Outside the boundary layer, ˙ ∆S˙ = S,

(7.90)

  S (n) = ∆f + ∆d − ∆x1d − k sat . φ

(7.91)

Outside the boundary layer, the sat function behaves exactly like the sgn function. Therefore, 167

© 2015, J.K. Hedrick and A. Girard

(n)

∆S∆S˙ = ∆S(∆f + ∆d − ∆x1d − k sgn(∆S)),

(7.92)

k = α + β + γ + η,

(7.93)

∆S∆S˙ ≤ −η|∆S|,

(7.94)

with

and

implying that ∆S → 0 with finite t1 : |∆S(0)| . (7.95) η Hence, system trajectories that start outside the boundary layer reach the boundary layer in finite time. In “steady-state,” S = φ, where t1 ≤

S = λn−1  + · · · +

dn−1  , dtn−1

(7.96)

so we have φ = λn−1 ss .

(7.97)

Letting the tracking error or steady-state error be defined as ss = φt

(7.98)

φ = λn−1 φt .

(7.99)

yields

Now, inside the boundary layer, |S| ≤ φ, so that the saturation function sat(S/φ) behaves likes S/φ. Then, S (n) S˙ = −k + ∆f + ∆d − ∆x1d , φ

(7.100)

and 1 u=− b(x, t)



kS (n) c1 x˜2 + · · · + cn−1 x˜n + fˆ + dˆ − xˆ1d + φ 168

 .

(7.101)

© 2015, J.K. Hedrick and A. Girard

Design Considerations Design considerations include: 1. The actuator bandwidth, λa , which is a parameter of the design, 2. The un-modeled dynamics λu , for example from structural resonance or such phenomena. We would like to limit the frequencies in the controller, so that λ ≈ λp , where λp is set for performance, and n−1 d +λ . dt

(7.102)

λ ≤ λa ,

(7.103)

 S= Furthermore, we need

otherwise the actuators need to be changed, and λ 0, and 171

© 2015, J.K. Hedrick and A. Girard

Figure 7.13: Dynamic tuning of the boundary layer.

∆S = S − φ, ˙ ∆S˙ = S˙ − φ.

(7.121) (7.122)

We want to enforce the sliding condition, ∆S∆S˙ ≤ −η|∆S|.

(7.123)

We have     S (n) ˙ ˙ ∆S∆S = ∆S ∆f + ∆d − ∆x1d − k sat −φ . φ   However, sat Sφ = 1 (for |S| > φ), so we let k + φ˙ = α + β + γ + η.

(7.124)

(7.125)

One can show that we get the exact same condition by assuming that |S| > φ with ∆S < 0. Then, ∆S = S + φ, ˙ ∆S˙ = S˙ + φ. 172

(7.126) (7.127) © 2015, J.K. Hedrick and A. Girard

To enforce the sliding condition, ∆S∆S˙ ≤ −η|∆S|,

(7.128)

k + φ˙ = α + β + γ + η.

(7.129)

we use the exact same choice,

Let k(x, t) , φ

(7.130)

k(x, t) = λφ,

(7.131)

φ˙ + k(x, t) = α(x, t) + β(t) + γ(t) + η.

(7.132)

φ˙ + λφ = η + α(x, t) + β(t) + γ(t).

(7.133)

λ= so that

and

Hence,

This is a closed-loop result, in the sense that it depends on both x and t. Slotine and Li [8] suggest making φ open-loop and simplifying the expression to φ˙ + λφ , η + α(xd , t) + β(t) + γ(t),

(7.134)

since once in the boundary layer, x should be close to xd . Note that for dynamic tuning to be effective, we often need really good estimates of the modeling error as a function of position and time. An Alternative Approach using a “Linear” Robustness Term An alternative to using boundary layers for smoothing of discontinuous sliding control laws is to use a “linear” robustness term, that is, instead of replacing the sgn(S) function by sat(S/φ), replace it by S/φ. Inside the boundary layer, the control is exactly the same as 173

© 2015, J.K. Hedrick and A. Girard

in the boundary layer case. One advantage is that this approach allows one to consider uncertainty in b(x, t). Recall that we consider a general class of nonlinear systems in the canonical form x˙ 1 = x2 , .. . . = .., x˙ n = f + bu + d.

(7.135) (7.136) (7.137)

As before, let  = x˜1 = x1 − x1d (t),

(7.138)

and  S=

d +λ dt

n .

(7.139)

Then, (n) S˙ = c1 x˜2 + · · · + cn−1 x˜n + f + bu + d − x1d .

(7.140)

For notation purposes, let CE(˜ x) = c1 x˜2 + · · · + cn−1 x˜n

(7.141)

denote the characteristic equation, and let (n) f¯ , f + d − x1d .

(7.142)

S˙ = CE(˜ x) + f¯ + bu.

(7.143)

¯ f¯ , fˆ¯ + ∆f,

(7.144)

Then,

Let

where 174

© 2015, J.K. Hedrick and A. Girard

|∆f¯| ≤ α(x, t) > 0,

(7.145)

b , ˆb∆b,

(7.146)

and

where ∆b represents multiplicative uncertainty for b. Hence b ∆b = , ˆb

(7.147)

bmin ≤ b ≤ bmax ,

(7.148)

with

so that

βmin =

bmin bmax ≤ ∆b ≤ = βmax . ˆb ˆb

(7.149)

It is shown in [8] that using the geometric mean ˆb =

p

bmin bmax

(7.150)

is more natural than using the arithmetic mean ˆb = bmin + bmax . 2

(7.151)

This has to do with the uncertainty being multiplicative. Let 1 u=− ˆb



S CE(˜ x) + fˆ¯ + k φ

 .

(7.152)

We show next that this law has interesting properties. Our goal is to choose k such that S S˙ ≤ 0

(7.153)

175

© 2015, J.K. Hedrick and A. Girard

for |S| ≥ φ. (This means that trajectories that start outside the “implicit” boundary layer |S| = φ eventually reach the boundary layer.) In particular, we want to pick k such that 2

ηS S S˙ ≤ − . φ

(7.154)

η S˙ = − S, φ

(7.155)

S(t) = S(0)e−ηt/φ .

(7.156)

If this holds, then for S 6= 0, we have

and

In the worst case, the time it takes to reach the boundary layer is t1 such that S(t1 ) = φ, that is,

t1 ≤

φ ln(|S(0)|/φ) . η

(7.157)

To find a value of k that guarantees our sliding condition (7.154), consider the special case S = φ > 0. Then, the sliding condition is S˙ ≤ −η.

(7.158)

Calculating S˙ with the expression for u (7.152) yields ¯ S˙ = (1 − ∆b)(fˆ¯ + CE(˜ x)) − k∆b + ∆f.

(7.159)

To validate the results from the previous sub-section, consider briefly the case of no multiplicative uncertainty. Then, ∆b = 1, and we have ¯ S˙ = −k + ∆f.

(7.160)

k ≥ η + α,

(7.161)

For the condition to hold, pick

which is the same result obtained above. 176

© 2015, J.K. Hedrick and A. Girard

Now, returning to the case of multiplicative uncertainty in b, recall the bounds on the model error were βmin ≤ ∆b ≤ βmax .

(7.162)

Then, for the sliding condition to hold, consider the worst case: (1 − βmin )|fˆ¯ + CE(˜ x)| − βmin k + α(x, t) = −η,

(7.163)

and (1 − βmin )|fˆ¯ + CE(˜ x)| + α + η . (7.164) k= βmin In summary, a linear robustness term approach to smoothing the discontinuous sliding mode control law yields to the use of the control law 1 u=− ˆb



S (n) c1 x˜2 + · · · + cn−1 x˜n + fˆ + dˆ − xˆ1d + k φ

 (7.165)

with gain (n) (1 − βmin )|c1 x˜2 + · · · + cn−1 x˜n + fˆ + dˆ − xˆ1d | + α + η k= . βmin As before, if we want to keep the frequency content of u well below λu , choose

βmax kmax 0.

(7.188)

Let us start by treating the non-adaptive case. Then, let the sliding surface be S = y − yd ,

(7.189)

S˙ = −ay 3 + u − y˙ d .

(7.190)

kS + y˙ d . φ

(7.191)

yielding

Choose u=a ˆy 3 −

179

© 2015, J.K. Hedrick and A. Girard

Then, kS , S˙ = (ˆ a − a)y 3 − φ kS = −∆ay 3 − . φ

(7.192) (7.193)

As before, we want ηS 2 φ

(7.194)

ηS S˙ = − , φ

(7.195)

S(t) = S(0)e−ηt/φ .

(7.196)

  kS ηS 2 3 ˙ S S = S −∆ay − . ≤− φ φ

(7.197)

S S˙ ≤ − for |S| > φ. If S 6= 0, at the boundary,

and

Hence we seek k such that

We obtain k through a worst-case analysis, with the worst case for the first term being −α|y 3 | sgn(S), so that k = η + α|y 3 |.

(7.198)

Then, using the static balance condition yields tracking error

φt =

3 kmax η + α|ym | = . λ λ

(7.199)

We now try an adaptive approach, that is, we aim to learn the parameter a online. Let

V1 =

S2 ρ 2 + ∆a . 2 2 180

(7.200) © 2015, J.K. Hedrick and A. Girard

Here, ρ is called the conditioning parameter, and a is assumed constant but unknown (so that a˙ = 0). Let a=a ˆ(t) + ∆a,

(7.201)

and keep u=a ˆy 3 −

kS + y˙ d . φ

(7.202)

Then,   kS 3 ˙ − ρ∆a(a ˆ˙ ), V1 = S −∆ay − φ   kS 2 = − − ∆a ρa ˆ˙ + Sy 3 . φ

(7.203) (7.204)

We select the adaption law 3

Sy a ˆ˙ , − , ρ

(7.205)

yielding 2

kS ≤ 0. V˙ 1 = − φ

(7.206)

In the states S and ∆a, the control surface and adaption dynamics are kS S˙ = −∆a (S + yd (t))3 − , φ S (S + yd (t))3 . ∆a˙ = ρ

(7.207) (7.208)

From a Lyapunov perspective, we have V1 positive definite and V˙ 1 negative semi-definite. Furthermore, the system is time varying. Hence we may use Barbalat’s lemma as discussed in Chapter 5. Here, V1 is lower bounded (by zero), V˙ 1 is negative semi-definite, and V˙ 1 is uniformly continuous (this is true if V¨1 exists and is lower bounded). Verifying, 2kS V¨1 = − φ

  kS 3 ∆a (S + yd (t)) − , φ 181

(7.209)

© 2015, J.K. Hedrick and A. Girard

and all the quantities in the expression are bounded (assuming yd (t) is bounded), so we can use the lemma. Then, V˙ 1 → 0 as t → ∞ and S → 0 as t → ∞. Comparing the adaptive and non adaptive formulation, we see that in the non-adaptive case, k = η + α|y 3 |,

(7.210)

k = η.

(7.211)

while in the adaptive formulation,

The adaptive formulation makes for a lower gain system. This comes at the expense of additional complication (we have to implement the adaption law for a ˆ˙ ). Furthermore, the adaptive formulation provides better performance (S → 0 instead of S going to the boundary layer). We also want to know what happens to ∆a as t → ∞. Recall that ∆a = a − a ˆ(t). As ˙ t → ∞, we have that S → 0, and, through uniform continuity arguments, S → 0, so that ∆a(yd3 (t)) → 0. Hence, ∆a → 0 and a ˆ(t) → a if yd (t) 6= 0.

Figure 7.14: Adaption “turns off” when S is small, and a ˆ converges to the wrong value.

Figure 7.15: Discontinuous adaption.

Remark 7.12 (Persistency of Excitation) If the inputs are not sufficiently “persistent,” S → 0 and a ˆ˙ becomes very small, that is, the adaption “turns off” when S gets small, and 182

© 2015, J.K. Hedrick and A. Girard

the system may converge to an incorrect value for a ˆ, as shown in Figure 7.14. To prevent this, it is possible to use discontinuous adaption. Let ρ V2 = |S| + ∆a2 , 2 ρ = S sgn(S) + ∆a2 . 2

(7.212) (7.213)

Note that S = 0 is problematic. Use the same (smooth) control law as above,

u=a ˆy 3 −

kS + y˙ d . φ

(7.214)

Away from S = 0, we have V˙ 2 = S˙ sgn(S) + ρ∆a∆a, ˙   kS sgn(S) − ∆a ρa ˆ˙ + sgn(S)y 3 . = − φ

(7.215) (7.216)

Then, choosing y 3 sgn(S) a ˆ˙ = − ρ

(7.217)

y3S ˙a ˆ=− ρ

(7.218)

instead of

introduces excitation into the system and can help with convergence of a ˆ to the correct value of a, as shown in Figure 7.15.

7.2.2

General Adaptive SMC SISO Formulation

Consider the system described by

x˙ = f (x) + g(x), y = h(x),

(7.219) (7.220)

where u and y are scalar. Let the control goal be y → yd (t), and r be the relative degree of y. Let the tracking error be 183

© 2015, J.K. Hedrick and A. Girard

 = y − yd (t),

(7.221)

and the sliding surface be  S=

r−1 d +λ . dt

(7.222)

Following the I/O feedback linearization procedure yields y (r) = a(x) + b(x)u,

(7.223)

(r) S˙ = a(x) + b(x)u − yd + CE(z),

(7.224)

and

 where z =  ˙ · · ·

(r−1)

T

. Choose

u=

1 ˆb(x)

(−ˆ a(x) + v) .

(7.225)

Assume further that there are unknown parameters that appear linearly in a(x) and b(x), that is, let a(x) , aT1 (x)a2 ,

(7.226)

where a(x) ∈ R, aT1 is 1 × p1 , known and linear, and a2 is a p1 × 1 vector of unknown constants. Similarly, let b(x) , bT1 (x)b2 ,

(7.227)

where b(x) ∈ R, bT1 is 1×p2 , known and linear, and b2 is a p2 ×1 vector of unknown constants. Then, let a ˆ(x) = aT1 (x)ˆ a2 (t), T ˆb(x) = b (x)ˆb2 (t). 1

(7.228) (7.229)

With this notation, the expression for S˙ is given by 184

© 2015, J.K. Hedrick and A. Girard

 b T b2 (r) −aT1 a ˆ2 + v − yd + CE(z). S˙ = aT1 a2 + 1 bT1 ˆb2

(7.230)

Let us now choose v, the synthetic input. To this effect, let us denote the parameter error vectors by a ˜ 2 = a2 − a ˆ2 (t), ˜b2 = b2 − ˆb2 (t).

(7.231) (7.232)

Then, h S˙ = aT1

Tˆ ) bT 2 1 (v−a1 a ˆb2 bT 1

 i a ˜2 (r) ˜b2 + v − yd + CE(z).

(7.233)

Then, assuming for instance that we want a smooth control law, let (r)

v = yd − CE(z) −

kS . φ

(7.234)

Let us further denote T

w =

h

aT1

Tˆ ) bT 2 1 (v−a1 a T ˆ b1 b2

i

(7.235)

and   a ˜2 ˜ θ= ˜ . b2

(7.236)

kS S˙ = wT θ˜ − . φ

(7.237)

1 1 V1 = S 2 + ρθ˜T θ˜ > 0. 2 2

(7.238)

Then, we have

We now use a Lyapunov function

(It is also possible to pick θ˜T Qθ˜ for the second term, with Q > 0 and diagonal.) Then, 185

© 2015, J.K. Hedrick and A. Girard

2

kS ˆ˙ + θ˜T (wS − ρθ). V˙ 1 = − φ

(7.239)

˙ wS θˆ = . ρ

(7.240)

Choose the adaption law

Then, 2

kS ≤ 0. V˙ 1 = − φ

(7.241)

Since we have V1 > 0 and V˙ 1 ≤ 0, we have stability of the origin, and S and θ˜ are bounded. As in the example, we can use Barbalat’s lemma since V1 is lower bounded, V˙ 1 ≤ 0, and V˙ 1 is uniformly continuous. This requires V¨1 to be bounded, where 2kS S˙ . V¨1 = − φ

(7.242)

Since all its components are bounded, V¨1 is bounded, and hence, as t → ∞, V˙ 1 → 0, S → 0, and (t) → 0. Note that there is no guarantee that θ˜ → 0. Even if we have the wrong values of the parameters, the tracking error still goes to zero. However, it may matter to get the values of the parameters right. They may be interesting, but they may also drift into unstable parts of the state space. Intuitively, if S → 0 and S˙ → 0, we roughly have wT θ˜ → 0. Using persistency of excitation arguments can yield θ˜ → 0. For instance, it may be useful to define a discontinuous Lyapunov function to generate “internal” excitation, for example 1 ˜ V2 = |S| + ρθ˜T θ, 2 1 ˜ = S sgn(S) + ρθ˜T θ. 2

(7.243) (7.244)

This yields ˙ w sgn(S) θˆ = . ρ 186

(7.245) © 2015, J.K. Hedrick and A. Girard

7.3 7.3.1

MIMO Sliding Mode Control Special Case ( Inspired by Robotics)

Let us first consider a special case, as described in [8] and originally inspired by robotics applications. Consider a system described by equations of motion of the form

H(q)¨ q + C(q, q) ˙ q˙ + g(q) = τ,

(7.246)

where H(q), the inertia matrix, is positive definite, q is a n×1 vector that contains the (joint) position coordinates, C contains centripetal and Coriolis terms as well as viscous friction, g contains gravitational terms, and τ is the joint torque vector, assuming one actuator per joint, so that it is also n × 1. If we had perfect knowledge of the system, we could define a “synthetic control”, u, such that

τ = H(q)u + C(q, q) ˙ q˙ + g(q),

(7.247)

where q¨ = u and u is the synthetic control. This is called the computed torque method. We can use many different approaches to determine u, for example PID, H∞ , or sliding mode control. Let us design a smooth sliding mode controller. Let Si = q˙i − q˙id + λi (qi − qid ),

(7.248)

where i ∈ [1, n] and n is the number of degrees of freedom of the robot. Then, let

u = q¨id − λi (q˙i − q˙id ) − ki

Si . φi

(7.249)

This control law allows one to choose different λi , that is, to account for different actuator bandwidths on each joint, and also to choose different φi , that is different accuracies on each joint. With this choice of u, Si S˙ i = −ki . φi

(7.250)

Robustness issues may appear in the presence of uncertainty. Letting ˆ ˆ q) τ = H(q)u + C(q, ˙ q˙ + gˆ(q), 187

(7.251)

© 2015, J.K. Hedrick and A. Girard

one needs to check each channel individually and select the ki for 2

S Si S˙ i ≤ −ηi i , i ∈ [1, n]. φi

(7.252)

One approach to robustness is to place an integrator in the definition of the sliding surface, that is, let

Si = q˙i − q˙id + 2λi (qi − qid ) +

λ2i

t

Z

(qi − qid ) dτ.

(7.253)

0

This results in having two poles at −λi for each degree of freedom (instead of one previously), and helps with robustness problems, especially in dealing with constant offsets. An improved algorithm exists [8] that leads directly to an adaptive formulation. Let q˜ = q − qd (t),

(7.254)

and further let S = q˜˙ + Λ˜ q, = q˙ − q˙d + Λ˜ q,

(7.255) (7.256)

where S is n × 1, and Λ is n × n, diagonal, and positive definite. Define a reference velocity, q˙r = q˙d − Λ˜ q.

(7.257)

S = q˙ − q˙r .

(7.258)

With this notation,

Substituting into the equations of motion H q¨ + C q˙ + g = τ

(7.259)

H q¨ = τ − C(q, q)(S ˙ + q˙r ) − g.

(7.260)

yields

Let 188

© 2015, J.K. Hedrick and A. Girard

1 V = S T HS. 2

(7.261)

Note that H = H(q) is not constant, but is positive definite. Then, i 1 h ˙T ˙ + S T H S˙ . V˙ = S HS + S T HS 2

(7.262)

Now, for many robotics applications, a classical result is that H˙ − 2C

(7.263)

is skew-symmetric [8]. This yields an elegant simplification, since if a matrix Q is skewsymmetric, then xT Qx = 0. With this assumption, V˙ = S T [τ − H q¨r − C q˙r − g] .

(7.264)

τ = H q¨r + C q˙r + g − Kd S,

(7.265)

If we let

where the matrix Kd > 0 provides robustness, then V˙ = −S T Kd S,

(7.266)

and the origin of the system is guaranteed to be globally asymptotically stable (V > 0, V˙ < 0). This control approach is elegant for perfect models. However, there may still be robustness issues. A MIMO adaptive algorithm is proposed in [8]. Let ˆ q¨r + Cˆ q˙r + gˆ − Kd S. τ =H

(7.267)

Now assume that H, C and g can be linearly parametrized. Rewrite τ in the form of a known “data” matrix and a vector of unknown constants. Then, ˆ q¨r + Cˆ q˙r + gˆ = Y (q, q, H ˙ q˙r , q¨r )a(t),

(7.268)

where Y is the n × p data matrix, a and a ˆ are the p × 1 vectors of unknown constants and estimates, and p is the number of parameters. Define 189

© 2015, J.K. Hedrick and A. Girard

a ˜,a ˆ(t) − a.

(7.269)

1 1 T −1 V = S T HS + a ˜ Γ a ˜, 2 2

(7.270)

Let

where H > 0, and Γ > 0 is a weighting matrix. Then, let τ =Ya ˆ − Kd S,

(7.271)

V˙ = −S T Kd S + a ˜T (a ˆ˙ + ΓY T S),

(7.272)

a ˆ˙ = −ΓY T S.

(7.273)

V˙ = −S T Kd S

(7.274)

and calculate

to yield the adaptation law

Then,

is negative semi-definite, so using Barbalat’s and invariance results, S → 0 as t → ∞ and a ˜ is bounded, and with persistency of excitation one can achieve a ˜ → 0 as t → ∞.

7.3.2

General MIMO Nonlinear Control

All methods presented here rely on performing I/O feedback linearization first, then using sliding mode control. Because notation in the general case can become overwhelming, we treat many control design techniques by demonstrating them on examples. I/O Feedback Linearization Consider the system described by

x˙ = f (x) + g(x)u, y = h(x), 190

(7.275) (7.276)

© 2015, J.K. Hedrick and A. Girard

with x ∈ Rn , u ∈ Rm , and y ∈ Rm (the system is square). Let yi = hi (x) for i ∈ [1, m]. Taking derivatives of the output y for k ∈ [0, ri − 1], where ri is the relative degree of each yi , yields

(k)

yi

dk y i , dtk = Lkf hi , =

(7.277) (7.278)

and

(r ) yi i

=

Lrfi hi

+

m X

Lgj (Lrfi −1 hi )uj .

(7.279)

j=1

Let  Ji = Lg1 (Lrfi −1 hi ) · · ·

 Lgm (Lrfi −1 hi ) ,

(7.280)

where Ji is 1 × m and at least one its elements has to be different from zero. With this notation, (ri )

yi

= Lrfi hi + Ji u.

(7.281)

For notation purposes, further let h y r , y1(r1 ) y2(r2 ) · · ·

(r ) ym m

iT

(7.282)

be an m × 1 vector (note that we drop the parentheses on y (r) to simplify notation), and  l , Lrf1 h1 · · ·

Lrfm hm

T

(7.283)

also be an m × 1 vector. Finally, let  J = J1 · · ·

Jm

T

(7.284)

be an m × m matrix. Then, we have y r = l + Ju. 191

(7.285) © 2015, J.K. Hedrick and A. Girard

Assume that J is invertible everywhere. We can define a synthetic input, v , l + Ju,

(7.286)

y r = v.

(7.287)

yiri = vi

(7.288)

or

In component form,

for i ∈ [1, m]. Then, the vi can be designed as decoupled controllers, and u can be found from u = J −1 (v − l).

(7.289)

Remark 7.13 Note that robustness issues are difficult to deal with in this formulation. Sliding Control Formulation This is similar to MIMO I/O feedback linearization but includes a robustness handling mechanism. We define m sliding surfaces,

Si =

yiri −1



ri −1 yid

+

rX i −1

ri −1−j ) βij (yiri −1−j − yid

(7.290)

j=1

for i ∈ [1, m]. The βij coefficients are chosen so that Si = 0 is a stable differential equation with desired error dynamics. Note that βi0 = 1 for i ∈ [1, m]. If the desired bandwidth is λi , then choose  Si =

d + λi dt

ri (yi − yid ).

(7.291)

Further define the m × 1 vector  Pr1 −1 j=0

 l1 ,  Prm −1 j=0

r1 −j β1j Lrf1 −j h1 − y1d .. .

βmj

Lrfm −j hm 192



 

rm −j ymd



 ,

(7.292)

© 2015, J.K. Hedrick and A. Girard

and  S˙ , S˙ 1 · · ·

S˙ m

T

.

(7.293)

In this notation, S˙ = l1 + Ju, = v1 .

(7.294) (7.295)

Assume that J is invertible everywhere. The vector u can be chosen in several different ways to make S(t) → 0 as t → ∞. Let l1 + Ju = v1 , −f˜(S).

(7.296)

S˙ = −f˜(S).

(7.297)

Then,

Some possibilities for f˜(S) are: 1. f˜ = KS, with K > 0, possibly K diagonal, 2. a discontinuous function, for example f˜(S) = [K1 sgn(S1 ), ..., Km sgn(Sm )]T , yielding S˙ i = −Ki sgn(Si ), 3. f˜(S) = KS/||S||, with K > 0. This only switches when all components go to zero (smoother). Remark 7.14 Robustness requires that Si S˙ i < 0 in the presence of model error. Remark 7.15 Zero dynamics are an issue if

rT =

m X

ri < n.

(7.298)

1

Mismatched Systems Mismatched systems get their names from the fact that the uncertainty is not in the same channel as the control. Usually, to get to the uncertainty from the control, one has to go through an integrator, which can cause problems. 193

© 2015, J.K. Hedrick and A. Girard

Example 7.1 (Mismatched Systems) Consider the system x˙ 1 = x2 + ∆1 (x1 ), x˙ 2 = u, y = x1 ,

(7.299) (7.300) (7.301)

with |∆1 | < α(x1 ) > 0. The control goal is x1 → 0 as t → ∞. The system is not in canonical form, but is in strict feedback form (i.e., ∆1 = ∆1 (x1 )). Attempting a standard sliding controller design yields S , x˙ 1 + λx1 ,

(7.302)

and S˙ = x¨1 + λ(x2 + ∆1 ), d∆1 = x˙ 2 + + λ(x2 + ∆1 ), dt d∆1 = u + λx2 + λ∆1 + . dt

(7.303) (7.304) (7.305)

˙ 1. In order to make S S˙ < 0, we need bounds on both ∆1 and ∆ Nonlinear Damping and Integrator Backstepping Example 7.2 (Nonlinear Damping) Consider the following first-order example, due to Krstic et al. [?], that illustrates the use of a technique called nonlinear damping to deal with non-Lipschitz nonlinearities. Let x˙ = u + φ(x)∆(x, t),

(7.306)

where φ(x) is smooth and known but not necessarily Lipschitz, and ∆(x, t) is bounded, that is, |∆| < ∆∞ > 0. It is possible to design a controller for this system using “brute force,” that is, let 1 V = x2 , 2

(7.307)

and V˙

= xx, ˙ = x(u + φ∆). 194

(7.308) (7.309)

© 2015, J.K. Hedrick and A. Girard

If φ > 0, let u , −Cx − φ∆∞ sgn(x),

(7.310)

which guarantees V˙

= −Cx2 − φ∆∞ x sgn(x), < 0.

(7.311) (7.312)

Another method is to use nonlinear damping, which allows the consideration of non-Lipschitz nonlinearities. Let u = −Cx − kφ2 x,

(7.313)

1 V = x2 , 2

(7.314)

with k > 0 and C > 0. Let

and V˙

= xx, ˙ = x(u + φ∆), = x(−Cx − kφ2 x + φ∆), 2  ∆2 ∆ 2 , + = −Cx − k xφ − 2k 4k

(7.315) (7.316) (7.317) (7.318)

where the last line is obtained by completing the square. Therefore, ∆2 V˙ ≤ −2CV + , 4k

(7.319)

and one can shown that V is bounded, ||∆||2∞ ≤ max V0 , 8kC 

V∞

 ,

(7.320)

and therefore that 

||x||∞

||∆||∞ ≤ max |x0 |, √ 2 kC 195

 .

(7.321)

© 2015, J.K. Hedrick and A. Girard

The same idea can be applied to higher order systems, resulting in a powerful method called integrator backstepping and due to Krstic et al. [?]. Example 7.3 (Integrator Backstepping for Second Order Mismatched System) Consider the mismatched system x˙ 1 = x2 + ρ1 (x1 )∆1 , x˙ 2 = u,

(7.322) (7.323)

where ρ1 (x1 ) is smooth and known, but not necessarily Lipschitz, and |∆1 | ≤ 1. The control goal is to find a control law u such that x1 , x2 → 0 as t → ∞. Let z1 = x1 − x1d , = x1 ,

(7.324) (7.325)

z2 = x2 − x2d ,

(7.326)

and

where x2d is a “synthetic” control input. Then, z˙1 = z2 + x2d + ρ1 ∆1 , z˙2 = u − x˙ 2d ,

(7.327) (7.328)

where x2d makes the system such that there is a “control input” in each channel. Let 1 1 V = z12 + z22 , 2 2

(7.329)

V˙ = z1 (z2 + x2d + ρ1 ∆1 ) + z2 (u − x˙ 2d ).

(7.330)

x2d = −k1 z1 − k2 ρ21 z1 ,

(7.331)

and

Let

where the first term contains the desired dynamics and the second term uses nonlinear damping, yielding 196

© 2015, J.K. Hedrick and A. Girard

x˙ 2d = −φ1 x2 − φ1 ∆1 ,

(7.332)

with

φ1 = k1 + k2 ρ21 + 2k2 z1 ρ1

dρ1 . dx1

(7.333)

One can see that many terms are created already, and predict that there may be “explosion of terms” problems with this method. Nonetheless, continuing yields V˙ = z1 (z2 − k1 z1 − k2 ρ21 z1 + ρ1 ∆1 ) + z2 (u − φ1 x2 − φ1 ∆1 ),

(7.334)

u = −z1 − φ1 x2 − k1 z2 + u˜.

(7.335)

and let

Then, completing the square,

V˙ =

−k1 (z12

+

z22 )

 − k2

∆1 ρ1 z1 − 2k2

2 +

∆21 + z2 φ1 ρ1 ∆1 + z2 u˜. 4k2

(7.336)

Let u˜ = −k2 φ21 z2 .

(7.337)

Even for our simple second-order example, things are getting complicated. There is an easier way that we discuss next. Until then, 2  2  ∆ ∆2 ∆ 1 1 V˙ = −2k1 V − k2 ρ1 z1 − − k2 ρ1 φ1 z2 − + 1, 2k2 2k2 2k2

(7.338)

1 V˙ ≤ −2k1 V + . 2k2

(7.339)

so that

Letting 197

© 2015, J.K. Hedrick and A. Girard

  z z= 1 , z2

(7.340)

1 V = ||z||2 , 2

(7.341)

and recalling that

we can show that  1 . ≤ max ||z(0)||, √ 2k1 k2 

||z||∞

(7.342)

Remark 7.16 Summarizing, for our simple second-order example, u = −z1 − φ1 x2 − k1 z2 − k2 ρ21 φ21 z2

(7.343)

with dρ1 . dx1

φ1 = k1 + k2 ρ21 + 2k2 z1 ρ1

(7.344)

The method suffers from “explosion of terms.” Remark 7.17 The origin of the system is semi-globally stable (not asymptotically), so the method guarantees that system trajectories reside in a controllable ball as t → ∞. Multiple/Dynamic Surface Control Another approach, multiple surface control, is due to Yip et al. [11]. Example 7.4 Consider the system x˙ 1 = x2 + θx31 , x˙ 2 = u,

(7.345) (7.346)

with |θ| < α(x1 ) > 0. The control goal is x1 → 0. Let

S 1 = x1 ,

(7.347)

198

© 2015, J.K. Hedrick and A. Girard

leading to S˙ 1 = x˙ 1 , = x2 + θx31 .

(7.348) (7.349)

x2d = −λ1 S1 − αx31 ,

(7.350)

S˙ 1 = x2 − x2d + (θ − α)S13 − λ1 S1 .

(7.351)

S2 = x2 − x2d .

(7.352)

S˙ 2 = u − x˙ 2d .

(7.353)

u = −λ2 S2 + x˙ 2d .

(7.354)

S˙ 2 = −λ2 S2 .

(7.355)

We want

yielding

Now, let

Then,

Let

Then,

However, x˙ 2d may be difficult to obtain due to explosion of term issues and uncertainty. For instance, let α be a constant for simplicity (even more terms appear if α = α(x1 )). Then, x˙ 2d = −λ1 S˙ 1 − 3αx21 x˙ 1 , = −(3αx21 + λ1 )(x2 + θx31 ), = −(3αx21 + λ1 )x2 − 3αθx51 .

(7.356) (7.357) (7.358)

Note that θ is not known exactly (it is only bounded), and the expression has many terms. In practice, even though x2d is known, x˙ 2d is difficult to obtain. With our new expression for x˙ 2d , 199

© 2015, J.K. Hedrick and A. Girard

S˙ 2 = u + (3αx21 + λ1 )x2 + 3αx21 (θx31 ).

(7.359)

u = −(3αx21 + λ1 )x2 − λ2 S2 − 3αx21 (α|x31 | sgn(S2 )).

(7.360)

Let

In practice, for implementation, a numerical derivative for x˙ 2d is often used, for instance,

x˙ 2d ≈

x2d (n + 1) − x2d (n) , T

(7.361)

leading to a method called dynamic surface control and due to Swaroop et al. [10], [9]. Example 7.5 (Dynamic Surface Control) Let us revisit the previous example using dynamic surface control. Recall, x˙ 1 = x2 + θx31 , x˙ 2 = u,

(7.362) (7.363)

with |θ| < α(x1 ) > 0. The control goal is x1 → 0. As before, set S 1 = x1 ,

(7.364)

S˙ 1 = x2 + θx31 .

(7.365)

x2d = −αx31 − λ1 S1 .

(7.366)

yielding

Let the synthetic input be

Now, to avoid problems with differentiation of x2d , set τ2 z˙2 + z2 = x2d , z2 (0) = x2d ,

(7.367) (7.368)

and let 200

© 2015, J.K. Hedrick and A. Girard

S2 = x2 − z2 .

(7.369)

Then, S˙ 2 = u − z˙2 , x2d − z2 . = u− τ2

(7.370) (7.371)

Choose

u=

x2d − z2 − λ2 S2 . τ2

(7.372)

This yields S˙ 1 = −λ1 S1 and S˙ 2 = −λ2 S2 . The control law to be implemented consists of x2d = −αx31 − λ1 x1 , x2d − z2 z˙2 = , τ2 z2 (0) = x2d , x2d − z2 u = − λ2 (x2 − x2d ). τ2

(7.373) (7.374) (7.375) (7.376)

The control law requires no explicit differentiation of the model or model error bounds, and there is no explosion of terms. However, the stability proof for such systems is not easy. The complete proof for the general case is available in [10], [9]. We give only a sketch for our particular example here. We consider the stability of S˙ 1 = S2 + z2 + θS13 , τ2 z˙2 = x2d − z2 , S˙ 2 = −λ2 S2 ,

(7.377) (7.378) (7.379)

with S2 = x2 − z2

(7.380)

x2d = −αx31 − λ1 S1 .

(7.381)

and

201

© 2015, J.K. Hedrick and A. Girard

This is a third order, nonlinear, uncertain dynamic system. We want S1 → 0, S2 → 0, and z2 → x2d . To consider stability of the origin, pick y = z2 − x2d ,

(7.382)

so that the goal is S1 → 0, S2 → 0, and y → 0. Then, select 1 V = (S12 + S22 + y 2 ), 2

(7.383)

V˙ = · · · + y y, ˙

(7.384)

yielding

where y˙ = x˙ 2 − x˙ 2d , and the x˙ 2d causes explosion of terms. A theorem is proven in [10] that states that there exist a set of gains λ1 , · · · , λn (for an nth order system, in our case n = 2), and filter time constants τ2 , · · · , τn such that the system is semi-globally stable. Intuitively, given a ball of initial conditions in the state space, if system trajectories start in this ball, they stay in this or a smaller ball. Given a different initial condition ball, the system must be redesigned. The general structure of dynamic surface control is as follows: consider a system in strict feedback form,

x˙ 1 = x2 + f1 (x1 ) + δf1 (x1 ), x˙ 2 = x3 + f2 (x1 , x2 ) + ∆f2 (x1 , x2 ), .. . . = .. x˙ n−1 = xn + fn−1 (x1 , · · · , xn−1 ) + ∆fn−1 (x1 , · · · , xn−1 ), x˙ n = u + fn (x1 , · · · , xn )).

(7.385) (7.386) (7.387) (7.388) (7.389)

Let all the fi be smooth, with fi (0, · · · , 0) = 0. Let the ∆fi be unknown, but locally Lipschitz (or use nonlinear damping). Then, for i ∈ [1, n − 1], the design algorithm is as follows:

Si = xi − xid , x¯i+1 , −fi + x˙ id − λi Si , τi+1 x˙ (i+1)d + x(i+1)d = x¯i+1 .

(7.390) (7.391) (7.392)

Then, for i = n, let 202

© 2015, J.K. Hedrick and A. Girard

Sn = xn − xnd , u = −fn + x˙ nd − λn Sn , x¯n − xnd − λn Sn . = −fn + τn

(7.393) (7.394) (7.395)

Let us consider another example. Example 7.6 (DSC for Third-Order System (with Nonlinear Damping)) Consider the system

x˙ 1 = x2 + ρ1 (x1 )∆1 , x˙ 2 = x3 , x˙ 3 = u,

(7.396) (7.397) (7.398)

with ρ1 (x1 ) = x21 , ∆1 = sin x1 for simulation purposes, while the controller knows only the bound |∆1 | ≤ 1. We want x1 (t) → x1d (t), for example x1d (t) = sin t. The first surface is given by S1 = x1 − x1d ,

(7.399)

yielding S˙ 1 = x2 + ρ1 ∆1 − x˙ 1d .

(7.400)

Define x¯2 = x˙ 1d − λ1 S1 − kx41 S1 ,

(7.401)

using the nonlinear damping approach (φ2 or ρ21 yields x41 ). Then, set up the filter, τ2 x˙ 2d + x2d = x¯2 , x2d (0) = x¯2 (0).

(7.402) (7.403)

The second surface is S2 = x2 − x2d ,

(7.404)

yielding 203

© 2015, J.K. Hedrick and A. Girard

x¯2 − x2d + x3 . S˙ 2 = − τ2

(7.405)

x¯2 − x2d − λ2 S2 . τ2

(7.406)

Then, let

x¯3 = Setting up the filter,

τ3 x˙ 3d + x3d = x¯3 , x3d (0) = x¯3 (0).

(7.407) (7.408)

The third surface is then S3 = x3 − x3d ,

(7.409)

yielding S˙ 3 = u − x˙ 3d ,   x¯3 − x3d = u− . τ3

(7.410) (7.411)

Pick

u=

x¯3 − x3d − λ3 S3 . τ3

(7.412)

One needs to choose λ1 , λ2 , λ3 , τ2 and τ3 . The controller design yields S˙ 1 ≈ −λ1 S1 (because of the uncertainty), S˙ 2 = −λ2 S2 , and S˙ 3 = −λ3 S3 . Example 7.7 (Adaptive DSC for Third Order System) Let us consider an adaptive DSC example, due to Yip et al. [11]. The system under consideration is described by x˙ 1 = a1 f1 (x1 ) + x2 , x˙ 2 = a2 f2 (x1 , x2 ) + x3 , x˙ 3 = u.

(7.413) (7.414) (7.415)

The system is in strict feedback form. Here, a1 and a2 are unknown constants. The control goal is x1 → r(t). 204

© 2015, J.K. Hedrick and A. Girard

Let the first surface be given by S1 = x1 − r(t),

(7.416)

S˙ 1 = a1 f1 + x2 − r. ˙

(7.417)

x¯2 = −ˆ a1 f1 + r˙ − λ1 S1 .

(7.418)

yielding

Define

Then, setting up the first numerical differentiation, τ2 x˙ 2d + x2d = x¯2 , x2d (0) = x¯2 (0).

(7.419) (7.420)

Choose the second surface to be S2 = x2 − x2d ,

(7.421)

S˙ 2 = a2 f2 + x3 − x˙ 2d .

(7.422)

x¯3 = −ˆ a2 f2 + x˙ 2d − λ2 S2 ,

(7.423)

τ3 x˙ 3d + x3d = x¯3 , x3d (0) = x¯3 (0).

(7.424) (7.425)

with

Define

with associated filter

Then, let the third surface be S3 = x3 − x3d , 205

(7.426) © 2015, J.K. Hedrick and A. Girard

with S˙ 3 = u − x˙ 3d .

(7.427)

u = x˙ 3d − λ3 S3 .

(7.428)

Choose

Parameter update laws are obtained from a quadratic Lyapunov derivation, yielding S1 f1 , a ˆ˙ 1 = ρ1 S2 f2 a ˆ˙ 2 = . ρ2

(7.429) (7.430)

Control gains to be chosen include λ1 , λ2 , λ3 , τ2 , τ3 , ρ1 and ρ2 .

7.4

Discrete Time Sliding Mode Control

Figure 7.16: Implementation of sliding controllers – General problem.

Discrete time sliding mode control and digital implementation of sliding controllers is covered by [?]. The general problem is as shown in Figure 7.16. In general terms, there are two schools of controller design: 1. Use a continuous plant model and design a continuous controller, but implement the resulting controller digitally, 2. Use a discretized plant model and design a discrete controller, then implement digitally. 206

© 2015, J.K. Hedrick and A. Girard

Which method is best depends on the application at hand. 1. If T 0,

(7.483)

where k is some positive constant and w is some regressor vector. Note that again we cannot calculate S without knowing the true value of Td . Either assume that you know Td or try multiple surface sliding control. In multiple-surface sliding control, you do not need the c5 term in the Lyapunov function. (b) Simulation: Simulate the performance of your adaptive controller when the correct value of c4 is twice the given nominal value. Do you get parameter convergence? If so, is this a violation of the persistency of excitation condition? You have to be careful in selecting the adaptation gains ρ1 and ρ2 since the adaptation performance is greatly affected by this choice. A reasonable first choice is ρ1 = 10−2 and ρ2 = 10−4 . (c) Non-smooth adaptation law: Replace S in the adaptation law by sgn(S), and observe the parameter convergence for this case. Discuss/Explain. Problem 7.3 (Robust Engine Control, Continued) Let us consider the internal combustion engine with multi-port fuel-injectors shown in Figure 7.18. Assume that the engine state equations are as given in Problem 6.4. Additional system equations for air/fuel ratio control are as follows: m ˙ ao = c2 ωe ma , 1 (m ˙ fc − m ˙ f o ), m ¨ fo = τf 214

(7.484) (7.485)

© 2015, J.K. Hedrick and A. Girard

Figure 7.18: Schematic of Engine in Problem 7.3.

where cˆ2 = 0.0952, τf = 0.05, and m ˙ f c is the fuel command. The oxygen sensor output is described by y(t) = sgn (m ˙ ao (t − td ) − β m ˙ f o (t − td )) ,

(7.486)

where β = 14.7 and td = 0.02 + 4π/ωe (t) (in seconds). The throttle command is described by π  α(t) = 16 − 10 cos t 8

(7.487)

for 0 ≤ t ≤ 20, and the initial conditions are ωe = 137.9rad and ma = 2.11 × 10−3 kg. 1. PI control: Assume that

c2 = (1 + e(t))ˆ c2

(7.488)

πt . 3

(7.489)

where

e(t) = 0.1 sin 215

© 2015, J.K. Hedrick and A. Girard

The objective of the control is to keep m ˙ ao = β. m ˙ fo

(7.490)

Neglecting the time delay, try to tune the gains Kp and Ki of the following feed-forward plus PI controller to achieve good air to fuel (A/F) ratio:

m ˙ fc

1 = m ˙ ao + Kp y + Ki β

Z

t

y dτ.

(7.491)

0

Note that the fuel command, m ˙ f c , is given in kg and hence it should be a rather small number. Tune your controller gains accordingly. Simulate this controller for the case with sensor time delay. (When you are designing a controller, you know only cˆ2 , |e|max and |e| ˙ max ). Note that this problem is numerically sensitive, especially when the throttle angle is small. To avoid this problem, you can simulate the system in this way: (a) Simulate from 0 seconds to 2 milliseconds with the control input fixed using “ode45”. (b) Simulate from 2 milliseconds to 4 milliseconds in the same way, and go on until the final time. You can use for-loops in Matlab. 2. Sliding mode control: Design a sliding mode controller for the same error e(t). Your controller should not use m ˙ f o , but only the oxygen sensor output, y(t). Neglect the sensor time delay both in design and in simulation. (|A/F − β| ≤ 0.2 is achievable). Hint: Choose S = m ˙ ao − β m ˙ f o. 3. Simulation: Now, simulate the same sliding controller for the case with sensor time delay. Discuss the effects of the time delay.

216

© 2015, J.K. Hedrick and A. Girard

Chapter 8 Observer Design 8.1

Motivation

So far, we have studied a number of nonlinear control techniques, including: 1. Linearization, 2. I/O and I/S feedback linearization, 3. Sliding control (robust I/O linearization), 4. Integrator backstepping, 5. Dynamic surface control. A big weakness of all these control methodologies is that they require knowledge of the full state. This is sometimes impossible to measure, and sometimes possible, but expensive. In general, we only have access to p sensor outputs, that is, z = M x + v(t),

(8.1)

where z ∈ Rp is the measurement vector, M is the p × n measurement matrix, x ∈ Rn is the state vector, and v(t) ∈ Rp represents measurement noise. As in linear systems, the measurements in a nonlinear system are usually linearly related to the state (this is a property of any useful sensor). The best-known methodology for dealing with a full state feedback controller is to separate the problem into a static controller (for example u = −kx) and a dynamic observer. We then: 1. Design the controller as if x = xˆ, where xˆ is the estimate of the state x, 2. Design the observer so that xˆ → x as quickly as possible. This approach is illustrated in Figures 8.1 and 8.2, where Figure 8.1 shows the general problem that we would like to solve, while Figure 8.2 shows separate controller and observer. 217

Figure 8.1: General nonlinear control problem.

Figure 8.2: Separated problem showing separate controller and observer.

218

© 2015, J.K. Hedrick and A. Girard

8.2

Review of Linear Observers

The separation approach is standard from linear systems theory. Consider the system described by x˙ = Ax + Bu + w(t),

(8.2)

z = M x + v(t).

(8.3)

xˆ˙ = Aˆ x + Bu + L(z − M xˆ),

(8.4)

with measurement

Let

where the last term is basically a correction term, (z − zˆ). The error is given by x˜ = x − xˆ, and the error dynamics are x˜˙ = x˙ − xˆ˙ , = Ax + Bu + w − Aˆ x − Bu − L(M x + v − mˆ x), = (A − LM )˜ x + w(t) − Lv(t).

(8.5) (8.6) (8.7)

There are two different classical approaches to dealing with the choice of L, Luenberger observers and Kalman-Bucy filters.

8.2.1

Deterministic (Luenberger) Observer

Ignore w(t), v(t). Let x˜˙ = (A − LM )˜ x,

(8.8)

and if (A, M ) is observable, then the eigenvalues of (A − LM ) can be placed arbitrarily.

8.2.2

Stochastic (Kalman-Bucy) Filter)

L is chosen to minimize the variance of x − xˆ, the state estimation error. We have xˆ˙ = Aˆ x + Bu + L(z − M xˆ).

(8.9)

Let 219

© 2015, J.K. Hedrick and A. Girard

L = P M T R−1 ,

(8.10)

where R contains noise statistics and is associated with v, so that the intuition is to make gains large for small variance. Note that for scalars, R−1 is 1/r. The matrices P and Q must verify P˙ = AP + P AT + Q − P M T R−1 M P.

(8.11)

The steady-state Kalman filter is usually implemented. In that case the last equation becomes: AP + P AT + Q − P M T R−1 M P = 0,

(8.12)

and is usually referred to as the Algebraic Ricatti Equation.

8.3

Nonlinear Observer Classification

We consider three broad classes of nonlinear observers. 1. Deterministic, Lyapunov-based nonlinear observers. Thau’s method is a common sense approach that mimics the nonlinear dynamics and adds a linear correction term. It is not constructive, and is mainly an analysis method. The control analog is linearization. Raghavan’s method uses the same observer structure as Thau’s method, but provides a constructive iteration to get the gains. 2. Geometric observers: We seek a state transformation such that the nonlinear system “looks” linear, and apply well known linear techniques, that is, we seek a new state so that when we observe this new state, the error dynamics are linear. Geometric observers are the observer analog to I/S linearization. 3. Sliding observers: Explicitly account for imperfect models. Sliding observers are the observer analog to sliding mode control. Nonlinear observers are generally of one of two types, deterministic or stochastic. The dominant stochastic nonlinear observer is called an Extended Kalman Filter. If

x˙ = f (x) + g(x)u, y = h(x),

(8.13) (8.14)

use a standard Kalman filter, but with 220

© 2015, J.K. Hedrick and A. Girard

A=

∂f ∂h , C= ∂x ∂x

(8.15)

taken at the current operating point. The nonlinearities are treated as process noise. We consider mainly nonlinear deterministic observers in the following.

8.4 8.4.1

Deterministic, Lyapunov-Based Nonlinear Observers Lipschitz Continuity

As a preliminary to discussing deterministic nonlinear observers, recall the following. Definition 8.1 Let f : Rn → Rn . Then, f is globally Lipschitz if there exists a γ (called the Lipschitz constant of f ) such that

∀(x1 , x2 ), ||f (x1 ) − f (x2 )|| ≤ γ||x1 − x2 ||.

(8.16)

For intuition building purposes, let us consider the scalar case. Then, the Lipschitz condition is equivalent to

∀(x1 , x2 ), |f (x1 ) − f (x2 )| ≤ γ|x1 − x| .

(8.17)

The condition is equivalent to f having a bounded derivative. Indeed, if x2 = x1 + h, |f (x1 ) − f (x1 + h)| ≤ γ|h|,

(8.18)

f (x1 ) − f (x1 + h) ≤ γ. ∀h, h

(8.19)

lim f (x1 ) − f (x1 + h) ≤ γ ⇔ ∂f ≤ γ. h→0 ∂x h

(8.20)

or

In particular,

Hence, in the scalar case, if f has a bounded derivative, f is Lipschitz. Figures 8.3 and 8.4 show examples of both Lipschitz and non-Lipschitz functions. 221

© 2015, J.K. Hedrick and A. Girard

Figure 8.3: Lipschitz and non-Lipschitz functions.

Figure 8.4: Lipschitz and non-Lipschitz functions.

8.4.2

Thau’s Method

Consider the system described by

x˙ = Ax + g(t, u, z) + f (x), z = M x.

(8.21) (8.22)

Assume that there is no noise, and that the nonlinearity, f , depends only on x. Then, Ax is the LTI part, the g part can be cancelled out (we know t, u and z), and the f part represents the rest of the system. Let the observer be xˆ˙ = Aˆ x + g(t, u, z) + f (ˆ x) + L(z − M xˆ).

(8.23)

Given an L and the Lipschitz constant of f , γ, Thau’s method tells us whether or not the L gives asymptotically stable error dynamics. This method is not constructive, that is, it gives a yes/no answer, and no suggestion on choosing an improved L if needed. Let the error be denoted by x˜ = x − xˆ. 222

(8.24) © 2015, J.K. Hedrick and A. Girard

The error dynamics are given by x˜˙ = x˙ − xˆ˙ , = (A − LM )˜ x + f (x) − f (ˆ x).

(8.25) (8.26)

Assume further that (A, M ) is an observable pair, and that f is globally Lipschitz, Theorem 8.1 (Thau, 1973 [?]) Under the above assumptions, the origin of the system given by x˜˙ = (A − LM )˜ x + f (x) − f (ˆ x)

(8.27)

is globally asymptotically stable (˜ x → 0 as t → ∞) if

γ
0 and Q > 0 verify (A − LM )T P + P (A − LM ) = −Q.

(8.29)

Sketch of Proof: The proof is Lyapunov based. Select ˜ V = x˜T P X,

(8.30)

yielding V˙

= x˜˙ T P x˜ + x˜T P x˜˙ , = x˜T ((A − LM )T P + P (A − LM ))˜ x + 2˜ xT P (f (x) − f (ˆ x)).

(8.31) (8.32)

Then , if (A, M ) is an observable pair, there exists an L such that (A − LM ) is stable, so there exist (P, Q) such that (A − LM )T P + P (A − LM ) = −Q,

(8.33)

and P and Q are positive definite. then, V˙ = −˜ xT Q˜ x + 2˜ xT P (f (x) − f (ˆ x)). 223

(8.34)

© 2015, J.K. Hedrick and A. Girard

Using the Lipschitz condition and the fact that λmin (Q)|˜ x|2 ≤ x˜T Q˜ x ≤ λmax (Q)|˜ x|2 ,

(8.35)



(8.36) (8.37) (8.38)

we have ≤ −λmin (Q)|˜ x|2 + 2˜ xT P x˜γ, ≤ −λmin (Q)|˜ x|2 + 2γλmax (P )|˜ x|2 , ≤ (2γλmax (P ) − λmin (Q)) |˜ x|2 .

So V˙ ≤ 0 if

γ
−1.

(8.53)

or

with γ = 1, so that we must have

The same result can be obtained from Thau’s theorem. We already know that γ = 1. Then, the Lyapunov equation (8.29) becomes 225

© 2015, J.K. Hedrick and A. Girard

(−2 − L)T P + P (−2 − L) = −Q.

(8.54)

Note that in our case, P is scalar, so that P = P T . Therefore,

2P (−2 − L) = −Q.

(8.55)

If we choose Q = I = 1, as suggested, then 1 . 2(2 + L)

P =

(8.56)

Then, checking the condition from the theorem (8.28) means that we must have

γ
−1.

(8.60)

that is,

In the scalar case, it is rather easy to select L for exponentially stable error dynamics. This can be harder in higher dimensions. Raghavan’s method, considered next, provides a constructive method.

8.4.3

Alternative Approach: Ragahvan’s Method

The method is as described in [?]. The initial setup is identical to that for Thau’s method, that is, let the system be described by 226

© 2015, J.K. Hedrick and A. Girard

x˙ = Ax + g(t, u, z) + f (x), z = M x.

(8.61) (8.62)

xˆ˙ = Aˆ x + g(t, u, z) + f (ˆ x) + L(z − M xˆ),

(8.63)

Let the observer structure be

the error be x˜ = x − xˆ, and the error dynamics be x˜˙ = (A − LM )˜ x + f (x) − f (ˆ x)

(8.64)

Now, define A0 = A − LM , and let V x˜T P x˜,

(8.65)

V˙ = −˜ xT (aT0 P + P A0 )˜ x + 2˜ xT P (f (x) − f (ˆ x).

(8.66)

yielding

Proposition 8.2 It follows from f being Lipschitz that 2˜ xT P (f (x) − f (ˆ x) ≤ 2|P x˜|γ|˜ x|.

(8.67)

Proposition 8.3 ∀(a, b) ∈ R2 , ab ≤

a2 + b2 . 4

(8.68)

Now, let a , 2γ|P x˜|, and b , |˜ x|. Then, 2γ|P x˜||˜ x| ≤ γ 2 x˜T P P x˜T + x˜T x˜,

(8.69)

V˙ ≤ x˜T (AT0 P + P A0 + γ 2 P P + I)˜ x.

(8.70)

so that

227

© 2015, J.K. Hedrick and A. Girard

Proposition 8.4 ( [?]) If we have (AT0 P1 + P1 A0 + γ 2 P1 P1 + I) < 0,

(8.71)

then there exists a P2 such that (A0 P2 + P2 AT0 + γ 2 P2 P2 + I) < 0.

(8.72)

A0 P + P AT0 + γ 2 P P + I = −I,

(8.73)

V˙ ≤ −˜ xT x˜ < 0,

(8.74)

Let

with  > 0. Then, we have

so x˜ → 0 exponentially. The equation we need to solve is (A − LM )P + P (A − LM )T + γ 2 P P + I( + 1) = 0.

(8.75)

Let L,

P MT . 2

(8.76)

Then,   MT M 2 AP + P A + P γ I − P + I( + 1) = 0.  T

(8.77)

is a Riccatti equation. If we set  R1 ,

MT M γ I−  2

 (8.78)

and Q1 , ( + 1)I,

(8.79)

AP + P AT + P R1 P + Q1 = 0,

(8.80)

then we have

a standard algebraic Riccatti equation. 228

© 2015, J.K. Hedrick and A. Girard

Design Steps 1. Initialize γ, A, B, C, 2. Initialize  to a small number (for example on the order of 0.1 or 0.01), 3. Initialize a flag “PnotPositiveDefinite = 1,” 4. While (PnotPositiveDefinite), (a) Let  = /2, (b) Let   1 T 2 R= γ I− C C , 

(8.81)

(c) Q = (I + I), (d) Solve the following equation for P : AP + P AT + P RP + Q = 0,

(8.82)

(e) Check if P is positive definite and update flag, 5. End while, 6. Set

L=

1 P CT . 2

(8.83)

It is shown in [?] that if the algorithm fails, then there do not exist a P and L such that ˙ V < 0 for all f with Lipschitz constant γ. Remark 8.1 (Implementation Notes) The command are in MATLAB solves Ricatti equations of the form A0T P + P A0 − P R0 P + Q0 = 0.

(8.84)

To recover our notation, set A 0 = AT , R0 = −R, Q0 = Q.

(8.85) (8.86) (8.87)

Also, the command chol is useful to check positive definiteness (sets a flag). 229

© 2015, J.K. Hedrick and A. Girard

8.5

Exact Linearization and Geometric Observers

Geometric observers have linearized error dynamics. Consider the system x˙ = f (x) + g(x)u, y = h(x).

(8.88) (8.89)

We want to find a nonlinear change of coordinates z = φ(x) such that z˙ = Az + K(y, u), y = Cz,

(8.90) (8.91)

where (A, C) is an observable pair. Then a design such as zˆ˙ = Aˆ z + K(y, u) + L(y − C zˆ)

(8.92)

yields the following linear error dynamics z˜˙ = (A − LC)˜ z, −1 xˆ = φ (ˆ z ).

(8.93) (8.94)

Conditions for a transformation of this kind to exist are given in [?] for systems with no inputs and in [?] for systems with inputs.

8.5.1

Systems with no Control Input

We give an overview of the result for systems with no control input here. We treat only the SISO case, but the result can be extended. Let x˙ = f (x), y = h(x),

(8.95) (8.96)

z˙ = Az + K(y), y = Cz.

(8.97) (8.98)

and we seek z = φ(x) such that

Theorem 8.2 (From [?]) for the problem stated above, a transformation z = φ(x) exists if and only if: 230

© 2015, J.K. Hedrick and A. Girard

1. The row vectors dh, dLf h, · · · dLn−1 h f

(8.99)

are linearly independent (observability condition). 2. The unique vector solution, qi (x), to the following equation:    dh 0  ..   ..   .     .  q(x) =  .   ..  0 n−1 1 dLf h

(8.100)



 q, adkf q = 0

(8.101)



 q, adkf q = 0

(8.102)



satisfies

for k = 1, 3, · · · , (2n − 1). 3. The vector qi also has to satisfy

for k = 0, 1, · · · , n − 2. Remark 8.2 This is an important result theoretically, but the conditions are very difficult to satisfy in practice.

8.6

Sliding Observers

Consider the following motivating example. Let the second-order system under consideration be described by x˙ 1 = x2 , x˙ 2 = −k2 sgn(x1 ).

(8.103) (8.104)

System trajectories are shown in Figure 8.6. Now, add a term to the first channel, so that x˙ 1 = x2 − k1 sgn(x1 ), x˙ 2 = −k2 sgn(x1 ). 231

(8.105) (8.106)

© 2015, J.K. Hedrick and A. Girard

Figure 8.6: System trajectories for sliding observers motivating example.

Figure 8.7: System trajectories for sliding observers motivating example with sliding patch.

232

© 2015, J.K. Hedrick and A. Girard

Figure 8.8: Sliding patch for sliding observers motivating example.

We have added a “sliding patch,” hoping that under proper gain choices, we may satisfy the sliding condition x1 x˙ 1 = x1 (x2 − k1 sgn(x1 )) ≤ 0,

(8.107)

and change the system trajectories to those shown in Figure 8.7. To find such a patch, we test slightly negative and slightly positive values of x1 . For example, for x1 > 0, we need (x2 − k1 ) ≤ 0.

(8.108)

|x2 | ≤ k1 ,

(8.109)

Hence the sliding “patch” is

as shown in Figure 8.8. On the sliding patch, on average, x1 ≈ 0 and x˙ 1 ≈ 0. If x˙ 1 = 0, then 0 = x2avg − k1 sgn(x1 ),

(8.110)

so that x2avg , k1

(8.111)

k2 x2avg . k1

(8.112)

sgn(x1 ) ≈ and we then have

x˙ 2avg = −

The k2 /k1 term determines the size of the sliding patch, and how long it takes to converge. 233

© 2015, J.K. Hedrick and A. Girard

One can also add damping. We can get better system performance by adding linear “Luenberger-type” terms. Let

x˙ 1 = x2 − h1 x1 − k1 sgn(x1 ), x˙ 2 = −h2 x1 − k2 sgn(x1 ),

(8.113) (8.114)

with the measurement being x1 , yielding system trajectories as shown in Figure 8.9.

Figure 8.9: System trajectories for sliding observers motivating example with sliding patch and linear terms.

Figure 8.10: Sliding patch for sliding observers second order example.

Example 8.2 (Second-Order Example) Consider the system

x˙ 1 = x2 , x˙ 2 = f (x1 , x2 ), z = x1 + v(t).

(8.115) (8.116) (8.117)

Let the error be x˜1 = x1 − xˆ1 , and let the observer structure be 234

© 2015, J.K. Hedrick and A. Girard

Figure 8.11: Dead zone for sliding observers second order example.

xˆ˙ 1 = xˆ2 − h1 x˜1 − k1 sgn(˜ x1 ), xˆ˙ 2 = f (ˆ x1 , xˆ2 ) − h2 x˜1 − k2 sgn(˜ x1 ).

(8.118) (8.119)

The error dynamics are given by x˜˙ 1 = x˜2 − h1 x˜1 − k1 sgn(˜ x1 ), ˙x˜2 = f (x1 , x2 ) − f (ˆ x1 , xˆ2 ) − h2 x˜1 − k2 sgn(˜ x1 ).

(8.120) (8.121)

The sliding patch is given by |˜ x2 | ≤ k 1 ,

(8.122)

as shown in Figure 8.10. On the sliding patch, on average, x1 ≈ 0 and x˙ 1 ≈ 0. We then have x˙ 2avg = −

k2 x2avg + Y (x2avg ). k1

(8.123)

One possible adaptation to account for sensor noise v(t) in sgn(˜ x1 + v(t)) = 0

(8.124)

is to add a dead zone, as shown in Figure 8.11. The system cannot remain in pure sliding mode in the presence of arbitrary measurement noise, as this would require infinite gain. But one can modulate the magnitude of the switching terms proportionally to the average values of x˜1 over a short period of past history. 235

© 2015, J.K. Hedrick and A. Girard

8.7

Nonlinear Compensators

Observers are seldom designed to work in isolation. Consider the system x˙ = f (x(t), u(t)), y = h(x(t)),

(8.125) (8.126)

with the observer xˆ˙ = g(ˆ x(t), y(t), u(t)).

(8.127)

For a linear system, this can be analyzed and it can be shown that the eigenvalues decouple under a separation principle. For a nonlinear system, there are only limited results about local behavior. Theorem 8.3 (From [?]) Assume f is continuously differentiable with f (0, 0) = 0, h is continuous and h(0, 0) = 0. If: 1. u(t) = m(x(t)) is a uniformly asymptotically stable control law to x = 0 for the combined system (8.125) - (8.127), 2. The structure (8.127) is an observer for system (8.125) - (8.126), that is, ||ˆ x(t) − x(t)|| → 0

(8.128)

uniformly and asymptotically, then, (x = 0, xˆ = 0) is a uniformly asymptotically stable equilibrium point of (8.125) - (8.127) under the control law u(t) = m(x(t)). Note that this is a local result. The nonlinear compensator design method is as follows, and is the same as for linear systems: 1. The observer is designed for “good” state estimation, xˆ(t) → x(t), 2. The controller is designed on the observed state estimate, that is, xˆ(t) → xd (t), 3. The resulting control law is implemented on the physical model. Note that x = x˜ + xˆ. If x˜ → 0, then x → xˆ and xˆ → xd , so x → xd . Problems in nonlinear compensator design can occur due to “peaking” (large errors during the transient period), that is, due to xˆ(0) 6= 0 during the transient period, so that u(ˆ x) 6= u(x). 236

© 2015, J.K. Hedrick and A. Girard

Example 8.3 (Second-Order Example) Consider the system x˙ 1 = x2 , x˙ 2 = f (x1 , x2 ) + u, z = y = x1 .

(8.129) (8.130) (8.131)

The control goal is x1 → x1d (t). Following the steps outlined above, we first design the asymptotic observer, letting x˜1 = x1 − xˆ1 and choosing xˆ˙ 1 = xˆ2 + l1 x˜1 , xˆ˙ 2 = f (ˆ x1 , xˆ2 ) + u + l2 x˜1 ,

(8.132) (8.133)

x˜˙ 1 = f˜ − l1 x˜1 , x˜˙ 2 = f˜ − l2 x˜1 .

(8.134) (8.135)

resulting in the error dynamics

Assuming that f is Lipschitz and we can find l1 and l2 , ||˜ x|| → 0. We then design the control law. Let S = xˆ2 − x˙ 1d + λ(ˆ x1 − x1d ).

(8.136)

We prefer not to use x˙ 1 in the control surface, or we would have to differentiate the measurement, which may introduce noise. Then, S˙ = f (ˆ x1 , xˆ2 ) + u + l2 x˜1 − x¨1d + λ(ˆ x2 + l1 x˜1 − x˙ 1d ).

(8.137)

We choose u such that S˙ = −k1 S,

(8.138)

u = −f (ˆ x1 , xˆ2 ) − l2 x˜1 + x¨1d − λ(ˆ x2 + l1 x˜1 − x˙ 1d ) − k1 S.

(8.139)

so that

The terms containing l1 and l2 are due to the design of the control law being based on the observer. In this way, the control law “knows” that x1 6= xˆ1 , and in steady-state these terms go to zero. 237

© 2015, J.K. Hedrick and A. Girard

8.8

Further Reading

thau 1973 (thau) Raghavan and Hedrick, “Observer design for a class of nonlinear systems”, IJC, 1994. (raghavan) Krenner and Isidori, Systems and Control Letters, Vol. 3, 1983 (krennerisidori) Marino, IEEE Transactions on Automatic Control, Vol. 35, September 1990 (marino) Vidyasagar, On stabilization of nonlinear systems using state detection, 1980. IEEE TAC (vidyasagar)

8.9

Homework Problems

Figure 8.12: Inverted Pendulum of Problem 8.1.

Figure 8.13: Simulink Model for Inverted Pendulum of Problem 8.1.

238

© 2015, J.K. Hedrick and A. Girard

Problem 8.1 (Nonlinear Compensator for Inverted Pendulum) We design a tracking controller for the inverted pendulum shown in Figure 8.12. If the stick is light, the equations of motion of the system are as follows: θ˙ = ω,

(8.140)

b mgr 1 ω˙ = − ω + sin θ + u, J J J y = θ,

(8.141) (8.142)

where m = 0.1 is the mass on the end of the pendulum, in kg, b = 1 is the viscous damping in Nm/s, r = 1 is the pendulum length in m, g = 9.8 is the gravitational constant, in N/kg, and J = mr2 is the moment of inertia of the pendulum in kg.m2 . The control input u is the motor torque, and the control goal is to sweep the pendulum from due east (θ = −π/2) to straight up (or down) (θ = 0) to due west (θ = π/2) using only the angular position of the pendulum, y = θ, as feedback. Since the operating range is rather large, the sin(θ) term arising from gravity is significant, making nonlinear control a logical choice. First, we design a sliding surface controller assuming full state feedback. Then, we design a nonlinear observer to estimate the states that we cannot measure, and we use the observer states in lieu of the real states. Such an arrangement is called a nonlinear compensator. 1. Sliding surface controller design: Assuming that we know θd (t), ωd (t), ω˙ d (t) and the full state, design a sliding controller so that θ(t) → θd (t) exponentially. 2. Observer design: Since the controller you just designed requires state that we cannot measure, we use an observer. Following Thau’s method, we propose the following structure: ˙ θˆ = ω˙ + l1 (y − yˆ), mgr 1 b ˆ+ sin θˆ + u + l2 (y − yˆ), ω ˆ˙ = − ω J J J ˆ yˆ = θ,

(8.143) (8.144) (8.145)

where the gain matrix, L = [l1 l2 ]T , will be chosen shortly. Essentially, we are trying to force a Luenberger observer structure (that works for linear systems) onto a nonlinear system. Write the system in “standard” form, find the Lipschitz constant γ for our system, and then write an m-file to calculate the observer gain according to Raghavan’s method (page 519 of Raghavan and Hedrick, “Observer design for a class of nonlinear systems”, IJC, 1994). Useful MATLAB commands: while implements a while loop, chol is useful for checking that a matrix is positive definite. See the second paragraph of help chol for more 239

© 2015, J.K. Hedrick and A. Girard

information. You do not need to understand the Choleski factorization to use this command. are solves the algebraic Ricatti equation. Be careful how you call it since the form of the Ricatti equation that MATLAB assumes is different than that used by Raghavan in his paper. 3. Observer simulation: Now, write your own, or use the files given below along with the Simulink model shown in Figure 8.13. These files are a nearly complete simulation of the observer/plant/controller system. You just have to fill in the observer gains, initial conditions, and controller equations. Set u = cos(2πt) so that you can check the performance of your observer in an openloop setting. Start the observer with erroneous initial conditions and check to make sure that the estimated average converges to the true state. Attach plots demonstrating that your observer works open-loop. 4. Controller simulation: Now, insert your full state feedback controller into the simulation and check that it provides good tracking. Use the real states so that you can catch any controller design mistakes without worrying about controller/observer interactions. Although your observer from the previous section is running, it has no effect on the controller performance, as you are not using its states. 5. Compensator simulation: Now, modify your control law so that all θ terms are replaced by θˆ and all ω terms are replaced by ω ˆ . Start with erroneous initial conditions and attach a plot showing that the state estimates converge and that θ(t) → θd (t).

% % % % % % % % % % % % % % % % % % % % %

s observer for web.m: same as s observer, but not complete, so students can modify it to test their control laws and observer gains. Tracking control of inverted pendulum. Observer design from Raghavan and Hedrick, "Observer Design for a Class of Nonlinear Systems", International Journal of Control, vol 59, no 2, 1994. Equations of Motion: --------------------------------theta dot = omega; omega dot = -b/J*omega + m*g*r/J*sin(theta) + u; theta hat dot = omega + L1*(theta-theta hat); omega hat dot = -b/J*omega hat+m*g*r/J*sin(theta hat)+u+L2*(theta-theta hat); The control goal is to make the link position, theta, track some desired position profile. An I/O linearizing control is used and a nonlinear observer is used to calculate the unknown states.

240

© 2015, J.K. Hedrick and A. Girard

function [sys,x0] = s observer(t,x,u,flag) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % t = Current simulation time % x = States internal to this function. States are brought in from the % outside because they are integrated by one of simulink's integration % routines (rk45, for example) and then used by this s-file to calculate % the next state derivs which are then passed back out to be integrated. % u = Vector of inputs. % flag= Flag indicating which information Simulink wants from this routine. % Possible flag values are as follows: % 0 Return the sizes of parameters and initial conditions. % 1 Return the state derivs dx/dt for integration. % 2 Return the discrete state x(n+1) % 3 Return the output vector, y. % 4 Return the next time interval for a discrete state % update (for mixed discrete/continuous time systems) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % discrete sample time for controller ts = 0.02; % m b r g J

Constants used in simulation = 0.1; = 1; = 1; = 9.8; = m*rˆ2;

% Observer and controller gains L1 = L2 =

%%%%%%%% YOU FILL IN %%%%%%%%%% %%%%%%%% YOU FILL IN %%%%%%%%%%

% Give states and inputs nice names so that they match diffQs in header if abs(flag) ~= 0 % so state is not accessed when simulink queries for IC's theta = x(1); omega = x(2); theta hat = x(3); omega hat = x(4); u = x(5); end % % STATE DERIVATIVES: %

Calculate them according to difQs in header.

if abs(flag)==1 % diffQ's for continuous state % plant theta dot = omega; omega dot = -b/J*omega + m*g*r/J*sin(theta) + 1/J*u;

241

© 2015, J.K. Hedrick and A. Girard

% observer theta hat dot = omega + L1*(theta-theta hat); omega hat dot = -b/J*omega hat + m*g*r/J*sin(theta hat) + ... ... + 1/J*u + L2*(theta-theta hat); %

output state derivs sys = [theta dot omega dot theta hat dot omega hat dot];

% % DISCRETE STATE EQUATIONS: % elseif flag == 2 % Discrete state equations u next = cos(2*pi*t);

%%%%%%% TO TEST OBSERVER OPEN LOOP %%%%%%

theta d = pi/2*cos(t); % des. pos vs. time profile/derivs for ctrl law omega d = -pi/2*sin(t); omega d dot = -pi/2*cos(t); %

u next = %%%%%% CONTROL LAW %%%%%%%%%% % Return next discrete states sys = [u next];

% % OUTPUT: Calculate the outputs--the full state, and a few extras % elseif flag==3 % Calculate extra outputs

% Output full state sys = [x];

% % NEXT SAMPLE HIT FOR DISCRETE STATES: % elseif flag == 4 % ns temporarily stores the number of samples ns = (t/ts); sys = (1 + floor(ns + 1e-13*(1+ns)))*ts;

242

© 2015, J.K. Hedrick and A. Girard

% % INITIAL CONDITIONS AND STATE VECTOR SIZES: Initial conditions of all state % estimates are zero. State vector size vector is as follows: % sizes(1) = number of continuous states internal to this file % sizes(2) = number of discrete states. % sizes(3) = number of outputs % sizes(4) = number of inputs % sizes(5) = number of discontinuous roots % sizes(6) = flag for direct feedthrough (used for finding algebraic % loops) %

elseif flag==0 % sys returns vector sizes; x0 returns ICs sys = [4,1,5,0,0,0]; x0=[ 1; 2; 0; 0; 1;];

%%%% EXPERIMENT WITH ICS %%%

% % OTHER FLAG OPTIONS: not used %

else sys = []; end

% run s observer.m: runs the simulation of inverted pendulum. % Runs the similink % block diagram s observer diagram.mdl % which in turn calls the s-function % s observer.m % clear all; close all; %%%%%%%%%%%%%%%%%%%% SOLVER PARAMETERS %%%%%%%%%%%%%%%% tf = 20; % total sim time options = simset('Solver', 'ode23'); %%%%%%%%%%%%%%%%%%% SOLVER CALL %%%%%%%%%%%%%%%%%%%%%% [ junk, junk, junk] = sim('s observer diagram', tf, options); %%%%%%%%%%%%%%%%% NICE NAMES FOR COLS OF SIMOUT VECTOR %%%%%%%% theta = simout(:,1); omega = simout(:,2); theta hat = simout(:,3);

243

© 2015, J.K. Hedrick and A. Girard

omega hat = simout(:,4); u = simout(:,5); %%%%%%%%%%%%%%%%%%%%%% FIGURE 1 %%%%%%%%%%%%%%%%%%%%%%%% figure(1); subplot(2,2,1); plot(t,theta,t,theta hat,':'); title('\theta and \theta hat vs. time'); legend('\theta','\theta hat'); subplot(2,2,2) plot(t,omega,t,omega hat,':'); title('\omega and \omega hat vs. time'); legend('\omega','\omega hat'); subplot(2,2,3) plot(t,u); title('Control u vs. time'); subplot(2,2,4); plot(t,theta,t,pi/2*cos(t),':'); title('\theta and \theta d vs. time'); legend('\theta','\theta d'); zoom on;

244

© 2015, J.K. Hedrick and A. Girard

Part III Appendix

245

Appendix A Mathematical Preliminaries A.1

Sets

A set is a collection of objects, sometimes called elements or points. If A is a set and x is an element of A, we write x ∈ A. If A and B are sets and if every element of A is also an element of B, we say that B includes A or that A is a subset of B, and we write A ⊂ B or B ⊃ A. The empty set, ∅, has no elements and is therefore contained in every set. The union and intersection of A and B are defined by A ∪ B = {x : x ∈ A or x ∈ B}, A ∩ B = {x : x ∈ A and x ∈ B}.

(A.1) (A.2)

Assume now that A and B are non-empty sets. Then their Cartesian product, A × B, is the set of all ordered pairs (a, b) with a ∈ A and b ∈ B such that A × B = {(a, b) : a ∈ A and b ∈ B}.

A.2

(A.3)

Metric Spaces

Metric spaces are a generalization of the concept of distance. Here, R and C denote the fields of real and complex numbers, respectively. The symbol Z represents the set of integers, and R+ and Z+ represent the subsets of non-negative elements of R and Z, respectively. Finally, Finally, Rm×n represents the set of real matrices with m rows and n columns. Definition A.1 (Metric space) A metric space is a pair (X, d) of a non-empty set X and a metric or distance function d : X × X → R such that for all x, y, z ∈ X, the following conditions hold: 1. d(x, y) = 0 if and only if x = y, 247

2. d(x, y) = d(y, x), 3. d(x, z) ≤ d(x, y) + d(y, z). This property is called the triangle inequality. Remark A.1 Notice that, using the above properties, letting z = x in the third yields: 0 = d(x, x) ≤ d(x, y) + d(y, x) = 2d(x, y),

(A.4)

∀x, y ∈ X, d(x, y) ≥ 0.

(A.5)

so that

A.3

Vector Spaces

If we define addition of elements of the space and multiplication of elements of the space by real or complex numbers, we arrive at the notion of vector space. In the following, F may denote either R or C. Definition A.2 (Vector space) A vector space over F is a non-empty set X with a function “ + ” : X × X → X and a function “.” : F × X → X such that, for all λ, µ in F, and for all x, y, z in X, we have: 1. x + y = y + x (addition is commutative), 2. x + (y + z) = (x + y) + z (addition is associative), 3. ∃0 ∈ X : x + 0 = x (0 is the neutral element for addition), 4. ∃ − x ∈ X : x + (−x) = 0 (every x has a negative such that their sum is the neutral element 0), 5. ∃1 ∈ F : 1.x = x (1 is the neutral element for “.”), 6. λ(x + y) = λx + λy (first distributive property), 7. (λ + µ)x = λx + µx (second distributive property), 8. λ(µx) = (λµ)x (scalar “.” is associative). A vector space is called real or complex depending on whether F is the real or complex number system. In this manuscript, we restrict our attention to real vector spaces, that is, we let F = R. A vector space is a structure formed by a set X with two operations: addition and multiplication. The essential feature of the preceding definition is that the set X is closed with regard to these two operations: 248

© 2015, J.K. Hedrick and A. Girard

∀x, y ∈ X, z = x + y ∈ X, ∀x ∈ X, ∀α ∈ R, αx ∈ X.

(A.6) (A.7)

Example A.1 (Vector space) The n-dimensional “Euclidian” space Rn consisting of ntuples of vectors: 

 x1  x2   x=  ...  xn

(A.8)

is a vector space. More precisely, if X = Rn and addition and multiplication are defined as the usual, coordinate-wise operations, 

     x1 y1 x 1 + y1  x2   y 2   x 2 + y 2       x+y =   ...  +  ...  =  ...  , xn yn x n + yn     x1 λx1  x2   λx2     λx = λ   ...  =  ...  , xn λxn

(A.9)

(A.10)

then it is straightforward to show that Rn satisfies properties (1) through (8) listed above. In the sequel, we denote by xT the transpose of vector x, that is, 

 x1  x2   x=  ...  xn

(A.11)

  xT = x1 x2 ... xn .

(A.12)

and

The inner product of two vectors x and y in Rn is 249

© 2015, J.K. Hedrick and A. Girard

T

x y=

n X

xi y i .

(A.13)

i=1

Function spaces are spaces where the vectors in X are functions of time. For example, let X be the space of continuous functions x = x(t) over the closed interval 0 ≤ t ≤ 1. It is easy to see that this X is a (real) vector space. It is closed with respect to addition since the sum of two continuous functions is once again continuous.

A.3.1

Linear Independence and Basis

Definition A.3 (Linear dependence/independence) A finite set {xi } is said to be linearly dependent if there exists a corresponding set {αi } of scalars, not all zero, such that X

αi xi = 0.

(A.14)

αi xi = 0 =⇒ ∀i, αi = 0,

(A.15)

i

On the other hand, if X i

the set {αi } is said to be linearly dependent. Example A.2 Every set containing a linearly dependent subset is itself linearly dependent. Example A.3 Consider the space Rn and let   0  ..  .   0   ei = 1 ,   0 .  ..  0

(A.16)

where the “1” element is in the ith row and there are zeros in the other n − 1 rows. The set {e1 , e2 , ..., en } is called the set of unit vectors in Rn . This set is linearly independent, since 

 λ1  λ2    λ1 e1 + λ2 e2 + ... + λn en =  ..  . .

(A.17)

λn Thus, λ1 e1 + λ2 e2 + ... + λn en = 0 is equivalent to λ1 = λ2 = ... = λn = 0. 250

© 2015, J.K. Hedrick and A. Girard

Definition A.4 (Basis) A basis in a vector space X is a set of linearly independent vectors B such that every vector in X is a linear combination of elements in B. Example A.4 In Rn , the set of unit vectors ei , i ∈ [1, n] as defined in (A.16) forms a basis for this space, since the set is linearly independent and, moreover, any vector x ∈ Rn can be obtained as a linear combination of the ei values, since 

 λ1  λ2    λ1 e1 + λ2 e2 + ... + λn en =  ..  . .

(A.18)

λn It is an important property of any finite dimensional vector space with basis {b1 , b2 , ..., bn } that the linear combination of the basis vectors that produces a vector x be unique. To prove that this is the case, assume that we have two different linear combinations producing the same x, that is,

x=

n X

ξi bi =

n X

i=1

ηi bi .

(A.19)

i=1

Then, by subtraction, n X

(ξi − ηi )bi = 0,

(A.20)

i=1

and since the bi , forming a basis, are linearly independent, we must have that ∀i ∈ [1, n], ξi − ηi = 0, which means that the ξi must be the same as the ηi . In general, a finite-dimensional vector space can have an infinite number of bases. Definition A.5 (Dimension of a vector space) The dimension of a vector space X is the number of elements in any of its bases. Theorem A.1 Every set of n + 1 vectors in an n-dimensional vector space X is linearly dependent. A set of n vectors in X is a basis if and only if it is linearly independent.

A.3.2

Subspaces

Definition A.6 (Subspace) A non-empty subset M of a vector space X is a subspace if for any pair of scalars λ and µ, λx + µy ∈ M whenever x ∈ M and y ∈ M . Remark A.2 A subspace M in a vector space X is itself a vector space. 251

© 2015, J.K. Hedrick and A. Girard

Example A.5 In R3 , any two-dimensional plane passing through the origin is a subspace. Similarly, any line passing through the origin is a one-dimensional subspace of R3 . The necessity of passing through the origin comes from the fact that along with any vector x, a subspace also contains 0 = 1.x + (−1).x. Definition A.7 (Span) Given a set of vectors S in a vector space X, the intersection of all spaces containing S is called the subspace generated or spanned by S, or simply the span of S. Theorem A.2 Let S be a set of vectors in a vector space X. The subspace M spanned by S is the set of all linear combinations of the members of S. Proof A.1 (of Theorem A.2) First we need to show that the set of linear combinations of the elements of S is a subspace of X. This is straightforward since linear combinations of linear combinations of elements of S are once again linear combinations of the elements of S. Denote this space by N . It is immediate that N contains every element of S, and thus N ⊂ M . For the converse, notice that M is also a subspace that contains S, and therefore contains all linear combinations of the elements of S. Thus, M ⊂ N , and the theorem is proved.

A.3.3

Normed Vector Spaces

We had temporarily put aside the notion of distance associated with metric spaces. To recover this notion, we introduce normed vector spaces. Definition A.8 (Normed vector space) A normed vector space (or a normed space) is a pair (X, ||.||) consisting of a vector space X and a norm ||.|| : X → R such that 1. ||x|| = 0 if and only if x = 0, 2. ∀λ ∈ R, ∀x ∈ X, ||λx|| = |λ|||x||, 3. ∀x, y ∈ X, ||x + y|| ≤ ||x|| + ||y||. Note that letting y = −x 6= 0 in (3) and using (1) and (2), ||x + (−x)|| ≤ ||x|| + || − x||, ||0|| = 0 ≤ ||x|| + | − 1|||x|| = 2||x||,

(A.21) (A.22)

so that ||x|| ≥ 0, that is, the norm of a vector x ∈ Rn is non-negative. Also, by the triangle inequality, ∀x, y, z ∈ X, ||x − y|| ≤ ||x − z + z − y|| ≤ ||x − z|| + ||z − y||,

(A.23)

that is, every normed linear space may be regarded as a metric space with distance defined by d(x, y) = ||x − y||. 252

© 2015, J.K. Hedrick and A. Girard

Example A.6 Consider the vector space Rn . For each p, 1 ≤ p ≤ ∞, the function ||.||p , known as the p-norm in Rn , makes this space a normed vector space, where: ||x||p = (|x1 |p + ... + |xn |p )1/p .

(A.24)

In particular, ||x||1 = |x1 | + ... + |xn |, p ||x||2 = |x1 |2 + ... + |xn |2 .

(A.25) (A.26)

The 2-norm is the Euclidian norm. The ∞-norm is defined as ||x||∞ = max |xi |.

(A.27)

i

By far the most commonly used of the p-norms in Rn is the 2-norm. Many results depend only on the three defining properties of a norm, and not on the specific norm adopted. In these cases, it is customary to drop the subscript “p” to indicate that the norm can be any p-norm. Remark A.3 All p-norms in Rn are equivalent in the sense that given two norms ||.||a and ||.||b on Rn , there exist constants k1 and k2 such that ∀x ∈ Rn , k1 ||x||a ≤ ||x||b ≤ k2 ||x||a .

(A.28)

Remark A.4 Two frequently used inequalities involving p-norms in Rn are as follows. 1. Holder’s inequality: Let p ∈ R, p > 1 and let q ∈ R be such that 1 1 + = 1. p q

(A.29)

∀x, y ∈ Rn , ||xT y||1 ≤ ||x||p ||y||q .

(A.30)

Then,

2. Minkowski’s inequality: Let p ∈ R, p ≥ 1. Then,

∀x, y ∈ Rn , ||x + y||p ≤ ||x||p + ||y||p . 253

(A.31)

© 2015, J.K. Hedrick and A. Girard

A.4

Matrices

We assume acquaintance with the elementary theory of matrices and matrix operations. We introduce notation, terminology and useful properties. Definition A.9 (Transpose of a matrix) If A is an m × n matrix, its transpose, denoted AT , is the n × m matrix obtained by interchanging rows and columns with A. Remark A.5 The following properties can be proved: 1. (AT )T = A,

(A.32)

(AB)T = B T AT ,

(A.33)

(A + B)T = AT + B T .

(A.34)

2.

3.

Definition A.10 (Symmetric matrix) A is symmetric if A = AT . Definition A.11 (Skew-symmetric matrix) A is skew-symmetric if A = −AT . Definition A.12 (Inverse matrix) A−1 ∈ Rn×n is the inverse of A ∈ Rn×n if AA−1 = A−1 A = I. Remark A.6 It can be shown that, provided that A and B are square, of the same size, and invertible, 1. (A−1 )−1 = A,

(A.35)

(AB)−1 = B −1 A−1 .

(A.36)

2.

Definition A.13 (Orthogonal matrix) A is orthogonal if AT A = AAT = I, or equivalently if AT = A−1 . Definition A.14 (Rank of a matrix) The rank of a matrix A, denoted rank(A), is the maximum number of linearly independent columns in A. 254

© 2015, J.K. Hedrick and A. Girard

Definition A.15 (Linear mapping) Every matrix A ∈ Rn×n can be considered as a linear mapping A : Rn → Rn , that is the mapping y = Ax maps the vector x ∈ Rn into the vector y ∈ Rn . Definition A.16 (Null space) The null space of a linear function A : X → Y is the set N (A) defined by

N (A) = {x ∈ X : Ax = 0}.

(A.37)

Remark A.7 One can show that N (A) is a vector space. The dimension of this vector space, dim N (A), is important. Theorem A.3 (Fundamental theorem of linear algebra) Let A ∈ Fm×n . Then,

rank(A) + dim N (A) = n.

(A.38)

Definition A.17 (Eigenvalue, eigenvector) Consider a matrix A ∈ Fm×n . A scalar λ ∈ F is said to be an eigenvalue and a non-zero vector x is an eigenvector of A associated with this eigenvalue if

Ax = λx

(A.39)

(A − λI)x = 0.

(A.40)

or

Thus, x is an eigenvector associated with λ if and only if x is in the null space (A − λI). Theorem A.4 If A ∈ Rn×n with eigenvalues λ1 , λ2 , ..., λn has n linearly independent eigenvectors, v1 , v2 , ..., vn , then it can be expressed in the form A = SDS −1

(A.41)

  where D = diag{λ1 , λ2 , ..., λn } and S = v1 v2 ... vn . Proof A.2 (Of Theorem A.4) By definition, the columns of S are the eigenvectors of A. So, 255

© 2015, J.K. Hedrick and A. Girard

  AS = A v1 v2 ... vn ,   = λ1 v1 λ2 v2 ... λn vn ,   λ1 0 ... 0   0 λ2 0 ...    = v1 v2 ... vn   ... ... ... ...  . 0 ... 0 λn

(A.42) (A.43) (A.44)

Therefore, AS = SD. The columns of S are, by assumption, linearly independent. So S is invertible, and A = SDS −1 or D = S −1 AS. Remark A.8 (Properties of symmetric matrices) 1. The eigenvalues of a symmetric matrix are all real. 2. Every symmetric matrix A is diagonalizable. In addition, the diagonalizing matrix S can be chosen to be an orthogonal matrix P ; that is, if A = AT , then there exists a matrix P satisfying P T = P −1 such that P −1 AP = P T AP = D.

(A.45)

Definition A.18 (Quadratic form) Given a matrix A ∈ Rn×n , a function q : Rn → R of the form q(x) = xT Ax, x ∈ Rn

(A.46)

is called a quadratic form. Remark A.9 The matrix in this definition can be any real matrix. There is, however, no loss of generality in restricting this matrix to be symmetric. To see this, notice that any matrix A ∈ Rn×n can be written as the sum of a symmetric and a skew-symmetric matrix: 1 1 A = (A + AT ) + (A − AT ). 2 2

(A.47)

1 B = (A + AT ) = B T 2

(A.48)

Clearly,

is symmetric, and 256

© 2015, J.K. Hedrick and A. Girard

1 C = (A − AT ) = −C T 2

(A.49)

is skew-symmetric. For the skew-symmetric part, xT Cx = (xT Cx)T = xT C T x = −xT Cx.

(A.50)

Hence, the real number xT Cx must be identically zero. This means that the quadratic form associated with a skew-symmetric matrix is identically zero. Definition A.19 (Sign of a symmetric matrix) Let A ∈ Rn×n be a symmetric matrix, and let x ∈ Rn . Then A is said to be 1. positive definite if xT Ax > 0 ∀x 6= 0, 2. positive semidefinite if xT Ax ≥ 0 ∀x 6= 0, 3. negative definite if xT Ax < 0 ∀x 6= 0, 4. negative semidefinite if xT Ax ≤ 0 ∀x 6= 0, 5. indefinite if xT Ax can take both positive and negative values. Remark A.10 The positive/negative character of a symmetric matrix is completely determined by its eigenvalues. Indeed, given an A = AT , there exists a P such that P −1 AP = P T AP = D. Thus, defining x = P y, we have xT Ax = = = =

y T P T AP y, y T P −1 AP y, y T Dy, λ1 y12 + λ2 y22 + ... + λn yn2 ,

(A.51) (A.52) (A.53) (A.54)

where λi , i ∈ [1, n] are the eigenvalues of A. From this construction, it follows that 1. A is positive definite if and only if all its (real) eigenvalues are positive, 2. A is positive semidefinite if and only if λi ≥ 0, i ∈ [1, n], 3. A is negative definite if and only if all its (real) eigenvalues are negative, 4. A is negative semidefinite if and only if λi ≤ 0, i ∈ [1, n], 5. A is indefinite if and only if it has both positive and negative eigenvalues. 257

© 2015, J.K. Hedrick and A. Girard

Theorem A.5 (Rayleigh Inequality) Consider a nonsingular symmetric matrix Q ∈ Rn×n , and let λmin and λmax be the minimum and maximum eigenvalues of Q, respectively. Under these conditions, ∀x ∈ Rn , λmin (Q)||x||2 ≤ xT Qx ≤ λmax (Q)||x||2 .

(A.55)

Proof A.3 (Sketch of proof for Theorem A.5) Q is symmetric and diagonalizable and it must have a full set of linearly independent eigenvectors. In addition, we can always assume that the eigenvectors u1 , u2 , ..., un associated with the eigenvalues λ1 , λ2 , ..., λn are orthonormal. Given that the set of eigenvectors {u1 , u2 , ..., un } forms a basis in Rn , every vector x in Rn can be written as a linear combination of the elements of this set. Consider an arbitrary vector x. We can assume that ||x|| = 1 (if that is not the case, divide by ||x||). Then, x = x1 u1 + x2 u2 + ... + xn un ,

(A.56)

for some scalars x1 , x2 , ..., xn . Thus, xT Qx = = = =

xT Q [x1 u1 + x2 u2 + ... + xn un ] , xT [λ1 x1 u1 + λ2 x2 u2 + ... + λn xn un ] , λ1 xT x1 u1 + λ2 xT x2 u2 + ... + λn xT xn un , λ1 |x1 |2 u1 + λ2 |x2 |2 u2 + ... + λn |xn |2 un .

(A.57) (A.58) (A.59) (A.60)

This implies λmin (Q) ≤ xT Qx ≤ λmax (Q)

(A.61)

since n X

|x1 |2 = 1.

(A.62)

i=1

This is a special case of the theorem for the norm of x being equal to 1.

A.5 A.5.1

Basic Topology Basic Topology in a Metric Space

Let X be a metric space. 258

© 2015, J.K. Hedrick and A. Girard

Definition A.20 (Neighborhood) A neighborhood of a point p ∈ X is a set Nr (p) ⊂ X consisting of all points q ∈ X such that d(p, q) < r. Definition A.21 (Limit point) Let A ⊂ X and consider a point p ∈ X. Then p is said to be a limit point of A if every neighborhood of p contains a point q 6= p such that q ∈ / A. (p need not be in A.) Definition A.22 (Interior point) A point p is an interior point of a set A ⊂ X if there exists a neighborhood N of p such that N ⊂ A. Definition A.23 (Open set) A set A ⊂ X is said to be open if every point of A is an interior point. Definition A.24 (Complement of a set) The complement of A ⊂ X is the set Ac = {p ∈ X:p∈ / A}. Definition A.25 (Closed set) A set A ⊂ X is said to be closed it it contains all of its limit points. Equivalently, A is closed if and only if Ac is open. Definition A.26 (Bounded set) A set A ⊂ X is bounded if there exist a real number δ and a point q ∈ A such that ∀p ∈ A, d(p, q) < δ.

A.5.2

Basic Topology in Rn

All previous concepts can be specialized to the Euclidian space Rn . Consider a set A ⊂ Rn . Consider a set A ⊂ Rn . Definition A.27 (Neighborhood, Open ball) A neighborhood of a point p ∈ A ⊂ Rn is the set Br (p) defined as Br (p) = {x ∈ Rn : ||x − p|| < r}.

(A.63)

Neighborhoods of this form are used frequently and are sometimes called open balls with center p and radius r. Definition A.28 (Open set) A set A ⊂ Rn is open if for every p ∈ A one can find a neighborhood Br (p) ⊂ A. Definition A.29 (Bounded set) A set A ⊂ Rn is bounded if there exists a real number M > 0 such that ∀x ∈ A, ||x|| < M . Definition A.30 (Compact set) A set A ⊂ Rn is compact if it is closed and bounded. Definition A.31 (Convex set) A set A ⊂ Rn is convex if, whenever x, y ∈ A, θx + (1 − θ)y, 0 ≤ θ ≤ 1

(A.64)

also belongs to A. 259

© 2015, J.K. Hedrick and A. Girard

A.6

Sequences

Definition A.32 (Limit of a sequence) A sequence of vectors x0 , x1 , x2 , ..., xn in a metric space (X, d), denoted {xn }, is said to converge if there is a point xc ∈ X with the property that ∀ξ ∈ R+∗ , ∃N ∈ N such that n ≥ N =⇒ d(xn , xc ) < ξ.

(A.65)

We write that xc = lim xn , or xn → xc and call xc the limit of the sequence {xn }. Remark A.11 Note that convergence must take place in the metric space (X, d). That is, if a sequence has a limit, lim xn = x∗ such that x∗ ∈ / X, then {xn } is not convergent. Example A.7 Let X1 = R, d(x, y) = |x − y| and consider the sequence {xn } = {1, 1.4, 1.41, 1.414, ...} where each term of the sequence is found by adding the corresponding digit in √ | 2 − xn | <  for n ≥ N, and since



(A.66) √

2. Then, (A.67)

2 ∈ R, {xn } is convergent in (X1 , d).

Example A.8 Let X2 = Q, the set of rational numbers, that is, a x ∈ Q =⇒ x = , a ∈ Z, b ∈ Z, b 6= 0. b

(A.68)

Let d(x, y) = |x − y| and √ consider√the sequence of the previous example. Once again, {xn } is trying to converge to 2. But 2 ∈ / Q and {xn } is not convergent in (X2 , d). Definition A.33 (Cauchy sequence) A sequence {xn } in a metric space (X, d) is said to be a Cauchy sequence if, ∀ξ ∈ R+∗ , there is an integer N such that d(xn , xm ) < ξ provided that n, m ≥ N . Remark A.12 Every convergent sequence is a Cauchy sequence. The converse is however not true. Example A.9 Let X = (0, 1), that is, X = {x ∈ R : 0 < x < 1}, and let d(x, y) = |x − y|. Consider the sequence {xn } = 1/n. We have 1 1 1 1 2 d(xn , xm ) = − ≤ + < , n m n m N 260

(A.69)

© 2015, J.K. Hedrick and A. Girard

where N = min(n, m). The sequence {xn } is a Cauchy sequence since d(xn , xm ) <  provided that n, m > 2/. It is, however, not convergent in X since 1 =0 n→+∞ n lim

(A.70)

and 0 ∈ / X. Definition A.34 (Complete metric space) A metric space (X, d) is called complete if and only if every Cauchy sequence converges (to a point of X). In other words, (X, d) is a complete metric space if, for every sequence {xn } satisfying d(xn , xm ) <  for n, m > N , there exists x ∈ X such that d(xn , x) → 0 as n → +∞. Remark A.13 If a space is incomplete, then it has “holes.” In other words, a sequence may be “trying” to converge to a point that does not belong in the space, and thus not converging. In incomplete spaces, in general, one needs to “guess” the limit of a sequence to prove convergence. If a space is known to be complete, on the other hand, then to check the convergence of a sequence to some point in space, it is sufficient to check whether the sequence is Cauchy. Example A.10 The simplest example of a complete metric space is the real number system with the metric d = |x − y|.

A.7

Functions

Definition A.35 (Function) Let A and B be abstract sets. A function from A to B is a set f of ordered pairs in the Cartesian product A × B with the property that if (a, b) and (a, c) are elements of f , then b = c. In other words, a function is a subset of the Cartesian product between A and B where each argument can have one and only one image. Alternate names for functions include maps, mappings, operators and transformations. Definition A.36 (Domain of a function) The set of elements of A that can occur as first members of elements in f is called the domain of f . Definition A.37 (Range of a function) The set of elements of B that can occur as second members of elements in f is called the range of f . Definition A.38 (Injective function) A function f is called injective if f (x1 ) = f (x2 ) implies that x1 = x2 for all x1 , x2 ∈ A. Definition A.39 (Surjective function) A function f is called surjective if the range of f is the whole of B. 261

© 2015, J.K. Hedrick and A. Girard

Definition A.40 (Bijective function) A function f is called bijective if it is both injective and surjective. Definition A.41 (Restriction of a function) If a function f has domain D and D1 is a subset of D, then it is often useful to define a new function f1 with domain D1 as

f1 = {(a, b) ∈ f : a ∈ D1 }.

(A.71)

The function f1 is called a restriction of f to the set D1 . Definition A.42 (Composition of functions) Let D1 , D2 ⊂ Rn , and consider functions f1 and f2 of the form f1 : D1 → Rn and f2 : D2 → Rn . If f1 (D1 ) ⊂ D2 , then the composition of f2 and f1 is the function f2 ◦ f1 defined as

(f2 ◦ f1 )(x) = f2 [f1 (x)], x ∈ D1 .

(A.72)

Definition A.43 (Continuous function) Let (X, d1 ) and (Y, d2 ) be metric spaces and consider a function f : X → Y . We say that f is continuous at x0 if for every real  > 0, there exists a real δ = δ(, x0 ) such that

d1 (x, x0 ) < δ =⇒ d2 (f (x), f (x0 )) < .

(A.73)

The function f : X → Y is continuous if, for every sequence {xn } that converges to x, the corresponding sequence {f (xn )} converges to y = f (x). In the special case of functions of the form f : Rn → Rm , that is, functions mapping Euclidian spaces, we say that f is continuous at x ∈ Rn if, given  > 0, there exists δ > 0 such that

||x − y|| < δ =⇒ ||f (x) − f (y)|| < .

(A.74)

The definition of continuity is clearly local, that is, it corresponds to point-wise convergence. If f is continuous at every point of X, then f is said to be continuous on X. Definition A.44 (Uniformly continuous function) Let (X, d1 ) and (Y, d2 ) be metric spaces. Then, f : X → Y is called uniformly continuous on X if, for every  > 0, there exists a δ = δ() > 0 such that

∀x, y ∈ X, d1 (x, y) < δ =⇒ d2 (f (x), f (y)) < . 262

(A.75)

© 2015, J.K. Hedrick and A. Girard

Remark A.14 The difference between ordinary continuity and uniform continuity is that in the former, δ = δ(, x0 ) and in the latter, δ = δ(). Clearly, uniform continuity is stronger than continuity, and if a function is uniformly continuous on a set A, then it is continuous on A. The converse is not true in general. For example, the function f (x) = 1/x, x > 0 is continuous over (0, ∞) but not uniformly continuous. The exception to this occurs when working with compact sets. Consider a function f mapping a compact set X into a metric space Y . Then f is uniformly continuous if and only if f is continuous. Now consider a function L mapping vector space X into Y . Definition A.45 (Linear operator) A function L : X → Y is said to be a linear operator if and only if given any x1 , x2 ∈ X and any λ, µ ∈ R, L(λx1 + µx2 ) = λL(x1 ) + µL(x2 ).

(A.76)

Definition A.46 (Bounded linear operator, Operator norm) The function L is said to be a bounded linear operator if there exists a constant M such that ∀x ∈ X, ||L(x)|| ≤ M ||x||.

(A.77)

M is called the operator norm. Definition A.47 (Induced norm) A special case is that when the vector spaces X and Y are Rn and Rm respectively. Then, all linear functions A : Rn → Rm are of the form y = Ax, x ∈ Rn , y ∈ Rm ,

(A.78)

where A is an n×m matrix of real elements.The operator norm applied in this case generates a matrix norm:

||A||p ≡ sup x6=0

||Ax||p = max ||Ax||p . ||x||p =1 ||x||p

(A.79)

This norm is sometimes called the induced norm. In particular,

||A||1 = ||A||2 = ||A||∞ =

max ||Ax||1 = max j

||x||1 =1

max ||Ax||2 =

||x||2 =1

p

m X

λmax (AT A),

max ||Ax||∞ = max i

||x||∞ =1

263

|aij |,

(A.80)

i=1

n X

|aij |.

(A.81) (A.82)

j=1

© 2015, J.K. Hedrick and A. Girard

A.8

Differentiability

Definition A.48 (Differentiable function, Derivative) A function f : R → R is said to be differentiable at x if f is defined in an open interval (a, b) ⊂ R and f 0 (x) = lim

h→0

f (x + h) − f (x) h

(A.83)

exists. The limit f 0 (x) is called the derivative of f at x. The function f is said to be differentiable if it is differentiable at each x in its domain. Remark A.15 If the derivative exists, then f (x + h) − f (x) = f 0 (x)h + r(h)

(A.84)

where the “remainder” r(h) is small in the sense that r(h) = 0. h→0 h

(A.85)

lim

Now consider the case of a function f : Rn → Rm . Definition A.49 (Differential, Total derivative) A function f : Rn → Rm is differentiable at point x if f is defined on an open set D ⊂ Rn containing x and the limit ||f (x + h) − f (x) − f 0 (x)h|| =0 h→0 ||h|| lim

(A.86)

exists. Note that h ∈ Rn . If ||h|| is small enough, then x + h ∈ D, since D is open and f (x + h) ∈ Rm . The derivative f 0 (x) defined above is called the differential or the total derivative of f at x. Definition A.50 (Partial derivatives) We denote by fi , i ∈ [1, m] the components of f and by {e1 , e2 , ..., em } the standard basis in Rn , that is, 

     f1 (x) 1 0  f2 (x)  0  ..        f (x) =  ..  , e1 =  ..  , ..., en =  .  .  .  . 0 fn (x) 0 1

(A.87)

Consider a function f : Rn → Rm and let D be an open set in Rn . For x ∈ D ⊂ Rn , i ∈ [1, m], j ∈ [1, n], we define 264

© 2015, J.K. Hedrick and A. Girard

fi (x + ∆ej ) − fi (x) ∂fi = Dj fi ≡ lim = 0, ∆ ∈ R ∆→0 ∂xj ∆

(A.88)

provided that the limit exists. The functions Dj fi (or ∂fi /∂xj ) are the partial derivatives of f. Remark A.16 Differentiability of a function is not implied by existence of the partial derivatives of the function. For example,

f (x1 , x2 ) =

x1 x22 x21 + x42

(A.89)

is not continuous at (0, 0) and is not differentiable. However, both ∂f /∂x1 and ∂f /∂x2 exist at every point in R2 . Even for continuous functions, the existence of all partial derivatives does not imply differentiability as defined above. On the other hand, if f is known to be differentiable at point x, then the partial derivatives exist at x, and they determine f 0 (x). Definition A.51 (Jacobian matrix) If f : Rn → Rm is differentiable, then f 0 (x) is given by the Jacobian matrix or the Jacobian transformation [f 0 (x)]:  ∂f1 ∂x1

...

 [f 0 (x)] =  ...

∂fm ∂x1

∂f1 ∂xn



..  . . 

...

(A.90)

∂fm ∂xn

Remark A.17 If a function f : Rn → Rm is differentiable on an open set D ⊂ Rn , then it is continuous on D. The derivative of the function, f 0 , may or may not be continuous. Definition A.52 (Continuously differentiable mapping) A differentiable mapping f of an open set D ⊂ Rn into Rm is continuously differentiable in D if f 0 is such that ||f 0 (y) − f 0 (x)|| < 

(A.91)

provided that x, y ∈ D and ||x − y|| < δ. Theorem A.6 Assume that f maps an open set D ⊂ Rn into Rm . Then f is continuously differentiable on D if and only if the partial derivatives ∂fi , i ∈ [1, m], j ∈ [1, n] ∂xj

(A.92)

exist and are continuous on D. 265

© 2015, J.K. Hedrick and A. Girard

Remark A.18 Because it is relatively easier to work with the partial derivatives of a function, the definition above is often restated as: A function f : Rn → Rm is said to be continuously differentiable at point x0 if the partial derivatives, ∂fi /∂xj , i ∈ [1, m], j ∈ [1, n] exist and are continuous at x0 . Definition A.53 (Continuously differentiable function on a set) A function f : Rn → Rm is said to be continuously differentiable on a set D ⊂ Rn if it is continuously differentiable at every point of D. Definition A.54 (Gradient) Given a function f : Rn → Rm with continuous partial derivatives, abusing notation slightly, we write that f 0 (x) or Df (x) is both the Jacobian matrix and the total derivative of f at x. If f : Rn → R, then the Jacobian matrix is the row vector f 0 (x) =

h

∂f ∂x1

∂f ∂x2

...

∂f ∂xn

i

.

(A.93)

This vector is called the gradient of f and identifies the direction of steepest ascent. We frequently write this vector as ∂f or ∇f (x), ∂x

(A.94)

that is, i h ∂f ∂f ∂f ∂f ... = ∂x (A.95) ∂x2 ∂xn . 1 ∂x Remark A.19 It is possible to show that the set of functions f : Rn → Rm with continuous partial derivatives, together with the operations of addition and scalar multiplication, form a vector space. This vector space is denoted by C 1 . ∇f (x) =

Definition A.55 (Function of class C k , Smooth function) In general, if a function f : Rn → Rm has continuous partial derivatives up to order k, the function is said to be in C k or of class C k , and we write f ∈ C k . If a function f has continuous partial derivatives of any order, then it is said to be smooth, and we write f ∈ C ∞ . Abusing this notation slightly, f is said to be sufficiently smooth where f has continuous partial derivatives of any required order.

A.8.1

Useful Theorems

Theorem A.7 (Chain rule) Let f1 : D1 ⊂ Rn → Rn , and f2 : D2 ⊂ Rn → Rn . If f2 is differentiable at a ∈ D2 and f1 is differentiable at f2 (a), then f2 ◦ f1 is differentiable at a, and D(f2 ◦ f1 )(a) = Df1 (f2 (a))Df2 (a). 266

(A.96)

© 2015, J.K. Hedrick and A. Girard

Theorem A.8 (Mean value theorem) Let f : [a, b] → R be continuous on the closed interval [a, b] and differentiable on the open interval (a, b). Then there exists a point c in (a, b) such that f (b) − f (a) = f 0 (c)(b − a).

(A.97)

Theorem A.9 Let Ω be an open subset of Rn . Consider the function f : Ω → Rm and assume that the open set Ω contains the points a and b and the line segment S joining these points. Further assume that f is differentiable at every point of S. Then there exists a point c on S such that ||f (b) − f (a)|| = ||f 0 (c)(b − a)||.

(A.98)

Theorem A.10 (Inverse function theorem) Let f : Rn → Rn be continuously differentiable on an open set D containing the point x0 ∈ Rn , and let f 0 (x0 ) 6= 0. Then, there exist an open set U0 containing x0 and on open set W0 containing f (x0 ) such that f : U0 → W0 has a continuous inverse f −1 : W0 → U0 that is differentiable, and for all y = f (x) ∈ W0 satisfies  −1 Df −1 (y) = [Df (x)]−1 = Df −1 (y) .

A.9

(A.99)

Lipschitz Continuity

Definition A.56 (Locally Lipschitz function, Lipschitz function, Globally Lipschitz function for f = f (x)) A functionf : Rn → Rm is said to be locally Lipschitz on D if every point of D has a neighborhood D0 ⊂ D over which the restriction of f to the domain D0 satisfies ||f (x1 ) − f (x2 )|| ≤ L||x1 − x2 ||.

(A.100)

The function f is said to be Lipschitz on an open set D ⊂ Rn it is satisfies the above condition for all x1 , x2 ∈ D. Finally, f is said to be globally Lipschitz if it satisfies the property on D = Rn . Remark A.20 Note that if f : Rn → Rm is Lipschitz on D ⊂ Rn , then, given  > 0, we can define δ = /L, and we have that ∀x1 , x2 ∈ D, ||x1 − x2 || < δ =⇒ ||f (x1 ) − f (x2 )|| < L||x1 − x2 || < L

 = , L

(A.101)

so f is uniformly continuous. However, the converse is not true, that is, not every uniformly continuous function is Lipschitz. 267

© 2015, J.K. Hedrick and A. Girard

Theorem A.11 If a function f : Rn → Rn is continuously differentiable on an open set D ⊂ Rn , then it is locally Lipschitz on D. Proof A.4 (Of Theorem A.11) Consider x0 ∈ D and let r > 0 be small enough to ensure that Br (x0 ) ∈ D, where Br (x0 ) = {x ∈ D : |x − x0 | < r}.

(A.102)

Further consider two arbitrary points x1 , x2 ∈ Br . Noting that the closed ball Br is a convex set, we conclude that the line segment γ(θ) = θx1 + (1 − θ)x2 , 0 ≤ θ ≤ 1 is contained in Br (x0 ). Now, define the function φ : [0, 1] → Rn such that φ(θ) = f ◦ γ = f (γ(θ)).

(A.103)

By the mean value theorem, there exists a θ1 ∈ (0, 1) such that ||φ(1) − φ(0)|| = ||φ0 (θ1 )||.

(A.104)

Calculating φ0 (θ1 ) using the chain rule, we have ∂f ||φ(1) − φ(0)|| = (x1 − x2 ) . ∂x

(A.105)

Substituting φ(1) = f (x1 ), φ(0) = f (x2 ) yields ∂f ||f (x1 ) − f (x2 )|| ≤ ||x1 − x2 || + L||x1 − x2 ||. ∂x

(A.106)

Note that the theorem provides a mechanism for calculating the Lipschitz constant. L can be estimated by ∂f ∀x ∈ Br (x0 ), ≤ L. ∂x

(A.107)

If f = f (x, t), we extend the previous definitions. Definition A.57 (Locally Lipschitz function, Lipschitz function for f = f (x, t)) A function f (x, t) : Rn ×R → Rn is said to be locally Lipschitz in x on an open set D ×[t0 , T ] ⊂ Rn × R if every point of D has a neighborhood D1 ⊂ D over which the restriction of f to domain D1 × [t0 , T ] satisfies 268

© 2015, J.K. Hedrick and A. Girard

||f (x1 ) − f (x2 )|| ≤ L||x1 − x2 ||.

(A.108)

The function f is said to be locally Lipschitz on D ⊂ Rn × [t0 , ∞) if it is locally Lipschitz in x on every D1 × [t0 , T ] ⊂ D × [t0 , ∞). f is said to be Lipschitz in x on D × [t0 , T ] if it satisfies the property for all x1 , x2 ∈ D and all t ∈ [t0 , ]. Theorem A.12 Let f : Rn × R → Rm be continuously differentiable on D × [t0 , T ] and assume that the derivative of f satisfies ∂f (x, t) ≤ L ∂x

(A.109)

on D × [t0 , T ]. Then f is Lipschitz continuous on D with constant L: ∀x, y ∈ D, ∀t ∈ [t0 , T ], ||f (x, t) − f (y, t)|| ≤ L||x − y||.

A.10

(A.110)

Contraction Mapping

This result is used later to analyze the existence and uniqueness of solutions of a class of ODEs. Definition A.58 (Contraction) Let (X, d) be a metric space, and let S ⊂ X. A mapping f : S → S is said to be a contraction on S if there exists a number ξ < 1 such that ∀x, y ∈ S, d(f (x), f (y)) ≤ ξd(x, y).

(A.111)

Remark A.21 Every contraction is (uniformly) continuous on S. Theorem A.13 (Contraction mapping principle) Let S be a closed subset of the complete metric space (X, d). Every contraction mapping f : S → S has one and only one x ∈ S such that f (x) = x. Remark A.22 A point x0 ∈ X satisfying f (x0 ) = x0 is called a fixed point. The contraction mapping principle is sometimes called the fixed point theorem. Proof A.5 (Of Theorem A.13) Let x0 be an arbitrary point in S, and denote x1 = f (x0 ), x2 = f (x1 ), ..., xn+1 = f (xn ). This construction defines a sequence {xn } = {f (xn−1 )}. Since f maps S onto itself, ∀k, xk ∈ S. We have d(xn+1 , xn ) = d(f (xn ), f (xn−1 )) ≤ ξd(xn , xn−1 ) 269

(A.112)

© 2015, J.K. Hedrick and A. Girard

and by induction d(xn+1 , xn ) ≤ ξ n d(x1 , x0 ).

(A.113)

Now assume that m > n > N . By successive applications of the triangle inequality, m X

d(xn , xm ) ≤

d(xi , xi−1 ),

(A.114)

i=n+1 n

≤ (ξ + ξ n+1 + ... + ξ m−1 )d(x1 , x0 ), ≤ ξ n (1 + ξ + ... + ξ m−n−1 )d(x1 , x0 ).

(A.115) (A.116)

The series (1 + ξ + ξ 2 + ...) converges to 1 1−ξ

(A.117)

for all ξ < 1. Therefore, 1 + ξ + ... + ξ m−n−1 ≤

1 , 1−ξ

(A.118)

and therefore

d(xn , xm ) ≤

ξn d(x1 , x0 ) = . 1−ξ

(A.119)

Then d(xn , xm ) ≤ , for all m, n > N . In other words, {xn } is a Cauchy sequence. Since the metric space (X, d) is complete, {xn } has a limit limn→∞ (xn ) = x for some x ∈ X. Now, since f is a contraction, f is continuous. So f (x) = lim f (xn ) = lim (xn+1 ) = x. n→∞

n→∞

(A.120)

And since ∀n, xn ∈ S ⊂ X, and since S is closed, it follows that x ∈ S. Thus, the existence of a fixed point is proved. To prove uniqueness, assume that x and y are two different fixed points. Then, f (x) = x and f (y) = y and d(f (x), f (y)) = d(x, y). Because f is a contraction, d(x, y) ≤ ξd(x, y),

(A.121)

where ξ < 1. The above can only be satisfied if d(x, y) = 0, so x = y. This completes the proof. 270

© 2015, J.K. Hedrick and A. Girard

A.11

Solution of Differential Equations

When dealing with ordinary linear differential equations, it is usually possible to derive a closed-form solution. For example, given the state space realization of a linear time-invariant system x˙ = Ax + Bu, x(0) = x0 ,

(A.122)

we can find the following closed form solution for a given u:

At

Z

t

eA(t−τ ) Bu(τ ) dτ.

x(t) = e x0 +

(A.123)

0

In general, this cannot be done for nonlinear differential equations. Indeed, when dealing with nonlinear differential equations, two issues are of importance: 1) existence of the solution, and 2) uniqueness of the solution. We present sufficient conditions for the existence and uniqueness of the solution of a differential equation of the form x˙ = f (x, t), x(t0 ) = x0 .

(A.124)

Theorem A.14 (Local existence and uniqueness of solution of nonlinear ODE) Consider the nonlinear differential equation x˙ = f (x, t), x(t0 ) = x0 .

(A.125)

Let B = {x ∈ Rn : ||x − x0 || < r}. Assume that f is piecewise continuous in t and satisfies ∀x1 , x2 ∈ B, ∀t ∈ [t0 , t1 ], ||f (x1 , t) − f (x2 , t)|| ≤ L||x1 − x2 ||.

(A.126)

Then, there exists some δ > 0 such that (A.125) has a unique solution in [t0 , t0 + δ]. Proof A.6 (Of Theorem A.14) Notice that if x(t) is a solution of (A.125), then x(t) satisfies Z

t

x(t) = x0 +

f (x(τ ), τ ) dτ,

(A.127)

t0

which is of the form x(t) = (Fx )(t) where Fx is a continuous function of t. This implies that a solution of (A.125) is a fixed point of the mapping F that maps x into Fx . The existence of a fixed point of this map, in turn, can be verified by the contraction mapping theorem. To start with, we define the sets X and S ⊂ X as 271

© 2015, J.K. Hedrick and A. Girard

X = C[t0 , t0 + δ],

(A.128)

thus X is the set of all continuous functions defined on the interval [t0 , t0 + δ]. Given x ∈ X, we denote ||x||c =

max ||x(t)||,

(A.129)

t∈[t0 ,t0 +δ]

and finally S = {x ∈ X : ||x − x0 ||c ≤ r}.

(A.130)

Clearly, S ⊂ X. It can also be shown that S is closed and that X with the norm (A.129) is a complete metric space. To complete the proof, we proceed in three steps: 1) show that F : S → S, 2) show that F is a contraction from S to S. This in turn implies that there exists one and only one fixed point x = Fx ∈ S, and thus a unique solution in S. Because we are interested in solutions of (A.125) in X (not only on S), step 3) consists of showing that any possible solution of (A.125) must be in S. Step 1: We have Z

t

x(t) = x0 +

f (x(τ ), τ ) dτ,

(A.131)

t0

and x(t) = (Fx )(t). Hence, Z

t

(Fx )(t) − x0 =

f (x(τ ), τ ) dτ,

(A.132)

[f (x(τ ), τ ) − f (x0 , τ ) + f (x0 , τ )] dτ.

(A.133)

t Z 0t

= t0

The function f is bounded on [t0 , t1 ] (since it is piecewise continuous). It follows that we can find ξ such that ξ = max ||f (x0 , t)||.

(A.134)

t∈[t0 ,t1 ]

Then, 272

© 2015, J.K. Hedrick and A. Girard

Z

t

||Fx − x0 || ≤

[||f (x(τ ), τ ) − f (x0 , τ )|| + ||f (x0 , τ )||] dτ,

(A.135)

[L||x(τ ) − x0 || + ξ] dτ,

(A.136)

t Z 0t

≤ t0

and since ∀x ∈ S, ||x − x0 || < r, we have Z

t

||Fx − x0 || ≤

[Lr + ξ] dτ,

(A.137)

t0

≤ (t − t0 )(Lr + ξ).

(A.138)

max ||Fx − x0 || ≤ δ(Lr + ξ),

(A.139)

It follows that ||Fx − x0 || =

t∈[t0 ,t0 +δ]

and then, choosing δ ≤ r/(Lr + ξ) means that F maps S into S. Step 2: To show that F is a contraction mapping on S, we consider x1 , x2 ∈ S. Then,

||(Fx1 )(t) − (Fx2 )(t)||c = ≤ ≤ ≤

Z t [f (x1 (τ ), τ ) − f (x2 (τ ), τ )] dτ , t Z t0 ||f (x1 (τ ), τ ) − f (x2 (τ ), τ )|| dτ, t0 Z t L||x1 (τ ) − x2 (τ )|| dτ, t0 Z t L||x1 − x2 ||c dτ.

(A.140) (A.141) (A.142) (A.143)

t0

Then, ||Fx1 − Fx2 ||c ≤ Lδ||x1 − x2 ||c ≤ ρ||x1 − x2 ||c for δ ≤

ρ . L

(A.144)

Choosing ρ < 1 and δ ≤ ρ/L, we conclude that F is a contraction. This implies that there is a unique solution of (A.125) in S. Step 3: Given that S ⊂ X, to complete the proof, we must show that any solution of (A.125) in X must lie in S. 273

© 2015, J.K. Hedrick and A. Girard

Starting at x0 at t0 , a solution can leave S if and only if at some time t = t1 , x(t) crosses the border B for the first time. For this to be the case, we must have ||x(t1 ) − x0 || = r.

(A.145)

[||f (x(τ ), τ ) − f (x0 , τ )|| + ||f (x0 , τ )||] dτ,

(A.146)

[L||x(τ ) − x0 || + ξ] dτ,

(A.147)

[Lr + ξ] dτ.

(A.148)

Thus, for all t ≤ t1 , we have Z

t

||x(t) − x0 || ≤ t Z 0t

≤ t Z 0t

≤ t0

It follows that r = ||x(t1 ) − x0 || ≤ (Lr + ξ)(t1 − t0 ).

(A.149)

Denote t1 = t0 + µ. Then, µ≥

r , Lr + ξ

(A.150)

and the solution x(t) is confined to B. This completes the proof. Remark A.23 It is important to notice that the result above is a sufficient but not a necessary condition for the existence and uniqueness of the solution of (A.125). According to the result, the solution is guaranteed to exist only locally, that is, in the interval [t0 , t0 + δ]. For completeness, we state (but do not prove) a slightly modified version of the result that provides a condition for the global existence and uniqueness of the solution of the same differential equation. The “price” paid for this generalization is a stronger and much more conservative condition imposed on the differential equation. Theorem A.15 (Global existence and uniqueness of solution of nonlinear ODE) Consider again the nonlinear differential equation x˙ = f (x, t), x(t0 ) = x0 .

(A.151)

Assume that f (x, t) is piecewise continuous in t and satisfies ||f (x1 , t) − f (x2 , t)|| ≤ L||x1 − x2 ||, ||f (x0 , t)|| ≤ ∆,

(A.152) (A.153)

for all x1 , x2 ∈ Rn and for all t ∈ [t0 , t1 ]. Then, (A.151) has a unique solution in [t0 , t1 ]. 274

© 2015, J.K. Hedrick and A. Girard

Remark A.24 The theorem above is usually too conservative to be of practical use. The conditions of the theorem imply the existence of a global Lipschitz constant, which is very restrictive. The local Lipschitz condition for the local existence and uniqueness result is satisfied by any function f (x, t) satisfying somewhat mild smoothness conditions, as outlined in Theorem A.12.

A.12

References and Further Reading

The material presented here is standard and well covered in many texts, including [1], [2], [5], [6], [7].

275

© 2015, J.K. Hedrick and A. Girard

276

© 2015, J.K. Hedrick and A. Girard

Bibliography [1] V. I. Arnold. Ordinary Differential Equations. MIT Press, 1973. [2] C. T. Chen. Linear Systems Theory and Design. Oxford University Press, 1998. [3] D. Graham and D.T. McRuer. Analysis of Nonlinear Control Systems. Dover, 1971. [4] R. Hermann and A. J. Krener. Nonlinear controllability and observability. IEEE Transactions on Automatic Control, 22(5):728–40, 1977. [5] M. W. Hirsch and S. Smale. Differential Equations, Dynamical Systems and Linear Algebra. Academic Press, 1974. [6] I. J. Maddox. Elements of Functional Analysis. Cambridge University Press, 1988. [7] W. Rudin. Principles of Mathematical Analysis. Mac Graw and Hill, 1976. [8] J.J.E. Slotine and W. Li. Applied Nonlinear Control. Prentice Hall, 1991. [9] B. Song and J.K. Hedrick. Dynamic Surface Control of Uncertain Nonlinear Systems. Springer, 2011. [10] D. Swaroop, J.K. Hedrick, P.P. Yip, and J.C. Gerdes. Dynamic surface control for a class of nonlinear systems. IEEE Transactions on Automatic Control, 45(10):1893–99, 2000. [11] P.P. Yip and J.K. Hedrick. Adaptive dynamic surface control: A simplified algorithm for adaptive backstepping control of nonlinear systems. International Journal of Control, 71(5):959–79, 1998.

277