22
ME 132, Spring 2005, UC Berkeley, A. Packard 156 18 Jacobian Linearizations, equilibrium points In modeling systems, we see that nearly all systems are nonlinear, in that the differential equations governing the evolution of the system’s variables are nonlinear. However, most of the theory we have developed has centered on linear systems. So, a question arises: “In what limited sense can a nonlinear system be viewed as a linear system?” In this section we develop what is called a “Jacobian linearization of a nonlinear system,” about a specific operating point, called an equilibrium point. 18.1 Equilibrium Points Consider a nonlinear differential equation ˙ x(t)= f (x(t),u(t)) (74) where f is a function mapping R n × R m R n . A point ¯ x R n is called an equilibrium point if there is a specific ¯ u R m (called the equilibrium input) such that f x, ¯ u)=0 n Suppose ¯ x is an equilibrium point (with equilibrium input ¯ u). Consider starting the system (74) from initial condition x(t 0 )=¯ x, and applying the input u(t) ¯ u for all t t 0 . The resulting solution x(t) satisfies x(t)=¯ x for all t t 0 . That is why it is called an equilibrium point. 18.2 Deviation Variables Suppose (¯ x, ¯ u) is an equilibrium point and input. We know that if we start the system at x(t 0 )=¯ x, and apply the constant input u(t) ¯ u, then the state of the system will remain fixed at x(t)=¯ x for all t. What happens if we start a little bit away from ¯ x, and we apply a slightly different input from ¯ u? Define deviation variables to measure the difference. δ x (t) := x(t) - ¯ x δ u (t) := u(t) - ¯ u In this way, we are simply relabling where we call 0. Now, the variables x(t) and u(t) are related by the differential equation ˙ x(t)= f (x(t),u(t)) Substituting in, using the constant and deviation variables, we get ˙ δ x (t)= f x + δ x (t), ¯ u + δ u (t))

18 Jacobian Linearizations, equilibrium pointspack/me132/Section18.pdf · 18 Jacobian Linearizations, equilibrium points ... where f is a function mapping Rn £ Rm! ... is called

  • Upload
    lydiep

  • View
    244

  • Download
    2

Embed Size (px)

Citation preview

Page 1: 18 Jacobian Linearizations, equilibrium pointspack/me132/Section18.pdf · 18 Jacobian Linearizations, equilibrium points ... where f is a function mapping Rn £ Rm! ... is called

ME 132, Spring 2005, UC Berkeley, A. Packard 156

18 Jacobian Linearizations, equilibrium points

In modeling systems, we see that nearly all systems are nonlinear, in that the differentialequations governing the evolution of the system’s variables are nonlinear. However, mostof the theory we have developed has centered on linear systems. So, a question arises: “Inwhat limited sense can a nonlinear system be viewed as a linear system?” In this sectionwe develop what is called a “Jacobian linearization of a nonlinear system,” about a specificoperating point, called an equilibrium point.

18.1 Equilibrium Points

Consider a nonlinear differential equation

x(t) = f(x(t), u(t)) (74)

where f is a function mapping Rn × Rm → Rn. A point x ∈ Rn is called an equilibrium

point if there is a specific u ∈ Rm (called the equilibrium input) such that

f (x, u) = 0n

Suppose x is an equilibrium point (with equilibrium input u). Consider starting the system(74) from initial condition x(t0) = x, and applying the input u(t) ≡ u for all t ≥ t0. Theresulting solution x(t) satisfies

x(t) = x

for all t ≥ t0. That is why it is called an equilibrium point.

18.2 Deviation Variables

Suppose (x, u) is an equilibrium point and input. We know that if we start the system atx(t0) = x, and apply the constant input u(t) ≡ u, then the state of the system will remainfixed at x(t) = x for all t. What happens if we start a little bit away from x, and we applya slightly different input from u? Define deviation variables to measure the difference.

δx(t) := x(t) − xδu(t) := u(t) − u

In this way, we are simply relabling where we call 0. Now, the variables x(t) and u(t) arerelated by the differential equation

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

Substituting in, using the constant and deviation variables, we get

δx(t) = f (x + δx(t), u + δu(t))

Page 2: 18 Jacobian Linearizations, equilibrium pointspack/me132/Section18.pdf · 18 Jacobian Linearizations, equilibrium points ... where f is a function mapping Rn £ Rm! ... is called

ME 132, Spring 2005, UC Berkeley, A. Packard 157

This is exact. Now however, let’s do a Taylor expansion of the right hand side, and neglectall higher (higher than 1st) order terms

δx(t) ≈ f (x, u) +∂f

∂x

∣x=xu=u

δx(t) +∂f

∂u

∣x=xu=u

δu(t)

But f(x, u) = 0, leaving

δx(t) ≈∂f

∂x

∣x=xu=u

δx(t) +∂f

∂u

∣x=xu=u

δu(t)

This differential equation approximately governs (we are neglecting 2nd order and higherterms) the deviation variables δx(t) and δu(t), as long as they remain small. It is a linear,time-invariant, differential equation, since the derivatives of δx are linear combinations of theδx variables and the deviation inputs, δu. The matrices

A :=∂f

∂x

∣x=xu=u

∈ Rn×n , B :=∂f

∂u

∣x=xu=u

∈ Rn×m (75)

are constant matrices. With the matrices A and B as defined in (75), the linear system

δx(t) = Aδx(t) + Bδu(t)

is called the Jacobian Linearization of the original nonlinear system (74), about theequilibrium point (x, u). For “small” values of δx and δu, the linear equation approximately

governs the exact relationship between the deviation variables δu and δx.

