Chapter 6: Solutions to Exercises

Needs["Graphics`MultipleListPlot`"]

Needs["Graphics`PlotField`"]

Question 1

The stages of production are as follows:

(i) Solution paths are:
	ABDGJ = 3 + 8 + 4 + 3 = 18
	ABDHJ = 3 + 8 + 7 + 2 = 20
	ABEHJ = 3 + 2 + 5 + 2 = 12
	ACEHJ = 4 + 3 + 5 + 2 = 14
	ACFHJ = 4 + 4 + 8 + 2 = 18
	ACFIJ = 4 + 4 + 9 + 7 = 24
	
	Minimum is ABEHJ = 12

(ii) Backward solving we have path JHEBA, which implies path ABEHJ = 12. Backward solving gives the same path as minimising the route through the system.

(iii) Given minimising all possible solutions for solving forward is the same as backward solving, which involves only one path, then by occam's law, backward solving is the more efficient, requring as it does far less computations.

Question 2

We need to prove,
	\(TraditionalForm
      \`\(-\(∫\_t\_0\%t\_1 λ\ \(x\& . \) 
              dt\)\) = 
        ∫\_t\_0\%t\_1 x \( λ\& . \) dt - 
          \([\(λ(t\_1)\) \(x(t\_1)\) - 
              \(λ(t\_0)\) \(x(t\_0)\)\)\)
	
As a preliminary, we note the following,
	d(u v)  =  u dv  +  v duu dv  =  d(u v)  - v du
Then
	\(TraditionalForm
      \`∫u dv = 
        ∫d\((uv)\) - 
          ∫v du + c\)

where c is the constant of integration. Rearranging,
	\(TraditionalForm
      \`∫u dv = 
        u\ v - ∫v du + c\)

Now let u = λ and v = x, then

	\(TraditionalForm
      \`∫\_t\_0\%t\_1 λ dx = 
        \(\([λ\ x]\)\_t\_0\%t\_1 - 
              ∫\_t\_0\%t\_1 x dλ


                  \(∫\_t\_0\%t\_1\((dx\/dt)\) 
                      dt\) == 
            \([λ\ x]\)\_t\_0\%t\_1 - 
              ∫\_t\_0\%t\_1\( x(dλ\/dt)\) 
                  dt


                  \(∫\_t\_0\%t\_1 λ \( x\& . \) 
                      dt\) = 
          \([\(λ(t\_1)\) \(x(t\_1)\) - 
                \(λ(t\_0)\) \(x(t\_0)\)]\) - 
            ∫\_t\_0\%t\_1 x \( λ\& . \) 
                dt\)\)
i.e.,
	\(TraditionalForm
      \`\(-\(∫\_t\_0\%t\_1 x \( λ\& . \) 
              dt\)\) = 
        ∫\_t\_0\%t\_1 λ \( x\& . \) dt - 
          \([\(λ(t\_1)\) \(x(t\_1)\) - 
              \(λ(t\_0)\) \(x(t\_0)\)]\)\)

Questions 3-6

These questions are undoubtedly easier using a spreadsheet. Here we shall just provide the data results for production and plot them.

Question 3

The original data series for p = 3,  b = 2,  and R = 600 are:

data30a = {{0, 88.7340}, {1, 82.2227}, {2, 75.6730}, {3, 
            69.0778}, {4, 62.4288}, {5, 55.7158}, {6, 48.9284}, {7, 
            42.0686},  {8, 35.2270},  {9, 29.9430}, {10, 
            9.9810}};

data30b = {{0, 182.2311}, {1, 127.7821}, {2, 89.6879}, {3, 
            63.0426}, {4, 44.4111}, {5, 31.3875}, {6, 22.2854}, {7, 
            15.9233}, {8, 11.4924}, {9, 8.8175}, {10, 2.9392}};

MultipleListPlot[data30a, data30b, PlotJoined -> True, 
        AxesLabel -> {"Period", "Production"}, 
        PlotLabel -> "p=3, b=2, R=600 \n"];

(i)

(a) p = 6,  b = 2 and R  = 600. The first data series involves no discounting; the second discounting with a discount rate of 10%. For some series adjustment was made to the final figures to prevent the reserves remaining becoming negative.

data31a = {{0, 83.3410}, {1, 77.5911}, {2, 71.8110}, {3, 
            65.9958}, {4,  60.1390}, {5, 54.2327}, {6, 48.2679}, {7, 
            42.2361}, {8, 36.1444}, {9, 60.2406}, {10, 0}};

data31b = {{0, 274.1076}, {1, 148.9059},  {2, 80.8938}, {3, 
            43.9485}, {4, 23.8794}, {5, 12.9780}, {6, 7.0567}, {7, 
            3.8408}, {8, 2.0947}, {9, 2.9492}, {10, 0}};

MultipleListPlot[data30a, data31a, PlotJoined -> True, 
        AxesLabel -> {"Period", "Production"}];

MultipleListPlot[data30b, data31b, PlotJoined -> True, 
        AxesLabel -> {"Period", "Production"}];

(b) p = 3,  b = 3 and R  = 600. The first data series involves no discounting; the second discounting with a discount rate of 10%. For some series adjustment was made to the final figures to prevent the reserves remaining becoming negative.

data32a = {{0, 83.3410}, {1, 77.5911}, {2, 71.8110}, {3, 
            65.9958}, {4,  60.1390}, {5, 54.2327}, {6, 48.2679}, {7, 
            42.2361}, {8, 36.1444}, {9, 30.1203}, {10, 
            30.1203}};

data32b = {{0, 142.9371}, {1, 110.2075},  {2, 85.0925}, {3, 
            65.8278}, {4, 51.0562}, {5, 39.7313}, {6, 31.0455}, {7, 
            24.3680}, {8, 19.2157}, {9, 15.2595}, {10, 
            15.2595}};

MultipleListPlot[data30a, data32a, PlotJoined -> True, 
        AxesLabel -> {"Period", "Production"}];

MultipleListPlot[data30b, data32b, PlotJoined -> True, 
        AxesLabel -> {"Period", "Production"}];

(b) p = 3,  b = 3 and R  = 800. The first data series involves no discounting; the second discounting with a discount rate of 10%. For some series adjustment was made to the final figures to prevent the reserves remaining becoming negative.

data33a = {{0, 118.3120}, {1, 109.6303}, {2, 100.8973}, {3, 
            92.1038}, {4,  83.2384}, {5, 74.2875}, {6, 65.2379}, {7, 
            56.0914}, {8, 46.9694}, {9, 39.9240}, {10, 
            13.3080}};

data33b = {{0, 242.9748}, {1, 170.3762},  {2, 119.5839}, {3, 
            84.0567}, {4, 59.2148}, {5, 41.8500}, {6, 29.7139}, {7, 
            21.2310}, {8, 15.3232}, {9, 11.7566}, {10, 3.9189}};

MultipleListPlot[data30a, data33a, PlotJoined -> True, 
        AxesLabel -> {"Period", "Production"}];

MultipleListPlot[data30b, data33b, PlotJoined -> True, 
        AxesLabel -> {"Period", "Production"}];

(ii) We can summarise the results as follows.
(a) A rise in the price from p = 3 to p = 6 leads to smaller output in earlier periods and a larger output in later periods in the case of no discounting. Where discounting is taken into account, however, output in the first two periods is higher, and lower thereafter.
(b) A rise in the value of b from b = 2 to b = 3 leads to output sometimes rising and sometimes falling in the case of no discounting. Where discounting is taken into account, however, output is only down for the first three periods, and then exceeds that for b = 2.
(c) A rise in reserves from R = 600 to R = 800 leads to a rise in output in all periods under both no discounting and discounting.

Question 4

At 5%, 10% and 15% discount rate the production levels are given in the following datasets.

data41 = {{0, 144.9972}, {1, 112.2344}, {2, 86.9524},  {3,  
            67.4342},  {4,  52.3510},  {5,  40.6720},  {6,  
            31.5953},  {7,  24.4981},  {8,  18.9316},  {9, 
            15.2505},  {10, 5.0835}};

data42 = {{0, 182.2311}, {1, 127.7822}, {2, 89.6879},  {3,  
            63.0425},  {4,  44.4111},  {5,  31.3875},  {6,  
            22.2854},  {7,  15.9233},  {8,  11.4924},  {9, 
            8.8174},  {10, 2.9391}};

data43 = {{0, 209.2795}, {1, 136.6734}, {2, 89.3149},  {3,  
            58.4330},  {4,  38.3046},  {5,  25.1957},  {6,  
            16.6697},  {7,  11.1379},  {8,  7.5771},  {9, 
            5.5606},  {10, 1.8535}};

MultipleListPlot[data41, data42, data43,  
        AxesLabel -> {"Period", "Production"}, PlotJoined -> True,  
        PlotLabel -> "Alternative production \n schedules \n"];

It is clear that as the discount rate rises, the level of production in the earlier period rises also. However, after period 3 production is higher the lower the discount rate.

Question 5

If inflation is expected to be 5% per period, then in the case of no discounting we can derive the following adjusted production data. Adjustment insures that production cannot be negative and reserves cannot be negative.

data51 = {{0, 0}, {1, 0}, {2, 0},  {3,  16.6950}, {4, 
            43.1482}, {5,  68.9824}, {6,  91.6339},  {7, 108.3527}, {8, 
            116.9442}, {9, 154.2434}, {10, 0}};

For 10% discounting along with 5% inflation, we have:

data52 = {{0, 129.7255}, {1, 106.2021},  {2,  86.3437},  {3,  
            69.7224},  {4,  55.9306},  {5,  44.5842},  {6,  
            35.3244},  {7,  27.8250},  {8,  21.8500},  {9,  
            22.4918},  {10, 0}};

MultipleListPlot[data51, data52,  
        AxesLabel -> {"Period", "Production"}, PlotJoined -> True,  
        PlotLabel -> "5% Inflation \n"];

Question 6

Here we consider once again example 6.4 in which there is no discounting. Price inflation is assumed to be 10% while cost inflation is assumed to be higher at 15%. The resulting production pather is as follows.

data6 = {{0, 0}, {1, 0},  {2, 4.3956},  {3,  40.7261},  {4, 
            68.9457},  {5,  86.7813},  {6,  93.8662},  {7,  
            91.3416},  {8, 81.3512},  {9, 66.6550},  {10, 
            65.9372}};

ListPlot[data6,  AxesLabel -> {"Period", "Production"}, 
        PlotJoined -> True,  
        PlotLabel -> "10% Price inflation \n and \n 15% Cost Inflation \n\
"];

Question 7

First we specify the vote function v = v(u, π), which is to be maximised over the period 0 to 5. This function is weighted by the factor (e^( .05  t)). Our control problem is then,
	\(TraditionalForm\`Maximise\ \(∫\_0\%5\( e\^\( .05  t\)\) \(v(u, π)\) dt\)\)
s . 
          t .      π = -α(u - (Subscript[u, n])) + (π^e)
          d(π^e)/
          dt = β(π - (π^e))
        π(
          0) = (Subscript[π, 0])     π(5) free
where (Subscript[π, 0]) is the initial rate of inflation, which is assumed known.

Question 8

Clear[x, u, λ]

The Hamiltonian is given by
	H = -(((x^2)/4) - 
                ((u^2)/9)) + λ(-x + u)

D[-(((x^2)/4) - ((u^2)/9)) + λ (-x + u), 
      u]

D[-(((x^2)/4) - ((u^2)/9)) + λ (-x + u), 
      x]

Solve[((2 u)/9) + λ == 0, u]

-x + u  /. u -> -((9 λ)/2)

Our two differential equations are therefore
	x'[t] = -x - ((9 λ)/2)
λ'[t] = (x/2) + λ

Solve[-x - ((9 λ)/2) == 0, λ]

Solve[(x/2) + λ == 0, λ]

DSolve[{x'[
            t] == -x[t] - ((9  λ[t])/2), λ'[
            t] == x[t]/2 + λ[t]}, {x[t], λ[t]}, 
      t]

(1/5) (5 C[1] Cos[(((Sqrt[5]) t)/2)] - 
            2 (Sqrt[5]) C[1] Sin[(((Sqrt[5]) t)/2)] - 
            9 (Sqrt[5]) C[2] Sin[(((Sqrt[5]) t)/2)])  /. t -> 0

(1/5) (5 C[1] Cos[(((Sqrt[5]) t)/2)] - 
            2 (Sqrt[5]) C[1] Sin[(((Sqrt[5]) t)/2)] - 
            9 (Sqrt[5]) C[2] Sin[(((Sqrt[5]) t)/2)])   /. t -> 1

NSolve[{5 == C[1], 
        10 == (1/5) (5 C[1] Cos[((Sqrt[5])/2)] - 2 (Sqrt[5]) C[1] Sin[((Sqrt[5])/2)] - 
                9 (Sqrt[5]) C[2] Sin[((Sqrt[5])/2)])}, {C[1], C[2]}]

(1/5) (5 C[2] Cos[(((Sqrt[5]) t)/2)] + (Sqrt[5]) C[1] Sin[(((Sqrt[5]) t)/2)] + 
            2 (Sqrt[5]) C[2] Sin[(((Sqrt[5]) t)/2)])  /. t -> 0

So λ(0) = -3.2697.

solx = 
      (1/5) (5 C[1] Cos[(((Sqrt[5]) t)/2)] - 
              2 (Sqrt[5]) C[1] Sin[(((Sqrt[5]) t)/2)] - 
              9 (Sqrt[5]) C[2] Sin[(((Sqrt[5]) t)/2)])  /. {C[1] -> 5, 
          C[2] -> -3.2697}

solλ = 
      (1/5) (5 C[2] Cos[(((Sqrt[5]) t)/2)] + (Sqrt[5]) C[1] Sin[(((Sqrt[5]) t)/2)] + 
              2 (Sqrt[5]) C[2] Sin[(((Sqrt[5]) t)/2)])  /.  {C[1] -> 5, 
          C[2] -> -3.2697}

eq8 = {x'[
            t] == -x[t] - ((9  λ[t])/2), λ'[
            t] == x[t]/2 + λ[t], 
        x[0] == 5, λ[0] == -3.2697}

var8 = {x[t], λ[t]}

arrows8 = 
        PlotVectorField[{-x - ((9  λ)/2), (x/2) + λ}, {x, 
            0, 10}, {λ, -5, 0}, Axes -> True, 
          AxesLabel -> {"x", "λ"}, 
          DisplayFunction -> Identity];

lines8 = 
        Plot[{-((2  x)/9), -(x/2)}, {x, 0, 10}, 
          PlotRange -> {-5, 0}, 
          DisplayFunction -> Identity];

sol8 = NDSolve[eq8, var8, {t, 0, 1}]

traj8 = 
        ParametricPlot[Evaluate[{x[t], λ[t]}  /. sol8], {t, 0, 1}, 
          PlotStyle -> (Thickness[0.007]), 
          DisplayFunction -> Identity];

Show[arrows8, traj8, lines8, 
        DisplayFunction -> $DisplayFunction];

Question 9

Clear[x, u, λ]

The Hamiltonian is given by
	H = 3  (x^2) - (u^2) + λ(2  x + u)

D[3  (x^2) - (u^2) + λ (2  x + u), u]

D[3  (x^2) - (u^2) + λ (2  x + u), x]

Solve[-2 u + λ == 0, u]

2  x + u  /.  u -> (λ/2)

-6 x - 2  λ  /. u -> (λ/2)

sol = 
      DSolve[{x'[t] == 
            2  x[t] + λ[t]/2, λ'[
              t] == -6 x[t] - 2  λ[t]}, {x[t], λ[
            t]}, t]

sol  /. t -> 0

sol  /. t -> 1

NSolve[{C[1] == 
          10, ((-2 C[1] + 6 (E^2) C[1] - C[2] + (E^2) C[2])/(4 E)) == 15}, {C[1], 
        C[2]}]

So λ(0) = -40.7332.

eq9 = {x'[t] == 
          2  x[t] + λ[t]/2, λ'[t] == -6 x[t] - 
            2  λ[t], 
        x[0] == 10, λ[0] == -40.7332}

var9 = {x[t], λ[t]}

arrows9 = 
        PlotVectorField[{2  x + (λ/2), -6 x - 2  λ}, {x, 
            0, 15}, {λ, -50, 0}, AspectRatio -> 1.2, 
          Axes -> True, AxesLabel -> {"x", "λ"}, 
          DisplayFunction -> Identity];

sol9 = NDSolve[eq9, var9, {t, 0, 1}]

traj9 = 
        ParametricPlot[Evaluate[{x[t], λ[t]}  /. sol9], {t, 0, 1}, 
          PlotStyle -> (Thickness[0.007]), 
          DisplayFunction -> Identity];

lines9 = 
        Plot[{-4 x, -3 x}, {x, 0, 15}, 
          DisplayFunction -> Identity];

Show[{arrows9, traj9, lines9}, 
        PlotRange -> {{0, 15}, {-50, 0}}, 
        DisplayFunction -> $DisplayFunction];

Question 10

From the text we know that
	\(TraditionalForm\`c' \((t)\) = \(\((\ f\ ' \((k)\) - δ + β)\) c\)\/\(σ(c)\)\)
k' (t) = f(k) - (n + δ) k - c
Substituting we obtain
	c' (t) = ( .4  (k^(-0.7)) - 0.1067) c
k' (t) = (k^0.3) - 0.05  k - c
In finding equilibrium values avoid solving the simultaneous equations, since the programme takes a long time. Rather use the FindRoot

FindRoot[{0.4  (k^(-0.7)) - 0.1067 == 0, 
        (k^0.3) - 0.05  k - c == 0}, {k, 1}, {c, 1}]

i.e., \(TraditionalForm\`\(k\^*\) = 6.6047\) and \(TraditionalForm\`\(c\^*\) = 1.4316\).
Next we need to linearize the system around \(TraditionalForm\`\((\(k\^*\), \(c\^*\))\) = \((6.6047, 1.4316)\)\).
Let

Clear[f, k, fc, fk, gc, gk]

f[c_, k_] := (0.4  (k^(-0.7)) - 0.1067) c

g[c_, k_] := (k^0.3) - 0.05  k - c

fc = D[f[c, k], c]

fk = D[f[c, k], k]

gc = D[g[c, k], c]

gk = D[g[c, k], k]

fc  /.  {c -> 1.4316,  k -> 6.6047}

fk   /.  {c -> 1.4316,  k -> 6.6047}

gc  /.  {c -> 1.4316,  k -> 6.6047}

gk  /.  {c -> 1.4316,  k -> 6.6047}

mA := {{-3.919045686723299`*^-7, -0.01618935171386946`}, {-1, 0.030024706071573495`}}

mA  // MatrixForm

Eigenvalues[mA]

Since these are opposite in sign, then the equilibrium is a saddle-point solution.