Lecture04 Notes

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

The Catenary

The potential energy of the cable


is
Variational Methods & Z L
y

Optimal Control Wp {y} =


0
mgy(s)ds
y0
y=y(x)
y1
lecture 04 Where L is the length of the ca- g
Matthew Roughan ble
<matthew.roughan@adelaide.edu.au> d
x0 x1
Discipline of Applied Mathematics
Catenary problem where we have pullies on top of each pylon, and a large
School of Mathematical Sciences
University of Adelaide
amount of cable. Under appropriate conditions it will reach an
equilibrium shape. The critical features of this problem are that the
end-points are fixed but the length L of the cable is unconstrained.
April 14, 2016

Variational Methods & Optimal Control: lecture 04 – p.1/40 Variational Methods & Optimal Control: lecture 04 – p.3/40

Fixed end-point variational problem

y
Fixed-end point problems
We’ll start with the simplest functional maximization problem, and show (x1,y1)
how to solve by finding the first variation and deriving the Euler-Lagrange
equations:
y = y(x)
(x0,y0)
∂f ∂f
 
d
− = 0
dx ∂y′ ∂y

Variational Methods & Optimal Control: lecture 04 – p.2/40 Variational Methods & Optimal Control: lecture 04 – p.4/40
Formulation The Catenary
Define the functional F : C2 [x0 , x1 ] → IR Z L
Wp {y} = mgy(s)ds
Z x1 0
F{y} = f (x, y, y′ ) dx, p
x0 Change of variables ds = 1 + y′2 dx. So the functional of interest (the
potential energy) is
where f is assumed to be function with (at least) continuous second-order
partial derivatives, WRT x, y, and y′ . Z x1 p
Wp {y} = mg y 1 + y′2 dx,
x0
Problem: determine y ∈ C2 [x0 , x1 ] such that y(x0 ) = y0 and y(x1 ) = y1 , such Z x1
that F has a local extrema. = mg f (x, y, y′) dx,
x0
where
p
f (x, y, y′ ) = y 1 + y′2

Variational Methods & Optimal Control: lecture 04 – p.5/40 Variational Methods & Optimal Control: lecture 04 – p.7/40

The Catenary How do we tackle these problems


Z L
Wp {y} = mgy(s)ds look at small perturbations about the max/min.
0 y
But I don’t know how to evaluate this integral directly. Lets do a simple max
change of variables. The length of a line segment from (x, y) to
(x + δx, y + δy) is
For a local maxi-
y x+ ε mum
δs ≃ δx2 + δy2
p

y=y(x) f (x + ε) ≤ f (x)
s
δy
 2
= 1+ δx δs δy
δx
p δx
ds = 1 + y′2 dx

x x x
⇒ Conditions for extremals, i.e., f ′ (x) = 0

Variational Methods & Optimal Control: lecture 04 – p.6/40 Variational Methods & Optimal Control: lecture 04 – p.8/40
Perturbations of functions Perturbations of functions

y y

y = y +εη y = y + ε η2
(x1,y1) (x1,y1)
y = y(x) y = y(x)
(x0,y0) (x0,y0)

x x

Variational Methods & Optimal Control: lecture 04 – p.9/40 Variational Methods & Optimal Control: lecture 04 – p.11/40

Perturbations of functions The Functional of interest.


Define the functional F : C2 [x0 , x1 ] → IR
y
Z
y = y + ε2η F{y} =
x1
f (x, y, y′ ) dx,
x0

where f is assumed to be function with continuous second-order partial


(x1,y1) derivatives, WRT x, y, and y′ .
y = y(x) Problem: determine y ∈ C2 [x0 , x1 ] such that y(x0 ) = y0 and y(x1 ) = y1 ,
such that F has a local extrema.
(x0,y0) The space of possible curves is
S = y ∈ C2 [x0 , x1 ] y(x0 ) = y0 , y(x1 ) = y1


⇒ The vector space of allowable perturbations is


x H = η ∈ C2 [x0 , x1 ] η(x0 ) = 0, η(x1 ) = 0


Variational Methods & Optimal Control: lecture 04 – p.10/40 Variational Methods & Optimal Control: lecture 04 – p.12/40
Perturbation functions The first variation
The vector space of allowable perturbations is For small ε the quantity
H = η ∈ C2 [x0 , x1 ] η(x0 ) = 0, η(x1 ) = 0