For “small” δu (ie., while u(t) remains close to u), and while δx remains “small” (ie., whilex(t) remains close to x), the variables δx and δu are related by the differential equation

δx(t) = Aδx(t) + Bδu(t)

In some of the rigid body problems we considered earlier, we treated problems by makinga small-angle approximation, taking θ and its derivatives θ and θ very small, so that cer-tain terms were ignored (θ2, θ sin θ) and other terms simplified (sin θ ≈ θ, cos θ ≈ 1). Inthe context of this discussion, the linear models we obtained were, in fact, the Jacobianlinearizations around the equilibrium point θ = 0, θ = 0.

If we design a controller that effectively controls the deviations δx, then we have designed acontroller that works well when the system is operating near the equilibrium point (x, u).We will cover this idea in greater detail later. This is a common, and somewhat effectiveway to deal with nonlinear systems in a linear manner.

Page 3: 18 Jacobian Linearizations, equilibrium pointspack/me132/Section18.pdf · 18 Jacobian Linearizations, equilibrium points ... where f is a function mapping Rn £ Rm! ... is called

ME 132, Spring 2005, UC Berkeley, A. Packard 158

18.3 Tank Example

? ?

??

6

hT

qH qC

Consider a mixing tank, with constant supply temperaturesTC and TH . Let the inputs be the two flow rates qC(t) and qH(t). The equations for the tankare

h(t) = 1AT

(

qC(t) + qH(t) − cDAo

2gh(t))

TT (t) = 1h(t)AT

(qC(t) [TC − TT (t)] + qH(t) [TH − TT (t)])

Let the state vector x and input vector u be defined as

x(t) :=

[

h(t)TT (t)

]

, u(t) :=

[

qC(t)qH(t)

]

f1(x, u) = 1AT

(

u1 + u2 − cDAo

√2gx1

)

f2(x, u) = 1x1AT

(u1 [TC − x2] + u2 [TH − x2])

Intuitively, any height h > 0 and any tank temperature TT satisfying

TC ≤ TT ≤ TH

should be a possible equilibrium point (after specifying the correct values of the equilibriuminputs). In fact, with h and TT chosen, the equation f(x, u) = 0 can be written as

[

1 1TC − x2 TH − x2

] [

u1

u2

]

=

[

cDAo

√2gx1

0

]

The 2× 2 matrix is invertible if and only if TC 6= TH . Hence, as long as TC 6= TH , there is aunique equilibrium input for any choice of x. It is given by

[

u1

u2

]

=1

TH − TC

[

TH − x2 −1x2 − TC 1

] [

cDAo

√2gx1

0

]

This is simply

u1 =cDAo

√2gx1 (TH − x2)

TH − TC

, u2 =cDAo

√2gx1 (x2 − TC)

TH − TC

Page 4: 18 Jacobian Linearizations, equilibrium pointspack/me132/Section18.pdf · 18 Jacobian Linearizations, equilibrium points ... where f is a function mapping Rn £ Rm! ... is called

ME 132, Spring 2005, UC Berkeley, A. Packard 159

Since the ui represent flow rates into the tank, physical considerations restrict them tobe nonegative real numbers. This implies that x1 ≥ 0 and TC ≤ TT ≤ TH . Looking at thedifferential equation for TT , we see that its rate of change is inversely related to h. Hence, thedifferential equation model is valid while h(t) > 0, so we further restrict x1 > 0. Under thoserestrictions, the state x is indeed an equilibrium point, and there is a unique equilibriuminput given by the equations above.

Next we compute the necessary partial derivatives.

[

∂f1

∂x1

∂f1

∂x2

∂f2

∂x1

∂f2

∂x2

]

=

− gcDAo

AT

√2gx1

0

−u1[TC−x2]+u2[TH−x2]x2

1AT

−(u1+u2)x1AT

[

∂f1

∂u1

∂f1

∂u2

∂f2

∂u1

∂f2

∂u2

]

=

[

1AT

1AT

TC−x2

x1AT

TH−x2

x1AT

]

The linearization requires that the matrices of partial derivatives be evaluated at the equi-librium points. Let’s pick some realistic numbers, and see how things vary with differentequilibrium points. Suppose that TC = 10, TH = 90, AT = 3m2, Ao = 0.05m, cD = 0.7. Tryh = 1m and h = 3m, and for TT , try TT = 25 and TT = 75. That gives 4 combinations.Plugging into the formulae give the 4 cases

1.(

h, TT

)

= (1m, 25). The equilibrium inputs are

u1 = qC = 0.126 , u2 = qH = 0.029

The linearized matrices are

A =

[

−0.0258 00 −0.517

]

, B =

[

0.333 0.333−5.00 21.67

]

2.(

h, TT

)

= (1m, 75). The equilibrium inputs are

u1 = qC = 0.029 , u2 = qH = 0.126

The linearized matrices are

A =

[

−0.0258 00 −0.0517

]

, B =

[

0.333 0.333−21.67 5.00

]

3.(

h, TT

)

= (3m, 25). The equilibrium inputs are

u1 = qC = 0.218 , u2 = qH = 0.0503

The linearized matrices are

A =

[

−0.0149 00 −0.0298

]

, B =

[

0.333 0.333−1.667 7.22

]

Page 5: 18 Jacobian Linearizations, equilibrium pointspack/me132/Section18.pdf · 18 Jacobian Linearizations, equilibrium points ... where f is a function mapping Rn £ Rm! ... is called

ME 132, Spring 2005, UC Berkeley, A. Packard 160

4.(

h, TT

)

= (3m, 75). The equilibrium inputs are

