This means that the sufficiency result would go through for any value of λ(T). Not surprisingly, therefore, the transversality condition (2.30) in the fixed-end-point case changes to
λ(T) =β, (2.75)
where β∈En is a vector of constants to be determined.
Indeed, one can show that (2.75) is also the necessary transversality condition for fixed point problems. With this observation, the maximum principle for fixed-end-point problems can be obtained by modifying (2.31) as follows: adding x(T) =k and removing λ(T) = Sx(x∗(T), T).
Likewise, the resulting TPBVP (2.32) can be modified correspondingly;
it will have initial and final values on the state variables, whereas both initial and terminal values for the adjoint variables are unspecified, i.e., λ(0) andλ(T) are constants to be determined.
In Exercises2.28and2.19, you are asked to solve the fixed-end-point problems given there.
2.5 Solving a TPBVP by Using Excel
A number of examples and exercises found throughout this book involve finding a numerical solution to a two-point boundary value problem (TP- BVP). In this section we will show how the GOAL SEEK function in Excel can be used for this purpose. We will solve the following example.
Example 2.8 Consider the problem:
max
J = 1
0 −1
2(x2+u2)dt subject to
˙
x=−x3+u, x(0) = 5. (2.76) Solution We form the Hamiltonian
H=−1
2(x2+u2) +λ(−x3+u),
58 2. The Maximum Principle: Continuous Time where the adjoint variable λsatisfies the equation
λ˙ =x+ 3x2λ, λ(1) = 0. (2.77) Sinceuis unconstrained, we setHu= 0 to obtainu∗ =λ.With this, the state equation (2.76) becomes
˙
x=−x3+λ, x(0) = 5. (2.78) Thus, the TPBVP is given by the system of equations (2.77) and (2.78).
A simple method to solve the TPBVP uses what is known as the shooting method, explained in the flowchart in Fig.2.6.
Guess
? STOP
No
Yes
Figure 2.6: The flowchart for Example2.8
We will use Excel functions to implement the shooting method. For this we discretize (2.77) and (2.78) by replacingdx/dt and dλ/dtby
x
t = x(t+t)−x(t)
t and λ
t = λ(t+t)−λ(t) t ,
respectively. Substitution of x/tfor ˙x in (2.78) and λ/tfor ˙λin (2.77) gives the discrete version of the TPBVP:
x(t+t) =x(t) + [−x(t)3+λ(t)]t, x(0) = 5, (2.79)
λ(t+t) =λ(t) + [x(t) + 3x(t)2λ(t)]t, λ(1) = 0. (2.80)
2.5. Solving a TPBVP by Using Excel 59 In order to solve these equations, open an empty spreadsheet, choose the unit of time to bet= 0.01,make a guess for the initial valueλ(0) to be, say −0.2,and make the entries in the cells of the spreadsheet as specified below:
Enter -0.2 in cell A1.
Enter 5 in cell B1.
Enter = A1 + (B1 + 3 ∗ (B1ˆ2)∗A1)∗ 0.01 in cell A2.
Enter = B1 + (-B1ˆ 3 + A1) ∗0.01 in cell B2.
Here we have entered the right-hand side of the difference equation (2.80) for t = 0 in cell A2 and the right-hand side of the difference equation (2.79) for t = 0 in cell B2. Note that λ(0) =−0.2 shown as the entry
−0.2 in cell A1 is merely a guess. The correct value will be determined by the use of the GOAL SEEK function.
Next highlight cells A2 and B2 and drag the combination down to row 101 of the spreadsheet. Using EDIT in the menu bar, select FILL DOWN. Thus, Excel will solve Eqs. (2.80) and (2.79) from t= 0 tot= 1 in steps oft= 0.01,and that solution will appear as entries in columns A and B of the spreadsheet, respectively. In other words, the guessed solution for λ(t) will appear in cells A1 to A101 and the corresponding solution forx(t) will appear in cells B1 to B101. To find the correct value forλ(0),use the GOAL SEEK function under TOOLS in the menu bar and make the following entries:
Set cell: A101.
To value: 0.
By changing cell: A1.
It finds the correct initial value for the adjoint variable as λ(0) =
−0.10437,which should appear in cell A1, and the correct ending value of the state variable asx(1) = 0.62395,which should appear in cell B101.
You will notice that the entry in cell A101 may not be exactly zero as instructed, although it will be very close to it. In our example, it is
−0.0007. By using the CHART function, the graphs of x∗(t) and λ(t) can be printed out by Excel as shown in Fig.2.7.
60 2. The Maximum Principle: Continuous Time
Figure 2.7: Solution of TPBVP by excel
As we discuss more complex problems involving control and state inequality constraints in Chaps.3and4, we will realize that the shooting method is no longer adequate to solve such problems. However, there is a large amount of literature devoted to computational methods for solving optimal control problems. While a detailed treatment of this topic is beyond the scope of this book, we suggest some references as well as a software in Chap.4, Sect.4.3.
Exercises for Chapter 2 E 2.1 Perform the following:
(a) In Example 2.2, showJ∗=−1/2.
(b) In Example 2.3, showJ∗= 0.
(c) In Example 2.4, showJ∗=−1/6.
(d) In Example 2.5, showJ∗=−1/6.
E 2.2 Complete Example 2.6 by writing the optimal x∗(t) in the form of integrals over the three intervals (0, t1),(t1, t2), and (t2,2) shown in Fig.2.5.
Exercises for Chapter 2 61 Hint: It is not necessary to actually carry out the numerical evaluation of these integrals unless you are ambitious.
E 2.3 Find the optimal solution for Example2.1withx0 = 0 andT = 1.
E 2.4 Rework Example2.6 withF = 2x−3u.
E 2.5 Show that both the Lagrange and Mayer forms of the optimal control problem can be reduced to the linear Mayer form (2.5).
E 2.6 Show that the optimal control obtained from the application of the maximum principle satisfies the principle of optimality: ifu∗(t) is an optimal control andx∗(t) is the corresponding optimal path for 0≤t≤T withx(0) =x0,then verify the above proposition by showing thatu∗(t) forτ ≤t≤T satisfies the maximum principle for the problem beginning at time τ with the initial condition x(τ) =x∗(τ).
E 2.7 Provide an alternative derivation of the adjoint equation in Sect.2.2.2by starting with a restatement of the Eq. (2.19) as −Vt=H0 and differentiating it with respect tox.
E 2.8 In Example 2.4, show that in view of (2.47) any λ(t), t ∈ [0,1], that satisfies (2.50) must be nonnegative.
E 2.9 The system defined in (2.4) is termed autonomousif F, f, S and Ω are not explicit functions of time t.In this case, show that the Hamil- tonian is constant along the optimal path, i.e., show that dH/dt = 0.
Furthermore, verify this result in Example 2.4 by a direct substitution forx and λfrom (2.51) and (2.52), respectively, into H given in (2.48).
E 2.10 In Example 2.4, verify by direct calculation that with a new initial valuex(0) = 1+εwithεsmall, the new optimal objective function value will be
J(1+∗ ε)=−1/6 +λ(0)ε+o(ε) =−1/6−ε/2−ε2/2.
E 2.11 In Example2.6, verify by direct calculation that with a new ini- tialx(0) = 5 +εwithεsmall, the objective function value will change by
λ(0)ε+o(ε) = 2(e2−1)ε+o(ε).
62 2. The Maximum Principle: Continuous Time E 2.12 Obtain the value functionV(x, t) explicitly in Example2.4and verify the relation Vx(x∗(t), t) = λ(t) for the example by showing that Vx(1−t, t) =−(1/2)t2+t−1/2.
E 2.13 Obtain the value function V(x, t) explicitly in Example 2.5 for every x∈E1 and t∈[0,2].
Hint: You need to deal with the following cases for t∈[0,2]:
(i) 0≤x≤2−t, (ii) x >2−t,
(iii) t−2≤x <0,and (iv) x < t−2.
E 2.14 ObtainV(x, t) in Example2.6for small positive and negativex for t ∈[t2,2].Then, show that Vx(x, t) = 2(e2−t−1), t ∈[t2,2],is the same asλ(t), t∈[t2,2] obtained in Example 2.6.
E 2.15 Solve the problem:
max
J = T
0 (xưu2 2 )dt
subject to
˙
x=u, x(0) =x0, u∈[0,1],
for optimal control and optimal state trajectory. Verify that your solu- tion is optimal by using the maximum principle sufficiency condition.
E 2.16 Solve completely the problem:
max 1
0 (x+u)dt
˙
x= 1−u2, x(0) = 1;
that is, findx∗(t), u∗(t) andλ(t),0≤t≤1.
Exercises for Chapter 2 63 E 2.17 Use the maximum principle to solve the following problem given in the Mayer form:
max[8x1(18) + 4x2(18)]
subject to
˙
x1 =x1+x2+u, x1(0) = 15,
˙
x2 = 2x1−u, x2(0) = 20, and the control constraint
0≤u≤1.
Hint: Use the method in Appendix A to solve the simultaneous differ- ential equations.
E 2.18 In Fig.2.8, a water reservoir being used for the purpose of fire- fighting is leaking, and its water height x(t) is governed by
˙
x=−0.1x+u, x(0) = 10,
where u(t) denotes the net inflow at time tand 0≤u≤3.
Note thatx(t) also represents the water pressure in appropriate units.
Since high water pressure is useful for fire-fighting, the objective function in (a) below involves keeping the average pressure high, while that in (b) involves building up a high pressure atT = 100.Furthermore, we do not need to impose the state constraints 0≤x(t)≤50,as these will always be satisfied for every feasible control u(t), 0≤t≤100.
Figure 2.8: Water reservoir of Exercise2.18 (a) Find the optimal control which maximizes
J = 100
0 xdt.
Find the maximum level reached.
64 2. The Maximum Principle: Continuous Time (b) Replace the objective function in (a) by
J = 5x(100), and re-solve the problem.
(c) Redo the problem withJ =100
0 (x−5u)dt.
E 2.19 Consider the following fixed-end-point problem:
maxu
J =−
T
0 (g(x) +cu2)dt
subject to
˙
x=f(x) +b(x)u, x(0) =x0, x(T) = 0,
where functionsg≥0, f,and bare assumed to be continuously differen- tiable. Derive the two-point boundary value problem (TPBVP) satisfied by the optimal state and control trajectories.
E 2.20 A Machine Maintenance Problem. Consider the machine state dynamics
˙
x=−δx+u, x(0) =x0 >0,
whereδ >0 is the rate of deterioration of the machine state anduis the rate of machine maintenance. Find the optimal maintenance rate:
max
J = T
0 eưρt(πxưu2
2 )dt+e−ρTSx(T)
,
whereπ >0 withπxrepresenting the profit rate when the machine state is x, u2/2 is the cost of maintaining the machine at rate u, ρ >0 is the discount rate, T is the time horizon, and S > 0 is the salvage value of the machine for each unit of the machine state at time T. Furthermore, show that the optimal maintenance rate decreases, increases, or remains constant over time depending on whether the difference S−π/(ρ+δ) is negative, positive, or zero, respectively.
E 2.21 Transform the machine maintenance problem of Exercise 2.20 into Mayer Form. Then solve it to obtain the optimal maintenance rate.
E 2.22 Regional Allocation of Investment. Let Ki, i= 1,2,denote the capital stock in Regioni. Letbi be the productivity of capital andsi be
Exercises for Chapter 2 65 the marginal propensity to save in Region i.Since the investment funds for the two regions come from the savings in the whole economy, we have
K˙1+ ˙K2=b1s1K1+b2s2K2 =g1K1+g2K2,
where gi=bisi.Letu denote the control variable representing the frac- tion of investment allocated to Region 1 with the remainder going to Region 2. Clearly,
0≤u≤1, (2.81)
and
K˙1 = u(g1K1+g2K2), K1(0) =a1>0, (2.82) K˙2 = (1−u)(g1K1+g2K2), K2(0) =a2 >0. (2.83) The optimal control problem is to maximize the productivity of the whole economy at time T. Thus, the objective is:
max{J =b1K1(T) +b2K2(T)} subject to (2.81), (2.82), and (2.83).
(a) Use the maximum principle to derive the form of the optimal policy.
(b) Assume b2 > b1. Show that u∗(t) = 0 for t ∈ [ˆt, T], where ˆt is a switching point and 0≤ˆt < T.
(c) If you are ambitious, find the ˆt of part (b).
E 2.23 Investment Allocation. Let K denote the capital stock and λK its output rate with λ > 0. For simplicity in notation, we set the pro- ductivity factorλ= 1.Letu denote the invested fraction of the output.
Then,uK is the investment rate and (1−u)K is the consumption rate.
Let us assume an exponential utility 1−e−C of consumption C. Solve the resulting optimal control problem:
max
J = T
0 [1−e−(1−u(t))K(t)]dt
subject to
K(t) =˙ u(t)K(t), K(0) =K0, K(T) free, 0≤u(t)≤1, 0≤t≤T.
Assume T >1 and 0< K0<1−e1−T.Obtain explicitly the optimal in- vestment allocationu∗(t),optimal capitalK∗(t),and the adjoint variable λ(t), 0≤t≤T.
66 2. The Maximum Principle: Continuous Time E 2.24 The rate at which a new product can be sold at any time t is f(p(t))g(Q(t)) where p is the price and Q is cumulative sales. We assume f(p) < 0; sales vary inversely with price. Also g(Q) ≷ 0 for Q≶Q1,respectively, whereQ1 >0 is a constant known as the saturation level. For a given price, current sales grow with past sales in the early stages as people learn about the good from past purchasers. But as cumulative sales increase, there is a decline in the number of people who have not yet purchased the good. Eventually the sales rate for any given price falls, as the market becomes saturated. The unit production costc may be constant or may decline with cumulative sales if the firm learns how to produce less expensively with experience: c =c(Q), c(Q) ≤ 0.
Formulate and solve the optimal control problem in order to characterize the price policy p(t), 0 ≤ t ≤ T, that maximizes profits from this new
“fad” over a fixed horizonT. Specifically, show that in marketing a new product, its optimal price rises while the market expands to its saturation level and falls as the market matures beyond the saturation level.
E 2.25 SupposeH(x, u, λ, t) =λux−12u2 and Ω(t) = [0,1] for all t.
(a) Show that the form of the optimal control is given by the function
u∗(x, λ) = sat[0,1;λx] =
⎧⎪
⎪⎪
⎪⎪
⎨
⎪⎪
⎪⎪
⎪⎩
λx if 0≤λx≤1, 1 if λx >1, 0 if λx <0.
(b) Verify that (2.63) holds for all values of x and λ.
E 2.26 Show that the derived HamiltoniansH0 found in Examples2.4 and 2.6satisfy the concavity condition required for the sufficiency result in Sect.2.4.
E 2.27 If F and f are concave in x and u and if λ(t) ≥ 0, then show that the derived HamiltonianH0is concave inx.Note that the concavity of F and f are easier to check than the concavity of H0 as required in Theorem2.1 on sufficiency conditions.
E 2.28 A simple controlled dynamical system is modeled by the scalar equation
˙
x=x+u.
Exercises for Chapter 2 67 The fixed-end-point optimal control problem consists in steering x(t) from an initial state x(0) =x0 to the targetx(1) = 0,such that
J(u) = 1 4
1
0 u4dt
is minimized. Use the maximum principle to show that the optimal control is given by
u∗(t) = 4x0
3 (e−4/3−1)−1e−t/3. E 2.29 Perform the following:
(a) Solve the optimal consumption problem of Example 1.3 with U(C) = lnC and B = 0.
Hint: Since C(t)≥0,we can replace the state constraint W(t)≥0, t∈ [0, T],by the terminal condition W(T) = 0, and then use the transver- sality condition given in (2.75).
(b) Find the rate of change of optimal consumption over time and conclude that consumption remains constant whenr =ρ,increases when r > ρ,and decreases when r < ρ.
E 2.30 Perform the following:
(a) Formulate the TPBVP (2.32) and its discrete version for the prob- lem in Example 2.8, but with a new initial condition x(0) = 1.
(b) Solve the discrete version of the TPBVP by using Excel.
E 2.31 Solve explicitly max
J =−
2
0 x(t)dt
subject to
˙
x(t) =u(t), x(0) = 1, x(2) = 0,
−a ≤ u(t)≤b, a >1/2, b >0.
Obtain optimal x∗(t), u∗(t),and all required multipliers.
Chapter 3
The Maximum Principle: