Lmwhitfieldpdf
Lmwhitfieldpdf
The aim of this work, is to develop a numerical model, that could be used to
in the calculation of optimal life cycle strategies of given organisms. The theory
used from [6] assumes that the organisims have either a two phase 'bang-bang`
life cycle strategy or a three phase life cycle strategy with the second phase being
a singular arc.
Contents
1 Introduction 1
1.1 What is Optimal Control Theory? : : : : : : : : : : : : : : : : : : 1
1.2 Life Cycle Strategies : : : : : : : : : : : : : : : : : : : : : : : : : 2
3 Biological Problem 14
3.1 Notation : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 14
3.2 Biological Problem : : : : : : : : : : : : : : : : : : : : : : : : : : 15
3.3 Two phase solution : : : : : : : : : : : : : : : : : : : : : : : : : : 16
3.3.1 Finding a two phase solution : : : : : : : : : : : : : : : : : 17
3.4 Three phase solution : : : : : : : : : : : : : : : : : : : : : : : : : 20
3.4.1 Finding a three phase solution : : : : : : : : : : : : : : : : 21
i
4.3 Ways of nding optimal solutions : : : : : : : : : : : : : : : : : : 29
4.3.1 Projected gradient method : : : : : : : : : : : : : : : : : : 30
4.3.2 Conditional gradient method : : : : : : : : : : : : : : : : : 31
5 Numerical Results 34
5.1 The E ects of Initial Data : : : : : : : : : : : : : : : : : : : : : : 34
5.2 Testing Optimality : : : : : : : : : : : : : : : : : : : : : : : : : : 35
5.3 Convergence : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 36
5.4 Moving the Initial Switching Point : : : : : : : : : : : : : : : : : 37
5.5 Changing the Step Length in the Gradient Direction : : : : : : : 40
6 Conclusions 43
Acknowledgements 45
Bibliography 46
1
Chapter 1
Introduction
The aim of this work is to develop a numerical method, which will nd the optimal
allocation of resources between growth and reproduction for a given organism and,
hence, an organism's optimal life cycle strategy. A brief introduction to optimal
control theory and life cycle strategies is given here. In addition an overview of
the project's content and it's organisation is included.
Optimal control theory arises from the consideration of physical systems, which
are required to achieve a de nite objective as \cheaply" as possible. The trans-
lation of the design objectives into a mathematical model gives rise to what is
known as the control problem. The essential elements of a control problem are:-
A system objective
The system objective is a given state or set of states which may vary with
time. Restrictions or constraints, as they are normally called, are placed on the
set of controls (inputs) to the system; controls satisfying these constraints are said
to belong to the set of admissible controls. A formal de nition of the optimal
control problem and associated theory of Pontryagin's principle is looked at in
chapter two.
2
The idea of nding the optimal allocation of resources between growth and re-
production is the motivation behind this work. The aim is to develop a numerical
method for the optimisation problem.
The work begins by looking at the optimal control problem and Pontryagin's
Maximum principle before moving on to look at the biological problem and it's
analytical solution in greater detail. The numerical method for this problem is
then developed in chapter four. The method begins by solving the state and
adjoint equations for an arbitrary control , before looking at ways of making the
u
3
Chapter 2
Optimal Control Theory
The optimal control problem can be formulated as the nding of the control vari-
ables ( ) (j=1,...n) and state variables ( ) (i=1,...m) satisfying the di erential
uj t xi t
equation
_= (
xi fi x; u; t ; )
with end conditions ( 0 ) = 0 , 0 speci ed, such that a particular control vector
x t x t
u =(
u1 ; :::un ) and state vector = (
T
x x1 ; :::xm ) minimises or maximises the cost
T
functional.
Z T
J = ( ( ) )+
x T ;T ( )
F x; u; t dt:
t0
The admissible controls for this problem are in fact piecewise continuous functions
with a nite number of jump discontinuities on the interval [ 0 ]. The functions t ;T
4
2.1 Pontryagin's Principle
Pontryagin's principle was developed to deal with control problems where the
variables were subject to magnitude constraints of the form:- j ( ) j . This ui t ki
implies that the set of nal states which can be achieved is limited. The assump-
tions made about , u F and f when de ning the optimal control problem are
assumed to hold for the , u F and of Pontryagin's Principle.
f
subject to
_= (
x f x; u; t ) (0) =
x x0 (2 2)
:
_=
@H
(adj oint equation ) (2 3)
:
@x
( )=
T
@
@x
( transversality condition ) (2 4)
:
T
and that
(
H x ; u; ; t
) (
H x ;u ; ;t
) (2 5)
:
for all admissible controls satisfying the constraints, where H is the Hamiltonian
u
function de ned as
(
H x; u; ; t )= ( F x; u; t )+ T
(
f x; u; t : ) (2 6)
:
u
is assumed to piecewise continuous, and satis es the constraints.
5
In time dependent problems Pontryagins principle can be used to determine either
a minimum or a maximum of the functional J(u).
Example
Consider the angular motion of a ship which is given by
2
d
dt
2
+ d
dt
= u; (2 7) :
_ = _1 =
x x2 ; x1 (0) = 1 ; x1 T ( )=0 (2 8) :
= _2 =
x u x2 ; x2 (0) = 0 ; x2 T( )=0 : (2 9) :
Hence we wish to
Z T
min
u 1 dt (2 10)
:
0
subject to equations (2.8) and (2.9). We now form the Hamiltonian function
(
H x1 ; x2 ; u; t; 1 ; 2 ) = 1 + 1( 2) + 2(
x u x2 : ) (2 11)
:
1 _ = @H
=0 (2 12)
:
@x1
_ =
2
@H
= 2 1 : (2 13)
:
@x2
2 = +
A
t
Be ; (2 15)
:
6
where A and B are constants to be determined. Applying Pontryagins Principle
we get
1+
1 x2 + 2 (
u
x2 )1+
1 x2 + 2 (
u
x2 ) (2 16)
:
2 u
(
u)0 : (2 17)
:
Hence
u
= 1 if 2 > 0 (2 18)
:
u
=1 if 2 < 0: (2 19)
:
From equation (2.15) we can see that 2 can change sign at most once. The
equations for x1 and x2 are now found to be
x1 = ut Ce
t
+ D (2 20)
:
x2 = + u Ce
t
; (2 21)
:
where C and D are constants to be found. There are two possible cases to consider:
u = 1 at = 0, = 1 at = , and = 1 at = 0, = 1 at = . From
t u t T u t u t T
the correct case, x1 and x2 can now be found in terms of known values. Hence
x1 = + t e
t
f or t ts
x1 = t e
T t
+ +1 T f or t ts (2.22)
x2 =1 e
t
f or t ts
x2 = 1+ e
T t
f or t ts; (2.23)
from which we can determine the switching time ts by equating the pairs of
equations (2.22) and (2.23) for x1 and x2 at the switching time , giving ts ts =
7
1
2 (
T 1). All that remains is to calculate the nal time T. This is straight forward
and gives = 2
T cosh
1
(
e
1
2 ).
In the special case where the Hamiltonian H is linear in the control vector , it u
is possible for the coecient of the linear term to vanish over a nite interval of
time. This gives rise to a singular interval and Pontryagin's principle gives no
information about the control variable . During this phase an additional condi-
u
tion is needed. The additional condition is a condition for local optimality, which
holds through out the singular interval, and is the second order Clebsch-Legendre
condition stated here without proof. The required condition for a maximum is
" ! !#
@
@u dt
d dH
du
> 0 (2 24)
:
For proof of this see [2], examples can also be found in this reference.
Example
Consider the control strategy that causes the response of the system
x1 t
_( ) = 2( )
x t ;
_( ) = ( )
x2 t u t (2 25)
:
Z
J
1
=2
T
2
x1 t ( ) + 22( )
x t
dt: (2 26)
:
0
The nal time and the nal states are free, and the controls are constrained by
T
(
H x1 ; x2 ; u; t; 1 ; 2 ) = 12 21 + 12 22 +
x x 1 x2 + 2 u: (2 27)
:
8
Applying Pontryagin's principle,
1 2
+ 12 2
+
+
1 2
+ 12 2
+
+
(2 28)
2 x1 x2 1 x2 2 u
2 x1 x2 1 x2 2 u; :
2
( u
u )0 : (2 29)
:
Hence
u
=1 if 2 < 0
u = 1 if 2 > 0 (2.30)
2 _ = 2 = = 0
::: ; f or [
t" t1 ; t2 : ] (2 31)
:
_ =
1
@H
= x1 (2 32)
:
@x1
_ =
2
@H
= x2 1 ; (2 33)
:
@x2
1 2+1 2+ + =0 [0 ] (2 34)
2 1 2 2
x x 1 x2 2 u f or t" ;T : :
Therefore, for [ 1 2 ],
t" t ; t
0 = 12 21 + 12 22 +
x x 1 x2 ; since 2 =0 ;
0 = 12 x1
2 1 2
2 2x : (2.35)
x1 + x2 =0 (2 36)
:
9
or
x1 x2 =0 : (2 37)
:
_ =
x2 x2 ; (2 38)
:
which implies
u ( )=t
x2 t ; () f or all [
t" t1 ; t2 ; ] (2 39)
:
u
( ) = 2( )
t x t ; f or all [ ]
t" t1 ; t2 ; (2 40)
:
in the state plane ( x1 ; x2 ) where singular intervalss may exsist. Since the system
1
6 2( )
x t
@@
@@ = 1= 2 u x x
@@
@@
@@R -
-1 @I@ 1 ()
x1 t
@@
@@
= 1@= 2
@@ u x x
@
-1
moves away from the origin on the line x1 = 2, this segment cannot form part
x
10
of an optimal trajectory. Suppose 2 ( ) 6= 0, then t
u
=1 if 2 < 0
u
= 1 if 2 > 0 : (2.41)
Hence,
+
x2 t
( )= t + C1 (2 42)
:
and therefore
+ 2
x1 t ( )= 2 + t
C1 t + C2 : (2 43)
:
Where C1 and C2 are constants to be determined. Since (0) lies in the rst x
However, [ ] = = 0 and
H u u 2 = 0, which implies
( )= x1 t1
2
( ) + 22( 1) x t
(2 45)
1 t1
2 2( 1)x t
: :
(_ ) = [ 1( 1) + 2(21)][( 1)( 1 )
2 t1
x t x t x t x2 t1 ( )] : (2 46)
:
2 1 x t
and, hence,
(_ ) 0
2 t1 < ; f or x1 + x2 > 0 ; (2 48)
:
11
whilst
(_ ) 0
2 t1 > ; f or x1 + x2 < 0 : (2 49)
:
Comparing with equation (2.44), it follows that switching is only allowed in the
case when x1 + x2 > 0. There are three possible cases:
1. 1 2
2 + 32
2. 1 2
2 + 32 < <
1 2
2 +4
3. 1 2
2 +4
12
Possible controls three phase
x2
2
x1=-0.5(x2) +4
1
-1
2
x1=0.5(x2)
-2
2
x1=0.5(x2) +0.5
-3
-4 x1=-x2
13
Chapter 3
Biological Problem
3.1 Notation
t = age
T = nal time
w t ( ) = body weight, (0) = initial weight
w
14
3.2 Biological Problem
value with time due to the population increasing at a rate of and the decrease r
constraints.
w_ = (1 u t( )) ( )
P w ; w (0) = specif ied (3 2):
_ = ( + ( ))
L r w L; L(0) = 1 (3 3):
_= ( )
uP w L
(0) = 0 ( )=1 (3 4)
w 0 ; T :
_=0
r (3 5):
15
(3.1) can now be rewritten as
Z T uP w ( ) =1 (3 6)
0 w 0 Ldt : :
= ( ) ( ) ( ) + (1
u t L t P w
( )) ( ) ( + ( )) ( ) (3 7)
H 0
w0 1 u t P w 2 r w L t : :
3 does not appear in the hamiltonian as _ = 0. The adjoint equations are given
r
by
_ =0
0 ; (3 8):
0
_ = 0 u0 LP
(1 ( )) 0
( )=0 (3 9)
1 2 m L
w 0 u t 1 P ; 1 T :
3 _ = ()
2 L t ; 3 (0) = 0 ; 3 T ( )=1 : (3 11)
:
In a two phase solution the control u switches instantly from zero to one. The
switching point can be found by setting @H
@u
= 0, which in this case gives
@H
@u
= 0 LP
w 0 1 P =0 : (3 12)
:
u
=0 if
0 L
w 0 < 1 (3 13)
:
16
u
=1 if
0 L
w 0 > 1 : (3 14)
:
(A boundary solution maximises the Hamiltonian.) This occurs due to the in-
herent properties of the problem, allowing all resources to be allocated to growth
initially and all resources to reproduction at = . This gives the two phase
t T
strategy.
Taking a simple case where the functions ( ), and ( ) are both linear the
P w w
two phase exact solution can be found. Working with the general case where
( )=
P w Aw , ( )=
w Bw and (0) = 0 25 the equations necessary for solving the
w :
Z
=
w1 1 (3 15)
t1
w (0) P w ( ) dw: :
Therefore
w1 = 0 25 : e
At1
(3 16)
:
R w1 r +(w)
L t ( )= e w(0) P (W )
dw
:
Hence 1, is given by
L
R w1 r +Bw
L1 = e w(0) Aw
dw
: (3 17)
:
17
Now using equation (3.6) we get
Z Z
1=
T P w L t
1 ( ) () = ( 10)
P w L1 T
(r+(w1 ))(t t1 )
=
t1 w0 dt
w t1
e dt
( )
0( + ( 1)) 1 (3.18)
P w1 L1 (r+(w1 ))(T t1 )
e :
w r w
This equation gives a relationship between and r w1 . This can be shown graphi-
cally and the optimal strategy determined from this by observation. This reduces
the optimal control problem to a simple static problem of nding w1 to maximise
r . A necessary condition for optimality is that
dw1
dr
= @f
@w1
=
@f
@r
=0 : (3 19)
:
Since we assume @f
@r
does not equal zero, we require @f
@w1
to be equal to zero. Hence
from equation (3.18) we obtain
!0
m1
( )(
0 P w1
T )
t1 e
m1 (T t1 )
+ ( )
P w1
1 e
m1 (T t1 )
1=0 (3 20)
:
m1 m1
where m1 = + ( 1) and
r w m1
0
= 0 . We now have three equations (3.16, 3.18,
3.20) and three unknowns , r w1 and t1 from which the exact solution can be
determined.
18
Variation of control with time
1.0
control
0.5
0.0
0 5 10 15 20
t - axis
Example-linear
The functions are given as
P w ( ) = 0 0702 : w
w ( ) = 0 01 : w
w (0) = 0 25 :
k = 0 0602
:
T = 100
w 0= w (0)
k
which on substitution into equations (3.16, 3.18, 3.20) give the following equations
w1 = 0 25
: e
0:0702t1
; (3 21)
:
R w1
w
0 0702
0 = + 0 01 1 : w
e w(0)
r +0:1w1
0:0702w1 dw
1 e
(r+0:01w1 )(100 t1 )
; (3 22)
:
r 1 : w
0 1 0 +0702
:
01 r
:
: w1
w1
(100 t1 ) e
(r+0:01w1 )(100 t1 )
+
!0
( )
P w1
1 (r+0:1w1 )(100 t1 )
1=0 (3.23)
r +01 1 : w
e :
19
One possible solution satisfying all the equations is given by = 0, r w1 = 2 29
:
and 1 = 31 6. This satis es the necessary conditions for a stationary value of the
t :
functional.
0
( 2) 0
w >
P
0
( 2)
w > r + ( 2)
w
0
P (w2 )
r +(w2 )
< 1
0
0
P
m
0
m
< 1 (Clebsch Legendre condition)
0
( 2) 0
w <
0
P (w2 )
r +(w2 )
> 1
0 0
P
0
(r+)
> 1 (Clebsch Legendre condition)
Note The dash (0 ) denotes di erentiation with respect to w2 which is the weight
at the second switching point.
20
3.4.1 Finding a three phase solution
A general three phase solution is looked at, in the simple case where the functions
( ) and ( ) are any general linear function. The rst and second switching
P w w
points are denoted by the subscripts 1 and 2 respectively. Equation (3.16) relating
w1 and t1 remains valid as does equation (3.17) relating w1 and 1. In the three
L
_ = 0_ L
(3 24)
1
0 w
: :
Substituting equation (3.9) into this equation and using equation (3.3) as well as
the relationship 1 = 0 L
w0
gives
( 0
( ))
2 = (3 25)
0 P m w
0 0
w m
; :
21
where m2 = + ( 2). The next step is to equate equations (3.25) and (3.26), the
r w
Before the singular arc analogue of equation (3.18) can be de ned it is necessary
to de ne the optimal control during the singular arc. This is de ned as
u
0 0 0
P (w) m(w ) m(w ) P (w) m(w )
0 P (w ) 0
m (w ) m (w )
u = 0 0 ; (3 30)
:
P (w)
0
m (w )
m(w )
1
which on substitution into equation (3.2) gives
0
P (w)
m (w )
0
m(w )
m w ( ) P
_=
w 0 0 = ( G w; r : ) (3 31)
:
P (w)
m (w )
0
m(w )
1
Hence
Z Z
t2
=
w2 1 (3 32)
t1
dt
w1 (
G w; r ) dw :
Using equation (3.30) to specify u during the singular arc, w2 can be found and
having found w2 an expression specifying L2 can be found. From these it is
possible to construct the singular arc analogue of equation (3.18), given by
R w1 r +(w)
R w2 r +(w)
Z
1=
w2 ( ( )
P w G w; r ( )) e w(0) P (w)
dw
w1 G(w;r )
dw
+
w1 w G w; r0 ( ) dw
R w1 r +(w)
R w2 r +(w)
( )
P w2 e w(0) P (w)
dw
w1 G(w;r )
dw
1 (r+(w2 ))(T t2 )
(3.33)
w 0( + ( 2)
r w
e
We now have ve equations (3.16), (3.28), (3.29), (3.32) and (3.33) and ve un-
knowns , r w1 w2 , t1 and t2 from which the exact solution can be determined.
22
Variation of control three phase
1.0
0.75
control
0.5
0.25
0.0
0 5 10 15 20
t - axis
w ( ) = 0 01 : w
w (0) = 0 25 :
k = 0 0602
:
T = 100
w 0= w (0)
k
which on substitution into equations (3.16), (3.28), (3.29), (3.32), (3.33) give the
following equations
w1 = 0 25
: e
0:0702t1
; (3 34)
:
0 1 0 +0702
:
01
r
: w1
: w1
(100 t1 ) e
(r+0:01w1 )(100 t1 )
+
!0
( )
P w1
1 (r+0:1w1 )(100 t1 )
1=0 (3.35)
r +01 1 : w
e ;
23
100 1 0 0702
= 0 0702 :
(3 36)
2 0 01
t2 :
: w :
Z Z
t2
=
w2 1 ( ) = 0 005 (3 37)
t1
dt
w1 (
G w; r ) dw where G w; r : w :
R w1 r +0:01w
R w2 r +0:01w
Z
1=
w2 (0 0702 : w 0 005 )
: w e w(0) 0:0702w dw w1 0:005w dw
+
w1 w 0 0 005
: w
dw
R w1 r +0:01w
R w2 r +0:01w
0 0702
: we w(0) 0:0702w dw w1 G(w;r )
dw
1 (r+0:01w2 )(100 t2 )
(3.38)
w 0( + 0 01 2 )
r : w
e
t1 = 61 28. This solution satis es the necessary conditions for a stationary value
:
of the functional.
24
Chapter 4
Development of Numerical
Method
The development of the numerical method begins by deriving numerical schemes
for solving the state equations for an arbitary control vector . The adjoint
u
equations are then solved for this arbitary control vector using similar numerical
u
methods. Since the equations for the adjoint variables are dependent on the
state equations they are solved for the same step size to avoid having to use
interpolation. The problem solution obtained at this point will not be an optimal
solution. The projected gradient and conditional gradient methods are used to
nd the optimal solution.
The numerical scheme begins with nding solutions to the state equations, for
a given control . The equations for the state variables are solved rst as the
u
adjoint equations are dependent upon them; these equations are solved from = 0
t
25
to a nal time = .t T
We commence with the state equation for , equation (3.2), which is inde-
w
pendent. The remaining state equations are solved simultaneously. The function
( ) given in equation (3.2) is assumed to be problem speci c and user de ned.
P w
wj +1 = wj + 2 ((1
h
) ( ) + (1
uj P wj ) (
uj +1 P wj +1 ))
; (4 1)
:
n+1
wj +1 = wj + 2 (1
h
) ( )) + 2 (1
uj P wj
h n
) (
uj +1 P wj +1 ) (4 2)
:
j P (w ) ( ) j
P y A jw y j (4 3)
:
j wj +1 n+1
wj +1 j K j wj +1 n
wj +1 j K < 1 (4 4)
:
j= j
2 (1 )j j ( ) ( )j (4 5)
n+1 h
j wj +1 wj +1 uj +1 P wj +1
n
P wj +1 ; :
26
which from equation (4.3) gives
2 (1 )j (4 6)
n+1 h
j wj +1 wj +1 j j uj +1 A j wj +1 n
wj +1 j: :
2 (1 )j 1 (4 7)
h
j uj +1 A < :
j P (w ) P y ( )j=j w y j
=j jjw y j (4.8)
j P (w ) P y ( ) jj 0 ( )( P w y )j
M ax j P
0
( )jj
w y j; (4.9)
1 + 2 ( + ( +1 ))
Lj +1 Lj ; L0 :
h n
r wj
j +1 = + 2 0(
j
w
h
( ) +
uj P wj Lj (
uj +1 P wj +1 Lj +1 ; ) ) 0 =0 : (4 11)
:
Since r is an unknown constant, equations (4.9) and (4.10) can not be solved
without a value for r being speci ed. This is done by starting a sequence of
27
iterations for the value of r with two initial guesses and evaluating L and
respectively for each guess. If the end condition ( ) = 1 is not satis ed, a T
Secant method is used to update the value of r, which is then used to recalculate
the value of and until the end condition on is satis ed. r is updated by
L
n+1
= n ( )(
g r
n
r
n
r
n 1
) (4 12)
r r
( )
g r
n
(
g r
n 1 ) ; :
g r ( )= ( ) 1
n
T : (4 13)
:
The solutions found for , , and are now used in determining the nu-
w L r
The adjoint equations are equations (3.8), (3.9), (3.10) and (3.11). To begin
solving the adjoint equations f 0 , 2 and 3 the end conditions are used.
The numerical solution is found using the same technique as that used for
nding , and and so only the outline is given here. Two initial estimates of
r L
the constant 0 are obtained and equation (3.10) for 2 and equation (3.11) for
3 are solved for these values, with only the conditions at = being used. The t T
n+1
= n
n
3 (0)( n
0
n
0 )1
(4 14)
3 (0) (0)
0 0 :
n n 1
3
28
Equations (3.10) and (3.11) for 2 and 3 are again solved by using a trapezium
discretisation, working backwards in time from the nal time = , so that t T
(1 h
( + ( ))) 2 +1 + 2 00 ( ( ) +h
( ))
= (4 15)
r wj +1 j uj P wj uj +1 P wj +1
2 w
(1 + 2 ( + ( ))
2j :
h
r wj
3j = 2( h
2j Lj + 2j +1 Lj +1 )+ 3j +1 : (4 16)
:
It is now possible to solve equation (3.9) for 1 ; this is again done with a
(1 + 2 (1 +1 ) 0 ( +1 ))
h
=
uj P wj 1j +1
(1 2 (1 ) 0 ( ))
1j
h
uj P wj
h (2j
0
( ) +
wj Lj 2j +1 ( +1 )
0
wj Lj +1 )
2 (1 2 (1 h
uj P) ( )) 0
wj
+2 0h0 (
uj Lj P ( )+
0
wj (
uj +1 Lj +1 P
0
wj +1 ) (4.17)
w (1 2 (1 h
uj P) ( )) 0
wj
A numerical method for nding the optimal control u, and hence the optimal
solutions to equations (3.2-3.5) and (3.8-3.11) is needed, assuming such an optimal
exists. To optimise the value of the control vector u, starting from an arbitrary
control vector, two methods have been tried, the projected gradient method, and
the conditional gradient method. The basic algorithms were taken from [1] and
adapted as necessary to suit this problem.
29
4.3.1 Projected gradient method
A basic outline to this method is shown in the owchart in Fig 4.1 The new
approximation to the optimal control u
is chosen such that
@uold
; (4 18)
:
@u
(~
; u u ) >; (4 19)
:
@u
(~uk uk :) (4 20)
:
k =1 uk
This maximises the rst variationof the functional over all possible choices of . u
If this is suciently small then the process is said to have converged and the
optimal control u has been determined; otherwise the step size is set to one again
and the whole process repeated until the optimal value of u is determined.
30
4.3.2 Conditional gradient method
Again the basic outline to the method is shown using a owchart, see Fig 4.2.
The idea is to generate a sequence of possible control vectors u, for which the
values of the functional (which we wish to maximise) is non-decreasing.
r u is
an approximation to the optimal control , with solutions , , , and to the
u r w l
unew = (1 )
s uold + ~ su; (4 21)
:
~=1
u if
@H
@unew
> 0
~=0
u otherwise;
where @H
@unew
is the functional gradient speci ed by equation (3.12). This selection
maximises the rst variation <
@H
@unew
;u~ unew > of the functional over all possible
choices of ~ and is used to determine when the optimal has been found. This is
u
the same convergence criterion as used for the Projected gradient method and is
given by equation (4.20).
31
Start
- set ?
6 uold = unew ; rold = rnew ;
@H
@uold
= @H
@unew
?
step = 1
?
calculate unew
unew = + uold step
@H
@uold
6
Is?XXXXX
= 1 X XXX 00 1 0 X
XXX - = 0
XXXorXbetween?
unew < : ; or > :
unew unew
X 0 0 1 0
=
?unew
:
unew
unew :
? - ?
?
solve state equations
?XXXXX
XXXX Is XXXX no -
XXXXX
rnew > rold step = step/2
yes
?
solve adjoint equations
?
calculate @H
@unew
?XXXXX
XXX Is XXXX no-
~ = 1 yesX
XXXXX ~ = 0
0
u @H u
>
@unew
? -? ?
calculate = c <
@H
@unew
;u ~ unew >
?XXXX
XXXXX
XXX Is
noX
XXXXX c tol
yes
?
= u unew
?
End
32
Start
?
set =
u un = up ; rold = rnew
- ?
6 step = 1, = up u; rold = rnew
?
calculate u 6
u = (1 ) +
step up stepun
?
solve state equations
X?XXXX
XXXX Is XXXX no -
XXXXX
rnew > rold step = step/2
yes
?
solve adjoint equations
?
calculate @H
@u
X?XXXX
XXX Is XXXX no-
= 1yesX
XXXXX
0 =0
un @H un
>
@u
? -? ?
calculate = c <
@H
@u
; un up >
?XXXXX
XXX
noX Is XXXX
XXXXX
c tol
yes
?
= u u
?
End
33
Chapter 5
Numerical Results
In this chapter the results from a series of test problems are presented. Due to the
diculty in calculating analytical solutions even in the case of linear functions for
P w ( ) and ( ) the analytical solutions have only been fully calculated for a linear
w
test problem. Tests are made which look at the sensitivity of the method to the
initial approximation of , the e ect on the solution of the initial arbitrary control
r
u and the e ect of changing the length of the step taken in the gradient direction
on the rate of convergence and accuracy of the solution for both optimisation
methods. The eciency of the two optimisation methods is compared by looking
at the total number of inner iterations (number of times is calculated) and the
r
number of outer iterations (number of times the new control is recalculated if the
convergence criterion is not satis ed).
Consideration is given rstly to what initial data the method requires and then to
it's possible e ect on the methods numerical solutions. The initial data required
34
are
i) w (0), weight of at = 0
w t
vi) The switching point (zero to one) for the arbitrary initial control
which is not dependent on the optimisation method used. Points iv and vi are of
primary interest.
The numerical method developed solves eight rst order di erential equations
which are related in such away that seven of the eight di erential equations are
e ected either directly or indirectly by the value of . This makes the method r
sensitive to the value of to the extent that if the initial approximation is not
r
close enough to the method provides a false solution. This can be detected by
r
Z Z
=
T uP w L ( ) =
T 0
(5 1)
0 0
0 w0 dt
0
2 mL 2 L dt: :
35
Using equation(3.3) gives
Z T
0 = 2 mL 2 mLdt + 2 (0)
: (5 3)
:
0
Hence 0 = 2 (0). This condition is only satis ed when the solution is an optimal
solution. Since is calculated using the Secant method the initial approximations
r
must be easonably close to . This will hopefully not present a problem when
r
5.3 Convergence
In this section we look at the convergence criteria used throughout the numerical
method and the number of steps . The convergence criteria used in evaluating
N
the state equations begins by looking at that used in the evaluation of . The w
criteria, dependent on the inner product speci ed by equation (4.19). The magni-
tude of this inner product dictates the convergence of the control . The method u
36
Table 5.1 shows the variation in w1 at the rst switching point and the varia-
tion in w2 at the second switching point, as the number of steps N is increased.
The solutions can be seen to converge to two decimal places when N = 200.
N w1 w2 t1 t2
The switching point is the time at which the arbitrary initial control switches
ts u
u =0 if t < ts
u =1 if t > ts : (5.4)
The e ect of the position of ts on the solutions found using both the Projected
and Conditional gradient methods is considered by looking at the changes in r
and 0 as well as the number of iterations necessary for the methods to converge.
The problem used for this evaluation is the linear test problem speci ed by
the functions ( ) and ( ), the initial value (0), a constant and the nal
P w w w k
37
time = , given by
t T
P w ( ) = 0 0702
: w
w ( ) = 0 01
: w
w (0) = 0 25
:
k = 0 0602
:
T = 100.
The analytical solution has already been calculated (chapter 3) for this problem
with both two and three phase solutions being found.
Projected Gradient Method
u switch point no of iterations r 0 = 2 (0)
The results in table 5.2 show that moving the switching point ( ) has a quite
ts
dramatic e ect on the number of iterations required for the method to converge.
In all cases where a three phase solution is optimal, the projected gradient method
38
will nd this solution and has done so for this example. From chapter three we
know that the rst switching point is at = 28 20 for this problem, and so the
t :
all that can be expected when N = 2000. This variation in the results is e ected
by the tolerance used for calculating the control variable although making this
stricter to reduce the variation in the solution is not viable due to the resulting
large increase in the number of iterations.
Conditional Gradient Method
u switch point no iterations r 0 = 2 (0)
above switching times, which are very close to the exact solution, is not surpris-
ing. It is however disappointing that the method fails to produce a solution if
the switching point is moved elsewhere. The reason for this needs further inves-
tigation to determine it's cause, which would appear to be either the method's
39
inability to cope with problems that have a possible three phase solution con-
taining a singular arc, which would render the method almost useless, or the
magnitude of causing some type of error propogation..
T
Direction
The step length in the gradient direction directly concerns the optimisation meth-
ods. The aim is to try and improve the rate of convergence without loosing accu-
racy. The projected gradient method only was considered in detail. When using
the original step length of one the method appeared to be unusable, requiring
over eight hundred iterations to converge to a solution when the switching point
ts was not very close to the exact solution. This caused errors to e ect the solu-
tion resulting in a sub-optimal solution being found. Increases in the step length
reduced the number of iterations required for convergence and the results are
shown in table 5.4 for a variety os switching times as it would be most unusual
for the initial guess to be almost identical to the exact solution.
It appears from the results in table 5.4 that very large increases in step length
are possible without the solution being e ected, while reducing the number of
iterations required for convergence. However caution must be advised, as the step
length possible is dependent on the size of the functional gradient, which for this
example is very small. A step length of four would, however, be a good starting
point for most problems. The development of a scaling method to determine the
length of the step size based on the magnitude of the functional gradient would
40
be a useful addition to the numerical method and is an area of future work.
41
u switch point no iterations step length r 0 = 2 (0)
Table 5.4: Projected Gradient method variable initial and step length in the
u
gradient direction
42
Chapter 6
Conclusions
This project set out to develop a numerical method that was capable of solving
the problem of nding optimal life cycle strategies for a given organism using the
model developed in [6]. The numerical method developed here provides a solution
to this problem.
The basic numerical method for solving di erential equations (3.2-3.5) and
(3.8-3.11) is simple in concept and design and could easily be extended to deal
with further constraints in a more complex model. The two optimisation meth-
ods considered, the projected gradient and conditional gradient, have individual
problems which need further consideration. The projected gradient method is
very slow to converge if the arbitrary initial control has it's switching point away
from the exact switching point. The conditional gradient method does not cope
very well with problems whose solution contains a singular arc, either failing to
converge or nding an alternative two phase solution if the switching point is
chosen to be in almost the exact position.
The linear problem looked at in chapter ve converges to a slightly di erent
43
solution for each switching point speci ed using the projected gradient method
with a maximum solution obtaining the value of = 0 when the switching point
r
is chosen to be almost the exact solution. There are a number of possible reasons
why this may happen, it could be an inherent property of the problem caused by
the exact solution containing an almost at basin around the minimum causing
the numerical method to converge to a series of sub-optimal solutions that are
very close to the optimal as can be observed in table 5.2 and table 5.4. The most
likely alternative is that the errors are a result of the convergence criteria not
being strict enough on the outer iteration loop. The reason for not making these
stricter lies in the number of iterations necessary for convergence being excessive
if the tolerance used is less than 0 005.
:
It would be interesting to test the method with some real data and compare
the strategies predicted by the numerical method and the observed strategies
used by the organism. This would not only provide a means of validating the
numerical method fully, but would also validate thoroghly the model developed
in [6].
44
Acknowledgements
I would like to thank my project tutor Dr N. K. Nichols for her assistance with this
work. I would also like to thank all other members of the mathematics department
who have helped in the preparation of this work, and without who's help it would
never have been completed. I thank SERC for their nancial support.
45
Bibliography
[1] T. P. Andrews, N. K. Nichols, Z. Xu
The form of optimal controllers for Tidal-Power-Generation schemes
Numerical Analysis report 8/90 Reading University
[4] B. Charlsworth
Evolution in age-structured Populations 1980 Cambridge University
press
46