u1 = qC = 0.0503 , u2 = qH = 0.2181

The linearized matrices are

A =

[

−0.0149 00 −0.0298

]

, B =

[

0.333 0.333−7.22 1.667

]

We can try a simple simulation, both in the exact nonlinear equation, and the linearization,and compare answers.

We will simulate the systemx(t) = f(x(t), u(t))

subject to the following conditions

x(0) =

[

1.1081.5

]

and

u1(t) =

0.022 for 0 ≤ t ≤ 250.043 for 25 < t ≤ 100

u2(t) =

0.14 for 0 ≤ t ≤ 600.105 for 60 < t ≤ 100

This is close to equilibrium condition #2. So, in the linearization, we will use linearization#2, and the following conditions

δx(0) = x(0) −[

175

]

=

[

0.106.5

]

and

δu1(t) := u1(t) − u1 =

−0.007 for 0 ≤ t ≤ 250.014 for 25 < t ≤ 100

δu2(t) := u2(t) − u2 =

0.014 for 0 ≤ t ≤ 60−0.021 for 60 < t ≤ 100

To compare the simulations, we must first plot x(t) from the nonlinear simulation. Thisis the “true” answer. For the linearization, we know that δx approximately governs thedeviations from x. Hence, for that simulation we should plot x + δx(t). These are shownbelow for both h and TT .

Page 6: 18 Jacobian Linearizations, equilibrium pointspack/me132/Section18.pdf · 18 Jacobian Linearizations, equilibrium points ... where f is a function mapping Rn £ Rm! ... is called

ME 132, Spring 2005, UC Berkeley, A. Packard 161

0 10 20 30 40 50 60 70 80 90 1001

1.05

1.1

1.15

1.2

1.25

1.3Water Height: Actual (solid) and Linearization (dashed)

Met

ers

0 10 20 30 40 50 60 70 80 90 10066

68

70

72

74

76

78

80

82Water Temp: Actual (solid) and Linearization (dashed)

Deg

rees

Time

18.4 Linearizing about general solution

In section 18.2, we discussed the linear differential equation which governs small deviationsaway from an equilibrium point. This resulted in a linear, time-invariant differential equation.

Often times, more complicated situations arise. Consider the task of controlling a rockettrajectory from Earth to the moon. By writing out the equations of motion, from Physics,we obtain state equations of the form

x(t) = f(x(t), u(t), d(t), t) (76)

where u is the control input (thrusts), d are external disturbances.

Page 7: 18 Jacobian Linearizations, equilibrium pointspack/me132/Section18.pdf · 18 Jacobian Linearizations, equilibrium points ... where f is a function mapping Rn £ Rm! ... is called

ME 132, Spring 2005, UC Berkeley, A. Packard 162

Through much computer simulation, a preplanned input schedule is developed, which, underideal circumstances (ie., d(t) ≡ 0), would get the rocket from Earth to the moon. Denotethis preplanned input by u(t), and the ideal disturbance by d(t) (which we assume is 0).This results in an ideal trajectory x(t), which solves the differential equation,

˙x(t) = f(

x(t), u(t), d(t), t)

Now, small nonzero disturbances are expected, which lead to small deviations in x, whichmust be corrected by small variations in the pre-planned input u. Hence, engineers need tohave a model for how a slightly different input u(t) + δu(t) and slightly different disturbanced(t) + δd(t) will cause a different trajectory. Write x(t) in terms of a deviation from x(t),defining δx(t) := x(t) − x(t), giving

x(t) = x(t) + δx(t)

Now x, u and d must satisfy the differential equation, which gives

x(t) = f (x(t), u(t), d(t), t)˙x(t) + δx(t) = f

(

x(t) + δx(t), u(t) + δu(t), d(t) + δd(t), t)

≈ f (x(t), u(t), 0, t) + ∂f

∂x

∣x(t)=x(t)

u(t)=u(t)d(t)=d(t)

δx(t) + ∂f

∂u

∣x(t)=x(t)

u(t)=u(t)d(t)=d(t)

δu(t) + ∂f

∂d

∣x(t)=x(t)

u(t)=u(t)d(t)=d(t)

δd(t)

But the functions x and u satisfy the governing differential equation, so ˙x(t) = f (x(t), u(t), 0, t),leaving the (approximate) governing equation for δx

δx(t) =∂f

∂x

x(t)=x(t)

u(t)=u(t)d(t)=d(t)

δx(t) +∂f

∂u

x(t)=x(t)

u(t)=u(t)d(t)=d(t)

δu(t) +∂f

∂d

x(t)=x(t)

u(t)=u(t)d(t)=d(t)

δd(t)

Define time-varying matrices A, B1 and B2 by

A(t) :=∂f

∂x

x(t)=x(t)

u(t)=u(t)d(t)=d(t)

B1(t) :=∂f

∂u

x(t)=x(t)

u(t)=u(t)d(t)=d(t)

B2(t) :=∂f

∂d

x(t)=x(t)

u(t)=u(t)d(t)=d(t)

The deviation variables are approximately governed by

δx(t) = A(t)δx(t) + B1(t)δu(t) + B2(t)δd(t) = A(t)δx(t) +[

B1(t) B2(t)]

[

δu(t)δd(t)

]

This is called the linearization of system (76) about the trajectory(

x, u, d)

. This type oflinearization is a generalization of linearizations about equilibrium points. Linearizing aboutan equilibrium point yields a LTI system, while linearizing about a trajectory yields an LTVsystem.

In general, these types of calculations are carried out numerically,

Page 8: 18 Jacobian Linearizations, equilibrium pointspack/me132/Section18.pdf · 18 Jacobian Linearizations, equilibrium points ... where f is a function mapping Rn £ Rm! ... is called

