Calculus of Variations
Summer Term 2015
Lecture 12
Universität des Saarlandes
17. Juni 2015
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 1 / 31
Purpose of Lesson
Purpose of Lesson:
First application of the Ritz method.
The Ritz method applied to the catenary gives additional insights.
Kantorovich’s method generalizes Ritz to 2D functions.
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 2 / 31
Numerical Solutions (continued) Simple Example-2
Application of the Ritz method:
Example 12.1
Find extremals for
Z1
1 02 1 2
J[y ] = y + y − y dx
2 2
0
with y (0) = 0 and y (1) = 0.
The Euler-Lagrange equation y 00 − y = 1, but we shall bypass the
Euler-Lagrange equation to use Ritz’s method.
n
X
yn (x) = φ0 (x) + ci φi (x)
i=1
where we take φ0 (x) = 0 and φi (x) = x i (1 − x)i .
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 3 / 31
Numerical Solutions (continued) Simple Example-2
Example 12.1
Simple approximation y1 = c1 φ1 (x) we get
Z1
1 2 02 1 2 2
J1 [c1 ] = J[y1 ] = c φ + c1 φ1 − c1 φ1 dx.
2 1 1 2
0
Now φ1 (x) = x(1 − x) so φ01 = 1 − 2x, and
Z1 " #
c12 2 c12 2 2
J1 [c1 ] = (1 − 2x) + x (1 − x) − c1 x(1 − x) dx
2 2
0
Z1 h Z1 h
c2 2 3 4
i i
= 1 1 − 4x + 5x − 2x + x dx + c1 −x + x 2 dx
2
0 0
11c12 c1
= − .
60 6
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 4 / 31
Numerical Solutions (continued) Simple Example-2
Example 12.1
We solve for c1 by setting
dJ1 11c1 1
= − =0
dc1 30 6
to get c1 = 5/11, so the approximate extremal is
5
y1 (x) = x(1 − x).
11
The value of the approximate functional at this point is
11c12 c1
J1 [5/11] = − = −0.37879
60 6
which is an upper bound on the true value of the functional on the
extremal.
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 5 / 31
Numerical Solutions (continued) Simple Example-2: results
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 6 / 31
Numerical Solutions (continued) Alternate Approach
Example 12.1 (alternate approach)
Choose φ1 (x) = sin (πx) (use the first element of a trigonometric
series to approximate y ).
Then, φ01 (x) = π cos (πx), and so the functional is
Z1
1 2 02 1 2 2
J1 [c1 ] = J[c1 φ1 ] = c φ + c1 φ1 − c1 φ1 dx
2 1 1 2
0
Z1 " #
c12 π 2 2 c12 2
= cos (πx) + sin (πx) − c1 sin (πx) dx.
2 2
0
R1 R1
Observe that cos2 (πx)dx = sin2 (πx)dx = 1/2, and
0
10
R1
1
sin (πx)dx = − cos (πx) = −2/π.
0 π 0
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 7 / 31
Numerical Solutions (continued) Alternate Approach
Example 12.1 (alternate approach)
So
c12 h 2 i 2
J1 [c1 ] = π + 1 − c1 .
4 π
Once again we solve for c1 by setting
dJ1 c1 h 1 i 2
= π +1 − =0
dc1 2 π
4
to get c1 = π(π 2 +1)
, so the approximate extremal is
4
y1 (x) = sin (πx).
π(π 2 + 1)
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 8 / 31
Numerical Solutions (continued) Simple Example-2: alternative results
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 9 / 31
Numerical Solutions (continued) Example: the Catenary, again
Ritz and Catenary:
Example 12.2 (the catenary, again)
The functional of interest (the potential energy) is
Zx1 q
Jp [y ] = mg y 1 + y 02 dx.
x0
Take symmetric problem with fixed end points y (−1) = a and
y (1) = a.
We know that the solution looks like
x
y (x) = c1 cosh
c1
where c1 is chosen to match the end points.
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 10 / 31
Numerical Solutions (continued) Example: the Catenary, again
Example 12.2 (the catenary, again)
y (1) = 2 gives c1 = 0.47 or c1 = 1.697
Are they both local minima?
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 11 / 31
Numerical Solutions (continued) Ritz and the Catenary
Example 12.2 (Ritz and the Catenary)
Lets try approximating the curve by a polynomial
y (x) = a0 + a1 x + a2 x 2 + a3 x 3 + a4 x 4 + . . .
Note that symmetry of problem implies y is an even function, and
hence the odd terms
a1 = a3 = · · · = 0.
So, to second order we can approximate
y (x) ' a0 + a2 x 2 .
We have fixed y (1) = y1 , so we can simplify to get
y (x) ' a0 + (y1 − a0 )x 2 .
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 12 / 31
Numerical Solutions (continued) Ritz and the Catenary
Example 12.2 (Ritz and the Catenary)
y ' a0 + (y1 − a0 )x 2
y 0 ' 2(y1 − a0 )x
Taking into account y (1) = 2 we get a0 + a2 = 2. We can
substitute into the functional
Zx1 q
Jp [y ] = mg y 1 + y 02 dx
x0
and integrate to get a function Jp [a2 ] with respect to a2 .
But this function is pretty complicated.
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 13 / 31
Numerical Solutions (continued) Ritz and the Catenary
Example 12.2 (Ritz and the Catenary)
From Maple we have the value for Jp [a2 ], (a := a2 )
2 2 2
O f x d 2 K a C a$x $ 1 C 4$a $x :
O int f x , x =K1 ..1
1 1 2 2 2 2
16 a ln K2 a C 1 C 4 a csgn a csgn a C 128 1 C 4 a a csgn a (1)
64 a2
3 2 2
K 64 a 1 C 4 a csgn a K 32 a ln K2 a C 1 C 4 a csgn a csgn a C ln
2 2 2 3
K2 a C 1 C 4 a csgn a csgn a K4 1 C 4 a a csgn a C 8 1 C 4 a
/2 2 2
a csgn a K 16 a ln 2 aC 1 C 4 a csgn a csgn a C 32 a ln 2a
2 2
C 1 C 4 a csgn a csgn a K ln 2 aC 1 C 4 a csgn a csgn a
csgn a
O
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 14 / 31
Numerical Solutions (continued) Ritz and the Catenary
Example 12.2 (Ritz and the Catenary)
dJp
Its a pain to find the zeros of , but its easy to plot, and find
da
them numerically.
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 15 / 31
Numerical Solutions (continued) Ritz and the Catenary
Example 12.2 (Ritz and the Catenary)
Stationary points
local max: a = a2 ' 1.6
local min: a = a2 ' 0.3
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 16 / 31
Numerical Solutions (continued) Ritz and the Catenary
Example 12.2 (Ritz and the Catenary)
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 17 / 31
Numerical Solutions (continued) Ritz and the Catenary
Example 12.2 (Ritz and the Catenary)
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 18 / 31
Numerical Solutions (continued) Ritz and the Catenary
Ritz and the Catenary
Doesn’t just give us an approximation to the extremal curves, its also
give us some insight into the nature of these extremals. If
approximations are near to the actual extrema
There are no other extrema so close by
The functional is smooth (it can’t have jumps either)
Then the type of extrema we get for the approximation will be the same
for the real extrema, i.e.,
local max: a2 ' 1.6 ⇒ local max for c1 = 0.497
local min: a2 ' 0.3 ⇒ local min for c1 = 1.697
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 19 / 31
Numerical Solutions (continued) More than one independent variables
More than one independent variables
2D Case:
We are approximating a surface with series of functions, e.g.
n
X
z(x, y ) ' zn (x, y ) = φ0 (x, y ) + ci φi (x, y )
i=1
where
φ0 (x, y ) satisfies the boundary conditions, e.g.
φ0 (x, y ) = z0 (x, y ) for (x, y ) ∈ ∂Ω,
the boundary of the region on interest Ω,
and the φi (x, y ) satisfy the homogeneous boundary conditions
φi (x, y ) = 0 for (x, y ) ∈ ∂Ω.
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 20 / 31
Numerical Solutions (continued) More than one independent variables
2D Case:
As before, we approximate the functional by
J[z] ' J[zn ] = Jn (c1 , . . . , cn ).
As before we determine the cj by requiring that the partial
derivatives are zero, e.g.
∂Jn
=0
∂ci
for all i = 1, 2, . . . , n.
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 21 / 31
Numerical Solutions (continued) Kantorovich’s Method
Kantorovich’s Method
Approximate with
n
X
z(x, y ) ' zn (x, y ) = φ0 (x, y ) + ci (x)φi (x, y ).
i=1
Again the φi are suitable chosen, but the ci are no longer
constants, but rather functions of one independent variable.
This allows a larger class of functions to be used.
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 22 / 31
Numerical Solutions (continued) Kantorovich’s Method
Kantorovich’s Method
Note that the integral function
yZ1 (x)
ZZ n Z
X
J[zn ] = zn (x, y )dxdy = ci (x) φi (x, y )dy dx
Ω i=0 y0 (x)
We integrate the inner integral, and get
n Z
X
J[zn ] = ci (x)Φi (x)dx.
i=0
Now we just have a function of x, and so we may apply the
Euler-Lagrange machinery.
The method approx. separates the variables x and y .
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 23 / 31
Numerical Solutions (continued) Kantorovich’s Method
Example 12.3
Find the extremals of
Zb Za
J[z(x, y )] = zx2 + zy2 − 2z dxdy
−b −a
with z = 0 on the boundary.
The Euler-Lagrange equation reduces to the Poisson equation,
e.g.
d d
Fz −Fz − Fz = 0
dx x dy y
d d
−2 − (2zx ) − (2zy ) = 0
dx dy
zxx + zyy = −1
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 24 / 31
Numerical Solutions (continued) Kantorovich’s Method
Example 12.3
Approximate
z1 (x, y ) = c(x) b2 − y 2
Note z1 (x, ±b) = 0 (as required) and
2 i2
∂z1 h
= c 0 (x) b2 − y 2
∂x
h i
= c 0 (x)2 b4 − 2b2 y 2 + y 4 ,
2
∂z1
= [c(x)2y ]2
∂y
= 4c(x)2 y 2
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 25 / 31
Numerical Solutions (continued) Kantorovich’s Method
Example 12.3
Hence, we approximate
Zb Za
J[z(x, y )] ' J[z1 (x, y )] = zx2 + zy2 − 2z dxdy
−b −a
Za Zb
2
= c 0 (x)2 b2 − y 2 + 4c(x)2 y 2 − 2c(x) b2 − y 2 dy dx
−a −b
Za h
= c 0 (x)2 b4 y − 2b2 y 3 /3 + y 5 /5 + 4c(x)2 y 3 /3
−a
ib
+2c(x) b2 y − y 3 /3 dx
−b
Za
16 5 0 2 8 3 2 8 3
= b c (x) + b c(x) − b c(x) dx
15 3 3
−a
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 26 / 31
Numerical Solutions (continued) Kantorovich’s Method
Example 12.3
So we can write
Za
J[z(x, y )] ' J[z1 (x, y )] = J[c(x)] = F (x, c, c 0 )dx
−a
We can use the simple Euler-Lagrange equation, where
16 5 0 2 8 3 8
F (x, c, c 0 ) = b c (x) + b c(x)2 − b3 c(x)
15 3 3
∂F 16 3 8
= b c(x) − b3
∂c 3 3
∂F 32 5 0 d ∂F 32 5 00
0
= b c (x) 0
= b c (x)
∂c 15 dx ∂c 15
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 27 / 31
Numerical Solutions (continued) Kantorovich’s Method
Example 12.3
The Euler-Lagrange equation
16 3 8 32 5 00
b c(x) − b3 − b c (x) = 0
3 3 15
5 5
c 00 (x) − 2 c(x) = − 2
2b 4b
Solutions
r ! r !
5x 5x 1
c(x) = k1 cosh + k2 sinh +
2b 2b 2
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 28 / 31
Numerical Solutions (continued) Kantorovich’s Method
Example 12.3
Note that the function must be zero on the boundary, so
z(±a, y ) = 0.
We look for an even function c(x), and so k2 = 0.
Also c(±a) = 0, so
r !
5a 1
c(a) = k1 cosh +
2b 2
r !
1 5a
− = k1 cosh
2 2b
1
k1 = − q
5a
2 cosh 2b
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 29 / 31
Numerical Solutions (continued) Kantorovich’s Method
Example 12.3
Solution
q
5x
cosh 2b
1 2 2
z1 (x, y ) = (b − y ) 1 − q
2 5a
cosh 2b
If we want a more exact approximation, we could try
z2 (x, y ) = (b2 − y 2 )c1 (x) + (b2 − y 2 )2 c2 (x).
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 30 / 31
Numerical Solutions (continued) Lower bounds
Remarks
Obviously, quality of solution depends on
family of functions chosen
number of terms used, n
Could test convergence by increasing n and seeing the difference
in
|J[yn+1 ] − J[yn ]|,
but this is not guaranteed to be a good indication.
A better way to assess convergence is to have a lower bound
lower bound 6 J[y ] 6 upper bound
c Daria Apushkinskaya (UdS) Calculus of variations lecture 12 17. Juni 2015 31 / 31