-
8/13/2019 Solution of Pdes Using Variational Principles
1/30
III Solution of pdes using variational
principles
Introduction
Euler-Lagrange equations
Method of Ritz for minimising functionals
Weighted residual methods
The Finite Element Method
4.1 Introduction
-
8/13/2019 Solution of Pdes Using Variational Principles
2/30
Introduction
Variational principles
Variational principles are familiar in mechanicsthe best approximate wave function for the ground state of a
quantum system is the one with the minimum energy
The path between two endpoints (t1, t2) in configuration space taken
by a particle is the one for which the actionis minimised
Energy or Action is a function of a function or functionsWave function or particle positions and velocities
A function of a function is called a functional
A functional is minimal if its functional der ivativeis zeroThis condition can be expressed as a partial differential equation
-
8/13/2019 Solution of Pdes Using Variational Principles
3/30
Introduction
Hamiltons principal of least action
2t
1t
N11N11 dt(t)).q...,(t),
.q(t),
.q(t),q(t),...,q(t),L(qAction
L = TV is the Lagrangian(t)q1
1t
2t
(t)q2
(t)q1
The path actually taken is the
one for which infinitesimal
variations in the path result in
no change in the action
-
8/13/2019 Solution of Pdes Using Variational Principles
4/30
Introduction
Hamiltons principal of least action
The condition thata particular function is the one thatminimises the value of a functional can be expressed as a
partial differential equation
We are therefore presented with an alternative method forsolving partial differential equations besides directly seeking
an analytical or numerical solution
We can solve the partial differential equation by finding the
function which minimises a functional
Lagranges equations arise from the condition that the
action be minimal 0q
L-q
L
dt
d
ii
-
8/13/2019 Solution of Pdes Using Variational Principles
5/30
4.2 Euler-Lagrange Equations
Let J[y(x)] be the functional
Denote the function that minimises J[y] and satisfies
boundary conditions specified in the problem by
Let h(x) be an arbitrary function which is zero at the
boundaries in the problem so that + eh(x) is an arbitrary
function that satisfies the boundary conditions
eis a number which will tend to zero
b
adx)y'y,F(x,J[y] dx
dy
y'
y
y
-
8/13/2019 Solution of Pdes Using Variational Principles
6/30
Euler-Lagrange Equations
Functionals
b
a
dx)''y,yF(x,(x)]yJ[ eheheh
a b
A
(x)h
y(x)
B(x)y(x)(x)y eh
x
Functional
Boundary conditions
y(a) = Ay(b) = B
Function )J(e
e0dx)'y,yF(x,
dx)''y,yF(x,dd
d)dJ(
b
a
b
a
ehehe
ehehee
e
-
8/13/2019 Solution of Pdes Using Variational Principles
7/30
Euler-Lagrange Equations
Functionals
0y'
F
dx
d
y
F
if0d
dJ
dxy'
F
dx
d
y
F
dx'y'
F
y
F
d
dJ
'y'
F
y
F0
y'
y'
F
y
y
F
x
x
F
F
b
a
b
a
e
h
hhe
hh
eeee
y is the solution to a pde as
well as being the function
which minimises F[x,y,y]
We can therefore solve a
pde by finding the function
which minimises the
corresponding functional
ehyy
-
8/13/2019 Solution of Pdes Using Variational Principles
8/30
Electrostatic potential u(x,y) inside region D SF p 362
Charges with density f(x,y) inside the square
Boundary condition zero potential on boundary
Potential energy functional
Euler-Lagrange equation
4.3 Method of Ritz for minimising functionals
dxdy2ufuuJ[u]D
2y
2x
y)f(x,y)u(x,2
D
-
8/13/2019 Solution of Pdes Using Variational Principles
9/30
Method of Ritz for minimising functionals
Electrostatic potential problem
etc.
y)(x,xyy)(x,y)(x,yy)(x,
y)(x,xy)(x,
y)(x,yy)(x,
y)(x,xy)(x,
y)-x)(1-xy(1y)(x,
16
1
2
5
12
4
13
12
1
Basis set which satisfies boundary conditions
0
0.2
0.4
0.6
0.8
1 0
0.2
0.4
0.6
0.8
1
0
0.02
0.04
0.06
0
0.2
0.4
0.6
0.8
1
0
0.2
0.4
0.6
0.8
1 0
0.2
0.4
0.6
0.8
1
0
0.01
0.02
0.03
0
0.2
0.4
0.6
0.8
1
1
2
-
8/13/2019 Solution of Pdes Using Variational Principles
10/30
Series expansion of solution
Substitute into functional
Differentiate wrt cj
Method of Ritz for minimising functionals
Electrostatic potential problem
y)(x,cy)u(x,N
1iii
dydxcf2y
cx
c)J(cD
N
1iii
2N
1i
ii
2N
1i
iii
dydxfcyy
xx
2c
J
D j
N
1i
i
jiji
j
-
8/13/2019 Solution of Pdes Using Variational Principles
11/30
Method of Ritz for minimising functionals
Electrostatic potential problem
Functional minimised when
Linear equations to be solved for ci
Aij.cj= bi
where
dydxyy
xx
AD
jijiij
dydxy)(x,y)f(x,-bD
ii
0c
J
j
-
8/13/2019 Solution of Pdes Using Variational Principles
12/30
4.4 Weighted residual methods
For some pdes no corresponding functional can be found
Define a residual (solution error) and minimise this
Let L be a differential operator containing spatial derivatives
D is the region of interest bounded by surface S
An IBVP is specified by
BCS xt)(x,ft)u(x,
ICD x(x)u(x,0)PDE0 tD xuLu
s
t
-
8/13/2019 Solution of Pdes Using Variational Principles
13/30
Weighted residual methods
Trial solution and residuals
Define pde and IC residuals
n
1iiisI
tTTE
(x)u(0)c-(x,0)u-(x)(x)R
t))(x,(u-t)(x,Lut)(x,R
Trial solution
n
1iiisT(x)u(t)ct)(x,ut)(x,u
Sx0(x)u
t)(x,ft)(x,u
i
ss
REand RIare zero if uT(x,t) is an exact solution
ui(x) are basis functions
-
8/13/2019 Solution of Pdes Using Variational Principles
14/30
The weighted residual method generates andapproximate solution in which REand RIare minimised
Additional basis set (set of weighting functions) wi(x)
Find ciwhich minimise residuals according to
REand RIthen become functions of the expansion
coefficients ci
Weighted residual methods
Weighting functions
0(x)dx(x)Rw
0t)dx(x,(x)Rw
D Ii
D Ei
-
8/13/2019 Solution of Pdes Using Variational Principles
15/30
Weighted residual methods
Weighting functions
Bubnov-Galerkin methodwi(x) = ui(x) i.e.basis functions themselves
Least squares method
i
Ei c
R2(x)w
0
c
)(cJ
0c
)(cJ
0(x)dxR)(cJ
0t)dx(x,R)(cJ
i
iI
i
iE
D
2IiI
D2EiE
Positive definite functionals u(x) real
Conditions for minima
-
8/13/2019 Solution of Pdes Using Variational Principles
16/30
4.5 The Finite Element Method
Variational methods that use basis functions that extend over
the entire region of interest are
not readily adaptable from one problem to another
not suited for problems with complex boundary shapes
Finite element method employs a simple, adaptable basis set
-
8/13/2019 Solution of Pdes Using Variational Principles
17/30
The finite element method
Computational fluid dynamics websites
Gallery of Fluid DynamicsIntroduction to CFD
CFD resources online
CFD at Glasgow University
Vortex Shedding around a Square Cylinder
Centre for Marine Vessel Development and Research
Department of Mechanical Engineering
Dalhousie University, Nova Scotia
Computational fluid dynamics (CFD) websites
Vortex shedding illustrations by CFDnet
http://www.eng.vt.edu/fluids/msc/gallery/gall.htmhttp://www.cham.co.uk/website/new/cfdintro.htmhttp://www.cfd-online.com/Resources/misc.htmlhttp://www.aero.gla.ac.uk/Research/CFD/education/course/CALF/index/nindx.htmlhttp://www.cfd-online.com/Resources/misc.htmlhttp://cfdnet.com/nwt/http://cfdnet.com/nwt/http://www.cfd-online.com/Resources/misc.htmlhttp://www.aero.gla.ac.uk/Research/CFD/education/course/CALF/index/nindx.htmlhttp://www.cfd-online.com/Resources/misc.htmlhttp://www.cham.co.uk/website/new/cfdintro.htmhttp://www.eng.vt.edu/fluids/msc/gallery/gall.htm -
8/13/2019 Solution of Pdes Using Variational Principles
18/30
The finite element method
Mesh generation
Local coordinate axes and
node numbers
Global coordinate axes
1
23
Finer mesh elements inregions where the
solution varies rapidly
Meshes may be regularor irregular polygons
Definition of local and global
coordinate axes and node numberings
-
8/13/2019 Solution of Pdes Using Variational Principles
19/30
The finite element method
Example: bar under stress
Define mesh Define local and global node numbering
Make local/global node mapping
Compute contributions to functional from each element
Assemble matrix and solve resulting equations
1F
2F
iT
1iT
-
8/13/2019 Solution of Pdes Using Variational Principles
20/30
The finite element method
Example: bar under stress
Variational principle
W = virtual work done on system by external forces (F)
and load (T)
U = elastic strain energy of bar
W =U or (UW) =P= 0
dx
x
xdx
du
2
AEx
x
T(x)u(x)dxuFuF2
1
22
1
1122
-
8/13/2019 Solution of Pdes Using Variational Principles
21/30
The finite element method
Example: bar under stress
dx
x
x
dx
)d(u
2
AEx
x
)dxT(x)(u
)(uF)(uF)(u2
1
22
1
222111
eheh
eheheh
dx
x
x
dx
d
dx
duAE
x
x
dxTFF
d
d2
1
2
1
2211 hhhh
e
Eliminate dh/dx using integration by parts
-
8/13/2019 Solution of Pdes Using Variational Principles
22/30
The finite element method
Example: bar under stress
dxx
x
dxduAE
dxd
dxduAE
dx
x
x
dx
duAE
dx
dxx
dx
duAEdx
x
x
dx
d
dx
duAE
2
1
12
2
1
21
2
1
|
hhh
hhh
0T(x)
dx
duAE
dx
d
0xdxduAEF0xdx
duAEF2
21
1 ||
Differential equation being solved
Boundaryconditions
-
8/13/2019 Solution of Pdes Using Variational Principles
23/30
The finite element method
Example: bar under stress
Introduce a finite element basis to solve the minimisationproblemP[u(x)] = 0
Assume linear displacement function
u(X) = a1+ a2X
ui(X) = a1+ a2Xi
uj(X) = a1+ a2Xj
Solve for coefficients a
ij
ijji1
X-X
Xu-Xua
ij
ij2
X-X
u-ua X is the local
displacement variable
u(X)
i jX
-
8/13/2019 Solution of Pdes Using Variational Principles
24/30
The finite element method
Example: bar under stress
Substitute to obtain finite elements
u(X) =N1u1+N2u2
ij
j1
X-XX-XN
ij
i2
X-XX-XN
u1and u2are coefficients of the
basis functions N1and N2
N1
N2
u(X) = [N1N2] (u)
Th fi it l t th d
-
8/13/2019 Solution of Pdes Using Variational Principles
25/30
The finite element method
Example: bar under stress
Potential energy functional Grandin pp91ff
dxT(x)u(x)dxdx
du
2
AEuF-uF-[u(x)]
2x
1x
22x
1x
2211
P
1-
1uu
X-X
1
u
u11-
X-X
1
X-X
u-u
dx
duji
ijj
i
ijij
ij
j
i
ji2
ij
2
ij
ij2
u
u
11-
1-1uu
X-X
1
X-X
u-u
dx
du
Th fi it l t th d
-
8/13/2019 Solution of Pdes Using Variational Principles
26/30
The finite element method
Example: bar under stress
matrixstiffnessElement11-
1-1
X-X
1
2
EA[k]
q[k]..q2
1
u
u
11-
1-1]uu[
X-X
1
2
EA
dX
u
u
11-
1-1]uu[
X-X
1
2
EAU
ij
T
j
iji
ij
jX
iXj
iji2
ij
Strain energy dxdx
du
2
AEenergytrain
22x
1x
s
per element
Th fi it l t th d
-
8/13/2019 Solution of Pdes Using Variational Principles
27/30
The finite element method
Example: bar under stress
j
ijiNF u
u]F[F-VenergypotentialforceNode
Node force potential energy
dxT(x)u(x)VenergypotentialloaddDistribute2x
1x
T
Distributed load potential energy
dXu
u
X-X
X-X
X-X
X-XT(X)-V
j
i
ij
i
ij
jjX
iX
T
Th fi i l h d
-
8/13/2019 Solution of Pdes Using Variational Principles
28/30
The finite element method
Example: bar under stress
Energy functional for one element
0ui
P
P
j
ijX
iX
21j
iji
j
iji u
u.]N[NT(X)dX
u
u.]FF[
u
u.k.]uu[
2
1
Equilibrium condition for all i
P
0
1.]N[NT(X)dX
0
1.]FF[
0
1.k.]u[u
2
1
u
u.k.0]1[
2
1
u
jX
iX
21
jijij
i
i
-
8/13/2019 Solution of Pdes Using Variational Principles
29/30
The finite element method
Example: bar under stress
Equilibrium condition for one element
2
1jX
iXj
i
j
i
N
NT(X)dX
F
F
u
u.k
Assemble matrix for global displacement vector
TFu .k
Th fi it l t th d
-
8/13/2019 Solution of Pdes Using Variational Principles
30/30
The finite element method
Example: bar under stress
elementlabelsnN
N)T(XdX
...
0
0
F
...
u
u
u
...100
1210
0121
0011
K
2n
1njX
i
Xnnn
1
3
3
1
TF
u
Solve resulting linear equations for u