ME 132, Spring 2005, UC Berkeley, A. Packard 163

• simulink to get solution x(t) given particular inputs u(t) and d(t)

• Numerical evaluation of ∂f

∂x, etc, evaluated at the solution points

• Storing the time-varying matrices A(t), B1(t), B2(t) for later use

In a simple case it is possible to analytically determine the time-varying matrices.

Page 9: 18 Jacobian Linearizations, equilibrium pointspack/me132/Section18.pdf · 18 Jacobian Linearizations, equilibrium points ... where f is a function mapping Rn £ Rm! ... is called

ME 132, Spring 2005, UC Berkeley, A. Packard 164

18.5 Problems

1. The temperature in a particular 3-dimensional solid is a function of position, and isknown to be

T (x, y, z) = 42 + (x − 2)2 + 3 (y − 4)2 − 5 (z − 6)2 + 2yz

(a) Find the first order approximation (linearization) of the temperature near thelocation (4, 6, 0). Use δx, δy and δz as your deviation variables.

(b) What is the maximum error between the actual temperature and the first orderapproximation formula for |δx| ≤ 0.3, |δy| ≤ 0.2, |δz| ≤ 0.1. You may use Matlabto solve this numerically, or analytically if you wish. If you do it analytically,remember how to do it. First, compute the error at the 8 corners of the“cube.”Then, using calculus, look along all 8 edges, and find critical points (where thesingle partial derivative vanishes). Then, look on all 6 faces to find critical points(where both partial derivative vanish). Finally, look inthe cube for critical points(where all 3 partial derivatives vanish). The maximum (and minimum) must beat one of these numerous points.

(c) More generally, suppose that x ∈ R, y ∈ R, z ∈ R. Find the first order approxi-mation of the temperature near the location (x, y, z).

2. The pitching-axis of a tail-fin controlled missile is governed by the nonlinear stateequations

α(t) = K1Mfn (α(t),M) cos α(t) + q(t)q(t) = K2M

2 [fm (α(t),M) + Eu(t)]

Here, the states are x1 := α, the angle-of-attack, and x2 := q, the angular velocity ofthe pitching axis. The input variable, u, is the deflection of the fin which is mountedat the tail of the missile. K1, K2, and E are physical constants, with E > 0. M is thespeed (Mach) of the missile, and fn and fm are known, differentiable functions (fromwind-tunnel data) of α and M . Assume that M is a constant, and M > 0.

(a) Show that for any specific value of α, with |α| < π2, there is a pair (q, u) such that

[

αq

]

, u

is an equilibrium point of the system (this represents a turn at a constant rate).Your answer should clearly show how q and u are functions of α, and will mostlikely involve the functions fn and fm.

(b) Calculate the Jacobian Linearization of the missile system about the equilibriumpoint. Your answer is fairly symbolic, and may depend on partial derivatives of thefunctions fn and fm. Be sure to indicate where the various terms are evaluated.

3. (Taken from “Introduction to Dynamic Systems Analysis,” T.D. Burton, 1994) Letf1(x1, x2) := x1 − x3

1 + x1x2, and f2(x1, x2) := −x2 + 1.5x1x2. Consider the 2-statesystem x(t) = f(x(t)).

Page 10: 18 Jacobian Linearizations, equilibrium pointspack/me132/Section18.pdf · 18 Jacobian Linearizations, equilibrium points ... where f is a function mapping Rn £ Rm! ... is called

ME 132, Spring 2005, UC Berkeley, A. Packard 165

(a) Note that there are no inputs. Find all equilibrium points of this system. Hint:

In this problem, there are 4 equilibrium points.

(b) Derive the Jacobian linearization which describes the solutions near each equilib-rium point. You will have 4 different linearizations, each of the form

δx(t) = Aδx(t)

with different A matrices dependent on which equilibrium point the linearizationhas been computed.

(c) Using eigenvalues, determine the stability of each of 4 Jacobian linearizations.Note: (for part 3e below) If the linearization is stable, it means that while thedeviation of x(t) from x remains small, the variables x(t)−x approximately evolveby a linear differential equation whose homogenous solutions all decay to zero. So,we would expect that initial conditions near the equilibium point would convergeto the equilibrium point. Conversely, if the linearization is unstable, it meansthat while the deviation of x(t) from x remains small, the variables x(t) − xapproximately evolve by a linear differential equation that has some homogenoussolutions which grow. So, we would expect that some initial conditions near theequilibium point would initially diverge away from the equilibrium point.

(d) Using Simulink, simulate the system starting from 30 random initial conditionssatisfying −3 ≤ x1(0) ≤ 3, and −3 ≤ x2(0) ≤ 3. Plot the resulting solutions inx2 versus x1 plane (each solution will be a curve - parametrized by time t). Thisis called a phase plane graph. Make the axis limits −4 ≤ xi ≤ 4. On each curve,hand-draw in arrow(s) indicating which direction is increasing time. Mark the 4equilibrium points on your graph.

(e) Make note of the solution curves near the equilibrium points, and how the curvesrelate to the stability computation in part 3c.

Hints: The simulation can be “built” using 2 integrators (from Continuous), aMux and Demux from Signal Routing, and a Matlab Fcn block from User-defined

Functions. This is shown below.

Since some initial conditions will lead to diverging solutions, it is best to stop thesimulation when either x1(t) ≥ 10 (say) or x2(t) ≥ 10. Use a Stop Simulation block(from Sinks), with its input coming from the Relational Operator (from Math).