Z
F{y + εη} − F{y} x1 ∂f ′ ∂f
 
δF(η, y) = lim = η + η ′ dx
ε→0 ε x0 ∂y ∂y
y
is called the First Variation.
For F{y} to be a minimum, for small ε, F{ŷ} ≥ F{y}, so the sign of
δF(η, y) is determined by ε.
η
As before, we can vary the sign of ε, so for F{y} to be a local minima it
must be the case that
x0 x1 δF(η, y) = 0, ∀η ∈ H
x

Variational Methods & Optimal Control: lecture 04 – p.13/40 Variational Methods & Optimal Control: lecture 04 – p.15/40

What to do Analogy to functions


Regard f as a function of 3 independent variables: x, y, y′ This condition on the first variation is analogous to all partial derivatives
Take ŷ(x) = y(x) + εη(x), where y ∈ S and η ∈ H . being zero!
Taylor’s theorem (note x is kept constant below)
For a function of N variables to have a local extrema
∂f ∂f
 
f (x, ŷ, ŷ′ ) = f (x, y, y′) + ε η + η′ ′ + O(ε2 ) ∂f
∂y ∂y = 0, ∀i = 1, . . . , n
∂xi
So
For a functional to be an extrema
Z x1 Z x1
F{ŷ} − F{y} = f (x, ŷ, ŷ′ )dx − f (x, y, y′ )dx d
x0 x0 δF(η, y) = F(y + εη) = 0, ∀η ∈ H
Z x1  dε ε=0
∂f ′ ∂f

= ε η + η ′ dx + O(ε2 )
x0 ∂y ∂y
Note now that we have to minimize over an infinite dimensional space H ,
instead of IRn .

Variational Methods & Optimal Control: lecture 04 – p.14/40 Variational Methods & Optimal Control: lecture 04 – p.16/40
Simplification A useful lemma
Integrate the second term by parts Lemma 2.2.1: Let α, β ∈ IR, such that α < β. Then there is a function
Z x1  ν ∈ C2 (IR), such that ν(x) > 0 for all x ∈ (α, β) and ν(x) = 0 otherwise.
∂f ′ ∂f

δF(η, y) = η + η ′ dx Proof: by example
x0 ∂y ∂y
 x1 Z x 