Page 11: 18 Jacobian Linearizations, equilibrium pointspack/me132/Section18.pdf · 18 Jacobian Linearizations, equilibrium points ... where f is a function mapping Rn £ Rm! ... is called

ME 132, Spring 2005, UC Berkeley, A. Packard 166

x2data

To Workspace1

x1data

To Workspace

STOP

Stop Simulation1

STOP

Stop Simulation

>=

RelationalOperator1

>=

RelationalOperator

MATLABFunction

MATLAB Fcn

1s

Integrator1

1s

Integrator

Demux

R+5

Constant1

R+5

Constant

4. A hoop (of radius R) is mounted vertically, and rotates at a constant angular velocityΩ. A bead of mass m slides along the hoop, and θ is the angle that locates the beadlocation. θ = 0 corresponds to the bead at the bottom of the hoop, while θ = πcorresponds to the top of the hoop.

The nonlinear, 2nd order equation (from Newton’s law) governing the bead’s motion

Page 12: 18 Jacobian Linearizations, equilibrium pointspack/me132/Section18.pdf · 18 Jacobian Linearizations, equilibrium points ... where f is a function mapping Rn £ Rm! ... is called

ME 132, Spring 2005, UC Berkeley, A. Packard 167

ismRθ + mg sin θ + αθ − mΩ2R sin θ cos θ = 0

All of the parameters m,R, g, α are positive.

(a) Let x1(t) := θ(t) and x2(t) := θ(t). Write the 2nd order nonlinear differentialequation in the state-space form

x1(t) = f1 (x1(t), x2(t))x2(t) = f2 (x1(t), x2(t))

(b) Show that x1 = 0, x2 = 0 is an equilibrium point of the system.

(c) Find the linearized systemδx(t) = Aδx(t)

which governs small deviations away from the equilibrium point (0, 0).

(d) Under what conditions (on m,R, Ω, g) is the linearized system stable?

(e) Show that x1 = π, x2 = 0 is an equilibrium point of the system.

(f) Find the linearized system δx(t) = Aδx(t) which governs small deviations awayfrom the equilibrium point (π, 0).

(g) Under what conditions is the linearized system stable?

(h) It would seem that if the hoop is indeed rotating (with angular velocity Ω) thenthere would other equilibrium point (with 0 < θ < π/2). Do such equilibriumpoints exist in the system? Be very careful, and please explain your answer.

(i) Find the linearized system δx(t) = Aδx(t) which governs small deviations awayfrom this equilibrium point.

(j) Under what conditions is the linearized system stable?

Page 13: 18 Jacobian Linearizations, equilibrium pointspack/me132/Section18.pdf · 18 Jacobian Linearizations, equilibrium points ... where f is a function mapping Rn £ Rm! ... is called

ME 132, Spring 2005, UC Berkeley, A. Packard 168

5. Car Engine Model (the reference for this problem is Cho and Hedrick, “AutomotivePowertrain Modelling for Control,” ASME Journal of Dynamic Systems, Measurement

and Control, vol. 111, No. 4, December 1989): In this problem we consider a 1-statemodel for an automotive engine, with the transmission engaged in 4th gear. The enginestate is ma, the mass of air (in kilograms) in the intake manifold. The state of thedrivetrain is the angular velocity, ωe, of the engine. The input is the throttle angle, α,(in radians). The equations for the engine is

ma(t) = c1T (α(t)) − c2ωe(t)ma(t)Te = c3ma(t)

where we treat ωe and α as inputs, and Te as an output. The drivetrain is modeled

ωe(t) =1

Je

[Te(t) − Tf (t) − Td(t) − Tr(t)]

The meanings of the terms are as follows:

• T (α) is a throttle flow characteristic depending on throttle angle,

T (α) =

0.00032 for α < 01 − cos (1.14α − 0.0252) for 0 ≤ α ≤ 1.4

1 for α > 1.4

• Te is the torque from engine on driveshaft, c3 = 47500 Nm/kg.

• Tf is engine friction torque (Nm), Tf = 0.106ωe + 15.1

• Td is torque due to wind drag (Nm), Td = c4ω2e , with c4 = 0.0026 Nms2

• Tr is torque due to rolling resistance at wheels (Nm), Tr = 21.5.

• Je is the effective moment of inertia of the engine, transmission, wheels, car,Je = 36.4kgm2

• c1 = 0.6kg/s, c2 = 0.095

• In 4th gear, the speed of car, v (m/s), is related to ωe as v = 0.129ωe.

(a) Combine these equations into state variable form.

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

where x1 = ma, x2 = ωe, u = α and y = v.

(b) For the purpose of calculating the Jacobian linearization, explicitly write out thefunction f(x, u) (without any t dependence). Note that f maps 3 real numbers(x1, x2, u) into 2 real numbers. There is no explicit time dependence in thisparticular f .

Page 14: 18 Jacobian Linearizations, equilibrium pointspack/me132/Section18.pdf · 18 Jacobian Linearizations, equilibrium points ... where f is a function mapping Rn £ Rm! ... is called

ME 132, Spring 2005, UC Berkeley, A. Packard 169

(c) Compute the equilibrium values of ma, ωe and α so that the car travels at aconstant speed of 22 m/s (let v denote the equilibrium speed). Repeat calculationfor an equilibrium speed of v = 32 m/s . Make sure your formula are clear enoughthat you repeat this at any value of v.

(d) Consider deviations from these equilibrium values,

α(t) = α + δα(t)ωe(t) = ωe + δωe

(t)ma(t) = ma + δma

(t)y(t) = y + δy(t)

Find the (linear) differential equations that approximately govern these deviationvariables (Jacobian Linearzation discussed in class), in both the 22 m/s and 32m/s cases.

(e) Using Simulink, starting from the initial condition ωe(0) = ωe,ma(0) = ma,apply a step input of

α(t) = α + β

for 6 values of β, β = ±0.01,±0.04,±0.1 and obtain the response for v and ma.

(f) Also using Simulink (you can use the State-Space block from Continuous),compute the response of the Jacobian linearization starting from initial conditionδωe

(0) = 0 and δma(0) = 0, with the input δα(t) = β for for 6 values of β, β =

±0.01,±0.04,±0.1. Add the responses δωe(t) and δma

(t) to the equilibrium valuesωe, ma and plot these sums, which are approximations of the actual response.Compare the linearized response with the actual response from part 5e Commenton the difference between the results of the “true” nonlinear simulation and theresults from the linearized analysis. Note: do this for both the equilibrium points– at 22 m/s and at 32 m/s .

(g) Using Simulink, again starting from the equilibrium point computed in

part 5c apply a sinusoidal throttle angle of

α(t) = α + β sin(0.5t)

for 3 values of β, β = 0.01, 0.04, 0.1 and obtain the response for v and ma. Doan analogous simulation for the linearized system, and appropriately compare theresponses. Comment on the difference between the results of the “true” nonlinearsimulation and the results from the linearized analysis. Again, do this for bothcases.

6. In this problem, we will approximate the 2nd order linearization by a lower-order linearsystem.

(a) At v m/s, compute the equilibrium values, and write the linearized equation thatapproximately governs the deviation variables. Eveything should be a function ofv.

Page 15: 18 Jacobian Linearizations, equilibrium pointspack/me132/Section18.pdf · 18 Jacobian Linearizations, equilibrium points ... where f is a function mapping Rn £ Rm! ... is called

ME 132, Spring 2005, UC Berkeley, A. Packard 170

(b) Write the transfer function (from δu to δy) of the linearized car model at v m/s

(c) Decompose this transfer function into the form

G(s) =1

(τ1s + 1)

γ

(τ2s + 1)

where τ1 < τ2. Specifically, find the 2nd order polynomial (coefficients are func-tions of the equilibrium velocity, v) whose roots are −1

τ1and −1

τ2. Also, find the

expression (in terms of v) for γ. Hence, G is the cascade of two first-order systems:

• A system with steady-state gain 1, and time constant τ1

• A system with steady-state gain γ, and time constant τ2

Since τ1 < τ2, we will approximate G with

Gapp(s) :=γ

τ2s + 1

Note that G and Gapp depend on v.

(d) Plot γ, τ1 and τ2 as functions of v for 22 ≤ v ≤ 32.

7. In this problem, we will design a cruise-control system for the linearized model of thecar at arbitrary speed of v.

(a) Pick a value of v, say 26m/s. Design a PI controller, C for Gapp, which yieldsclosed-loop roots of the characteristic equation at ωn = 0.6, ξ = 1.1. Aroundthe equilibrium values, this controller will work well in generating the correctdeviation input δu(t) in order to regulate the deviation in velocity, δy, as shownbelow

C Gapp- - - -

6

i+

−δr(t)

δu(t)δy(t)

Here, δr is interpreted as a desired velocity deviation away from the equilibriumvalue of y.

(b) Since δr is the desired velocity deviation away from the equilibrium value of y, itmakes sense to interpret the actual velocity command r as r(t) = y+δr(t). So, thevelocity command is “near” y, but not necessarily equal to it. Therefore, we canimplement the control on the true nonlinear car/engine model, as shown below,with the equilibrium value of the throttle input shown adding to δu in order toget the correct input u.

CCar/

Engine- - - d -

6-

6

i+

−(y + δr =) r δu

u

u y (= y + δy)

Page 16: 18 Jacobian Linearizations, equilibrium pointspack/me132/Section18.pdf · 18 Jacobian Linearizations, equilibrium points ... where f is a function mapping Rn £ Rm! ... is called

ME 132, Spring 2005, UC Berkeley, A. Packard 171

We can generate the equilibrium input α simply by setting the initial value (ie.,initial condition, as the cruise-control is activated) of the integrator to be equalto α

KI

Car/Engine

KP

KI- -

-

?- - i - -

6

i+

−r u y

Starting from equilibrium initial conditions, in the car, and with the correct initialvalue on the controller integrator, simulate the closed-loop system for the followingdesired velocity input

-

6

¡¡¡¡¡¡ J

JJJJJJJ ¡

¡¡10 20 40

50 60 65

30

28

24

t

r(t)

(c) Notice that the undershoot at t = 50 appears to be from integrator windup. Plotz and α and verify that integrator windup has occurred.

(d) Implement an anti-windup scheme for the PI controller. The left end of thedeadzone should be 0, and the right end should be 1.4. Resimulate, and verifythat the antiwindup controller reduces the undershoot at t = 50.

(e) Using the antiwindup controller, do a family of simulations (say 50), randomlyvarying the car/engine parameters (c1, c2, ...Je,.. etc) by ±20%. Plot three vari-ables: the velocity response, the control input α, and the controller integrator sig-nal z. Note the robustness of the feedback system to variations in the car/enginebehavior. Also notice that the speed (v) is relatively insensitive to the parametervariations, but that the actual control input α is quite dependent on the varia-tions. This is the whole point of feedback control – make the regulated variableinsensitive to variations, through the use of feedback strategies which “automat-ically” cause the control variable to accomodate these variations.

8. A common actuator in industrial and construction equipment is a hydraulic device,called a hydraulic servo-valve. A diagram is below.