∂f ∂f d ∂f
   (
(x − α)3 (β − x)3 , if x ∈ (α, β)
1
= η ′ + η − dx ν(x) =
∂y x0 x0 ∂y dx ∂y′
0, otherwise.
But note that by the problem definition η ∈ H , and so η(x0 ) = η(x1 ) = 0,
and so the first term is zero.
The function inside the integral exists, and is continuous by our
assumption
h that  f hasitwo continuous derivatives, so for
∂f d ∂f
E(x) = ∂y − dx ∂y′
Z x1
δF(η, y) = η(x)E(x)dx = hη, Ei2 = 0 α β
x0

Variational Methods & Optimal Control: lecture 04 – p.17/40 Variational Methods & Optimal Control: lecture 04 – p.19/40

Euler-Lagrange equation A second useful lemma


Theorem 2.2.1: Let F : C2 [x0 , x1 ] → IR be a functional of the form Lemma 2.2.2: Suppose hη, gi = 0 for all η ∈ H . If g : [x0 , x1 ] → IR is a
Z continuous function then g(x) = 0 for all x ∈ [x0 , x1 ].
x1
F{y} = f (x, y, y′ ) dx, Proof: Suppose g(x) > 0 for x ∈ [α, β]. Choose ν as in Lemma 2.2.1.
x0
Z x2 Z β
where f has continuous partial derivatives of second order with respect to hν(x), g(x)i2 = ν(x)g(x)dx = ν(x)g(x)dx > 0
x1 α
x, y, and y′ , and x0 < x1 . Let
Hence a contradiction.
S = y ∈ C2 [x0 , x1 ] y(x0 ) = y0 and y(x1 ) = y1 ,

Similar proof for g(x) < 0.

where y0 and y1 are real numbers. If y ∈ S is an extremal for F, then for all
x ∈ [x0 , x1 ]
d ∂f ∂f
 
− = 0 ⇐ the Euler-Lagrange equation
dx ∂y′ ∂y

Variational Methods & Optimal Control: lecture 04 – p.18/40 Variational Methods & Optimal Control: lecture 04 – p.20/40
Proof of Euler-Lagrange equation Example: geodesics in a plane
As noted earlier, at an extremal the first variation The arclength of a curve described by y(x) will be
Z x1 Z 1p
δF(η, y) = hη(x), E(x)i2 = η(x)E(x)dx = 0 F{y} = 1 + y′2 dx
x0 0

for all η(x) ∈ H . From Lemma 2.2.2, we can therefore state that Then !
∂f ∂f y′
 
d d
∂f ∂f − = −0 = 0
  
d
∂y′ ∂y
p
E(x) = − = 0, dx dx 1 + y′2
∂y dx ∂y′

So √ y is a constant, implying y′ = const. Hence y(x) = c1 x + c2 , the
the Euler-Lagrange equation.✷ 1+y′2
equation of a straight line.
◮ Q: how do I know this is a minimum?

Variational Methods & Optimal Control: lecture 04 – p.21/40 Variational Methods & Optimal Control: lecture 04 – p.23/40

Example: geodesics in a plane


Let (x0 , y0 ) = (0, 0) and (x1 , y1 ) = (1, 1), find the shortest path between
these two points.
The length of a line segment from x to x + δx is
y
Special cases
δs = δx2 + δy2
p
Now that we know the Euler-Lagrange (E-L) equations, we can use them
directly, but there are some special cases for which the equations simplify,
s
δy
 2
= 1+ δx δs δy and make our life easier:
δx
p δx ◮ f depends only on y′
ds = 1 + y′2 dx ◮ f has no explicit dependence on x (autonomous case)
x ◮ f has no explicit dependence on y
R x=1 R1p ◮ f = A(x, y)y′ + B(x, y) (degenerate case)
So the total path length is F{y} = x=0 ds = 0 1 + y′2 dx

Variational Methods & Optimal Control: lecture 04 – p.22/40 Variational Methods & Optimal Control: lecture 04 – p.24/40
f depends only on y′
◮ If f ′′ (y′ ) = 0, then f (y′ ) = ay′ + b. We will later see that problems in
this form are “degenerate”, and solutions don’t depend on the
curve’s shape.
Special case 1 ◮ If y′′ = 0, then
y = c1 x + c2 .
When f depends only on y′ the E-L equations simplify to
So for non-degenerate problems with only y′ dependence the extremals
∂f are straight lines
= const
∂y′ ◮ e.g. geodesics in the plane
An example of this is calculating geodesics in the plane (which we all
know are straight lines).

Variational Methods & Optimal Control: lecture 04 – p.25/40 Variational Methods & Optimal Control: lecture 04 – p.27/40

f depends only on y′ Example f depends only on y′


Geodesics in the plane are a special case of f = f (y′ ), with no explicit Consider finding the extremals of
dependence on y. Apply the chain rule to the E-L equation and we get
Z
d ∂f F{y} =
1
αy′4 − βy′2 , dx
= 0
dx ∂y′ 0

d 2 f (y′ ) dy′ such that y(0) = 0 and y(1) = b.


= 0
dy′2 dx The Euler-Lagrange equation is
d 2 f (y′ ) ′′
y = 0 d 
dy′2 4αy′3 − 2βy′2 = 0

dx
so one of the two following must be true
We could play around with this for a while to solve, but we already know
f ′′ (y′ ) = 0 the solutions are straight lines, so the extremal will be
y′′ = 0
y = bx

Variational Methods & Optimal Control: lecture 04 – p.26/40 Variational Methods & Optimal Control: lecture 04 – p.28/40
Fermat’s principle Example
Fermat’s principle of geometrical optics: Consider c(x, y) = 1/g(x)
Light travels along a path between any two points such that Z x1 p
the time taken is minimized T {y} = g(x) 1 + y′2 dx
x0

p
Take the speed of light to be dependent on the media, e.g. c = c(x, y), the f (x, y, y′ ) = g(x) 1 + y′2
time taken by light along a path y(x) is
f has no explicit dependence on y so
Z p
x1 1 + y′2 ∂f
T {y} = dx = const
x0 c(x, y) ∂y′
Fermat’s principle says the actual path of light will be a minima of this y′
functional. g(x) p = const
1 + y′2

Variational Methods & Optimal Control: lecture 04 – p.29/40 Variational Methods & Optimal Control: lecture 04 – p.31/40

Speed of light Example (ii)


The speed of light (EM radiation) is only constant in a vacuum
medium speed (km/s) refractive index y′
g(x) p = c1
vacuum 300,000 1.0 1 + y′2
water 231,000 ∼ 1.3 y′2 c21
= implies c21 ≤ g(x)2
glass 200,000 ∼ 1.5 1 + y′2 g(x)2
diamond 125,000 ∼ 2.4 c21
y′2 = (1 + y′2 )
silicon 75,000 ∼ 4.0 g(x)2
Refractive index = c/v c21 c21
 
′2
y 1− =
g(x)2 g(x)2
s
c21
y′ =
g(x)2 − c21

Variational Methods & Optimal Control: lecture 04 – p.30/40 Variational Methods & Optimal Control: lecture 04 – p.32/40
Example (iii) How we might solve
Break into two problems, with a boundary point (x∗ , y∗ ), which has a fixed
value of x∗ (the location of the boundary), but a movable value for y∗ .
s
c21
y′ =
g(x)2 − c21
Z
1
y = c1 p dx + c2 (x1,y1)
g(x)2 /c21 − 1

The constants, c1 and c2 are determined by the fixed end points.


(x *,y *) φ1
◮ so not all extremals are straight lines φ0
◮ we had to include an x term here to make it more interesting

(x0,y0)

Variational Methods & Optimal Control: lecture 04 – p.33/40 Variational Methods & Optimal Control: lecture 04 – p.35/40

What we can’t do (yet) The functional


Remember, f must have at least two continuous derivatives. If the speed of light Z x∗
p Z p
1 + y′2 x1 1 + y′2
c(x, y) has discontinuities, then we are in trouble. F{y} = dx + dx
x0 c0 x∗ c1
(x1,y1) Separate into two problems, as if we knew (x∗ , y∗ ). Each is a geodesic in
the plane problem. So the solutions are straight lines

(
(x − x0 ) xy∗ −y
−x0 + y0 x ≤ x
0 ∗
y(x) = ∗
(x − x∗ ) xy11 −y
−x∗ + y

x ≥ x∗

Now we can explicitly compute F{y} as a function of x, by differentiating


y, and then we can treat it as a minimization problem in one variable y∗ .

(x0,y0)

Variational Methods & Optimal Control: lecture 04 – p.34/40 Variational Methods & Optimal Control: lecture 04 – p.36/40
The total time taken More than one boundary
We can simplify the integrals by noting from Pythagoras that the lengths Snell’s law applies at each boundary
of the two lines are
p p (x1,y1)
(x∗ − x0 )2 + (y∗ − y0 )2 and (x∗ − x1 )2 + (y∗ − y1 )2

and that the time take to traverse the pair of line segments will be
p p
(x∗ − x0 )2 + (y∗ − y0 )2 (x∗ − x1 )2 + (y∗ − y1 )2 (x *,y *)
T {y} = + φ1
c0 c1 φ0

dT (y∗ − y0 ) (y1 − y∗ )
= − (x0,y0)
dy∗ c0 [(x∗ − x0 )2 + (y∗ − y0 )2 ]1/2 c1 [(x∗ − x1 )2 + (y∗ − y1 )2 ]1/2

Variational Methods & Optimal Control: lecture 04 – p.37/40 Variational Methods & Optimal Control: lecture 04 – p.39/40

The result Dealing with “kinks”


◮ We’ll spend a fair bit of time later on dealing with “kinks” in curves
dT (y∗ − y0 ) (y1 − y∗ ) ◮ Underlying point
= −
dy∗ c0 [(x∗ − x0 )2 + (y∗ − y0 )2 ]1/2 c1 [(x∗ − x1 )2 + (y∗ − y1 )2 ]1/2 ⊲ The integral can still be well defined even if extremal isn’t
sin φ0 sin φ1 “smooth”
= − ⊲ But the Euler-Lagrange equations don’t work at the kinks
c0 c1
⊲ Use the Euler-Lagrange equations everywhere except the kinks
which we require to be zero to find the minimum. Hence ⊲ Do something else at the kinks
sin φ0 sin φ1
= ⇐ Snell’s law for refraction
c0 c1

Hence there are often ways around discontinuities, though it may involve
some pain
(e.g. what about internal reflection)

Variational Methods & Optimal Control: lecture 04 – p.38/40 Variational Methods & Optimal Control: lecture 04 – p.40/40

You might also like