Page 17: 18 Jacobian Linearizations, equilibrium pointspack/me132/Section18.pdf · 18 Jacobian Linearizations, equilibrium points ... where f is a function mapping Rn £ Rm! ... is called

ME 132, Spring 2005, UC Berkeley, A. Packard 172

¢¢¢¢¢¢¢¢¢¢

¢¢¢¢¢¢¢¢¢¢

AAAAAAAAAA

AAAAAAAAAA

-h

p0 pS p0

p1 p2

-y

¢¢®A

AKq4 q1

AAU ¢¢

q2 q3

¾ Fe

Two resevoirs, one at high pressure, ps, called the supply, and one at low pressure, p0,called the drain. The small piston can be moved relatively easily, its position h(t) isconsidered an input. As is moves, its connects the supply/drain to opposite sides ofthe power piston, which causes significant pressure differences across the power piston,and causes it to move.

Constant Value

pS 1.4 × 107N/m2

p0 1 × 105N/m2

c1 0.02mc0 4 × 10−7m2

Ap 0.008m2

K 6.9 × 108N/m2

ρ 800kg/m3

L 1mcD 0.7mp 2.5kg

The volume in each cylinder is simply

V1(y) = Ap (L + y)V2(y) = Ap (L − y)

Page 18: 18 Jacobian Linearizations, equilibrium pointspack/me132/Section18.pdf · 18 Jacobian Linearizations, equilibrium points ... where f is a function mapping Rn £ Rm! ... is called

ME 132, Spring 2005, UC Berkeley, A. Packard 173

The mass flows areq1(t) = cDA1(h(t))

ρ (pS − p1(t))

q2(t) = cDA2(h(t))√

ρ (pS − p2(t))

q3(t) = cDA3(h(t))√

ρ (p2(t) − p0)

q4(t) = cDA4(h(t))√

ρ (p1(t) − p0)

The valve areas are all given by the same underlying function A(h),

A(h) =4.0 × 10−7 for h ≤ −0.00024.0 × 10−7 + 0.02(u + 0.0002) for −0.0002 < h < 0.0051.044 × 10−4 for 0.005 < h

By symmetry, we have A1(h) = A(−h);, A2(h) = A(h);, A3(h) = A(−h);, A4(h) =A(h). Mass continuity (with compressibility) gives

q1(t) − q4(t) = ρ[

p1(t)V1(y(t))1

K+ Apy(t)

]

and

q2(t) − q3(t) = ρ[

p2(t)V2(y(t))1

K− Apy(t)

]

Finally, Newton’s law on the power piston gives

mpy(t) = Ap (p1(t) − p2(t)) − Fe(t)

(a) Why can the small piston be moved easily?

(b) Define states x1 := p1, x2 := p2, x3 := y, x4 := y. Define inputs u1 := h, u2 := Fe.Define outputs y1 := y, y2 := y, y3 := y. Write state equations of the form

x(t) = f(x(t), u(t))y = g(x(t), u(t))

(c) Suppose that the power piston is attached to a mass M , which itself is also actedon by an external force w. This imposes the condition that Fe(t) = My(t)+w(t),where w is the external force acting on the mass. Substitute this in. The “inputs”to your system will now be h and w. Although it’s bad notation, call this pair u,with u1 = h, u2 = w. You will still have 4 state equations.

(d) Develop a Simulink model of the hydraulic servovalve, attached to a mass, M .Have y and y as outputs (used for feedback later), and h and w as inputs.

(e) Let y be any number satisfying −L < y < L. With the mass attached, computethe equilibrium values p1 and p2 such that

x :=

p1

p2

y0

, u :=

[

00

]

is an equilibrium point. Hint: The value of M should not affect your answers forp1 and p2

Page 19: 18 Jacobian Linearizations, equilibrium pointspack/me132/Section18.pdf · 18 Jacobian Linearizations, equilibrium points ... where f is a function mapping Rn £ Rm! ... is called

ME 132, Spring 2005, UC Berkeley, A. Packard 174

(f) Derive (by hand) the linearization of the system, at the equilibrium point. withu and w as the inputs. The matrices will be parametrized by all of the area, fluidparameters, as well as M and y. Make y the output.

(g) Ignoring the disturbance force w, compute the transfer function of the linearizedmodel from h to y. Denote this by Gy,M(s), since it depends on y and M . Let Mvary from 10kg to 10000kg, and let y vary from −0.8 to 0.8. Plot the Bode plotof the frequency-response function from h → y for at least 35 combinations of Mand y, namely 7 log-spaced values of M and 5 lin-spaced values of y. Place all onone plot.

(h) There are several simulations here. Consider two different cases with M = 30kgand separately M = 10000kg. Do short duration (Final Time is small, say 0.15)response with step inputs with h := 0.0001, w = 0, and h := 0.0004, w = 0, andh := 0.001, w = 0, and h := 0.004, w = 0, and h := 0.01, w = 0. The powerpiston should accelerate to the left. Plot the power-piston y(t), normalized (ie.,divided by) by the constant value of h. (You should have 10 plots on one sheet).Note, had the system been linear, (which it is not), after normalizing by the sizeof the step, the outputs would be identical, which they are not. Comment onthe differences as the the forcing function step size gets larger (more deviationfrom equilibrium input of h = 0). Hints: Be careful with maximum step size (inParameters window), using small sizes (start with 0.0001) as well as the simulationtime. Make sure that y(t) does not exceed L. Note that a dominant aspect of thebehavior is that y is the integral (with a negative scaling factor) of h.

(i) On one figure, using many different values for M and y, plot∣

Gy,M (jω) − G0,10000(jω)

G0,10000(jω)

versus ω, for ω in the range 0.01 ≤ ω ≤ 1000. This is a plot of percentage-variation

of the linearized model away from the linearized model G0,10000.

(j) On one figure, using many different values for M and y, plot∣

Gy,M (jω) − Gnom(jω)

Gnom(jω)

for ω in the range 0.01 ≤ ω ≤ 1000, using

Gnom :=−325

s

This is a plot of percentage-variation from Gnom.

(k) Using Gnom, design a proportional controller

h(t) = KP [r(t) − y(t)]

so that the nominal closed-loop time constant is 0.25. On the same plot as in part8j, plot the percentage variation margin. Do all of the variations lie underneaththe percentage variation margin curve?

Page 20: 18 Jacobian Linearizations, equilibrium pointspack/me132/Section18.pdf · 18 Jacobian Linearizations, equilibrium points ... where f is a function mapping Rn £ Rm! ... is called

ME 132, Spring 2005, UC Berkeley, A. Packard 175

(l) With the nominal closed-loop time constant set to 0.25, we know that Lnom hasmagnitude less than 1 for frequencies beyond about 4 rad/sec. We can reduce thegain of L even more beyond that without changing the dominant overall responseof the closed system, but we will improve the percentage variation margin. Keep-ing KP fixed from before, insert a first-order filter in the controller, so that (intransfer function form)

H =KP

τfs + 1[R − Y ]

Try using τf = 110

0.25. Again on the same plot as in part 8j, plot the newpercentage variation margin. Has the margin improved?

(m) Using this controller, along with the true nonlinear model, simulate the closed-loop system with 3 different reference signals, given by the (time/value) pairslisted below. Do this for three different values for M , namely 30, 2000, and 10000kg.

Time Case 1 Case 2 Case 30 0 0 01 0.05 0.25 0.753 0.05 0.25 0.755 -0.025 -0.125 -0.37510 -0.025 -0.125 -0.37512 0 0 014 0 0 0

Between points, the reference signal changes linearly, connecting the points withstraight lines. Plot the resulting trajectory y, along with r. Comment on theperformance of the closed-loop system.

9. In ??, we derived a complex model for a hydraulic servo-valve, taking compressibility ofthe hydraulic fluid into account. In this problem, we derive a model for incompressiblefluid, which is much simpler, and gives us a good, simplified, “starting point” modelfor the servovalve’s behavior. The picture is as before, but with ρ constant (though p1

and p2 are still functions of time – otherwise the piston would not move...).

(a) Assume that the forces from the environment are such that we always have p0 <p1(t) < ps and p0 < p2(t) < ps. Later, we will check what limits this imposeson the environment forces. Suppose that u > 0. Recall that flow into side 1 is

ch(t)√

ρ (ps − p1(t)), and flow out of side 2 is ch(t)√

ρ (p2(t) − p0), where is c issome constant reflecting the discharge coefficient, and the relationship betweenorifice area and spool displacement (h). Show that it must be that

ps + p0 = p1(t) + p2(t)

(b) Let ∆(t) := p1(t) − p2(t). Show that

p1(t) =ps + p0 + ∆(t)

2, p2(t) =

ps + p0 − ∆(t)

2

Page 21: 18 Jacobian Linearizations, equilibrium pointspack/me132/Section18.pdf · 18 Jacobian Linearizations, equilibrium points ... where f is a function mapping Rn £ Rm! ... is called

ME 132, Spring 2005, UC Berkeley, A. Packard 176

(c) Assuming that the mass of the piston is very small, show that

Ap∆(t) + FE(t) = 0

(d) Show that p0 < p1(t) < ps for all t if and only if

|FE(t)| ≤ Ap (ps − p0)

Show that this is also necessary and sufficient for p0 < p2(t) < ps to hold for all t.

(e) Show that the velocity of the piston y is given by

ρApy(t) = ch(t)

√ρ

[

ps − p0

2− ∆(t)

2

]

(f) Manipulate this into the form

y(t) =c

ρAp

h(t)

√ρ

[

ps − p0

2+

FE(t)

2Ap

]

(77)

Hence, the position of the piston y(t) is simply the integral of a nonlinear functionof the two “inputs,” h and FE.

(g) Go through the appropriate steps for the case h < 0 to derive the relationship inthat case.

(h) Suppose y and F are constants. Show that the “triple” (y, h = 0, F ) is an equi-librium point of the system described in equation (77).

(i) What is the linear differential equation governing the behavior near the equilib-rium point?

10. A satellite is in a planar orbit around the earth, with coordinates as shown below.

The equations of motion are

m [r(t) − r(t)ω(t)] = − Kr2(t)

m [ω(t) + 2r(t)ω(t)] = u(t)

Page 22: 18 Jacobian Linearizations, equilibrium pointspack/me132/Section18.pdf · 18 Jacobian Linearizations, equilibrium points ... where f is a function mapping Rn £ Rm! ... is called

ME 132, Spring 2005, UC Berkeley, A. Packard 177

where u is a force input provided by thrusters mounted in the tangential direction.Define states as x1 := r, x2 := r, x3 := ω.

(a) Define states for the system (with u as the input), and write down state equations.

(b) For a given value x3 = ω > 0, determine values for x1, x2, and u to give anequilibrium point.

(c) What is the physical interpretation of this particular equilibrium point?

(d) Calculate the linearization about the equilibrium point.

(e) Is the linearized system stable?

(f) Propose, derive, and fully explain a feedback control system which stabilizes thelinearized system. Document all steps, and mention any sensors (measurements)your control system will need to make.