Sie sind auf Seite 1von 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
Introduction
Variational principles
Variational principles are familiar in mechanics
the best approximate wave function for the ground state of a
quantum system is the one with the minimum energy
The path between two endpoints (t
1
, t
2
) in configuration space taken
by a particle is the one for which the action is minimised

Energy or Action is a function of a function or functions
Wave function or particle positions and velocities
A function of a function is called a functional

A functional is minimal if its functional derivative is zero
This condition can be expressed as a partial differential equation
Introduction
Hamiltons principal of least action
}
=
2
t
1
t
N 1 1
N 1 1
dt (t))
.
q ..., (t),
.
q (t),
.
q (t), q (t),..., q (t), L(q Action
L = T V is the Lagrangian
(t) q
1

1
t
2
t
(t) q
2
(t) q
1
The path actually taken is the
one for which infinitesimal
variations in the path result in
no change in the action
Introduction
Hamiltons principal of least action
The condition that a particular function is the one that
minimises the value of a functional can be expressed as a
partial differential equation

We are therefore presented with an alternative method for
solving 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
0
q
L
-
q
L
dt
d
i i
=
c
c
c
c

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 q(x) be an arbitrary function which is zero at the
boundaries in the problem so that + cq(x) is an arbitrary
function that satisfies the boundary conditions

c is a number which will tend to zero
}
=
b
a
dx ) y' y, F(x, J[y]
dx
dy
y' =
y
y
Euler-Lagrange Equations
Functionals
}
+ + = +
b
a
dx ) ' ' y , y F(x, (x)] y J[ cq cq cq
a
b
A
(x) q
y(x)
B
(x) y
(x) (x) y cq +
x
Functional


Boundary conditions
y(a) = A
y(b) = B

Function ) J(c
c
0
dx ) ' y , y F(x,
dx ) ' ' y , y F(x,
d
d

d
) dJ(

b
a
b
a
}
}
+ +
c
c
=
+ + =
cq cq
c
cq cq
c c
c
Euler-Lagrange Equations
Functionals
0
y'
F
dx
d

y
F
if 0
d
dJ
dx
y'
F
dx
d

y
F

dx '
y'
F

y
F

d
dJ
'
y'
F

y
F
0
y'
y'
F

y
y
F

x
x
F

F
b
a
b
a
=
c
c

c
c
=
(

c
c

c
c
=
(

c
c
+
c
c
=
c
c
+
c
c
+ =
c
c
c
c
+
c
c
c
c
+
c
c
c
c
=
c
c
}
}
c
q
q q
c
q q
c c c c


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
cq y y + =
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
| |dxdy 2uf u u J[u]
D
2
y
2
x
}}
+ + =
y) f(x, y) u(x,
2
= V
D
Method of Ritz for minimising functionals
Electrostatic potential problem
etc.
y) (x, xy y) (x,
y) (x, y y) (x,
y) (x, x y) (x,
y) (x, y y) (x,
y) (x, x y) (x,
y) - x)(1 - xy(1 y) (x,
1 6
1
2
5
1
2
4
1 3
1 2
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

Series expansion of solution





Substitute into functional




Differentiate wrt c
j
Method of Ritz for minimising functionals
Electrostatic potential problem
y) (x, c y) u(x,
N
1 i
i i

=
= |
dy dx c f 2
y
c
x
c ) J(c
D
N
1 i
i i
2
N
1 i
i
i
2
N
1 i
i
i i }}


)

+
(

c
c
+
(

c
c
=
= = =
|
| |
dy dx f c
y y x x
2
c
J
D
j
N
1 i
i
j
i
j
i
j
}}


)

+
(
(

c
c
c
c
+
c
c
c
c
=
c
c
=
|
|
|
|
|
Method of Ritz for minimising functionals
Electrostatic potential problem
Functional minimised when



Linear equations to be solved for c
i

A
ij
.c
j
= b
i


where
dy dx
y y x x
A
D
j
i
j
i
ij }}

)

c
c
c
c
+
c
c
c
c
=
|
|
|
|
{ } dy dx y) (x, y) f(x, - b
D
i
i }}
= |
0
c
J
j
=
c
c
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

BC S x t) (x, f t) u(x,
IC D x (x) u(x,0)
PDE 0 t D x u Lu
s
t
e =
e =
> e =
|
Weighted residual methods
Trial solution and residuals
Define pde and IC residuals

=
=
=
n
1 i
i i
s
I
t
T T E
(x) u (0) c - (x,0) u - (x) (x) R
t)) (x, (u - t) (x, Lu t) (x, R
|
Trial solution

=
+ =
n
1 i
i i
s
T
(x) u (t) c t) (x, u t) (x, u
S x 0 (x) u
t) (x, f t) (x, u
i
s s
e =
=
R
E
and R
I
are zero if u
T
(x,t) is an exact solution
u
i
(x) are basis functions
The weighted residual method generates and
approximate solution in which R
E
and R
I
are minimised

Additional basis set (set of weighting functions) w
i
(x)

Find c
i
which minimise residuals according to




R
E
and R
I
then become functions of the expansion
coefficients c
i
Weighted residual methods
Weighting functions
0 (x)dx (x)R w
0 t)dx (x, (x)R w
D
I i
D
E i
=
=
}
}
Weighted residual methods
Weighting functions
Bubnov-Galerkin method
w
i
(x) = u
i
(x) i.e. basis functions themselves

Least squares method
i
E
i
c
R
2 (x) w
c
c
=
0
c
) (c J
0
c
) (c J
0 (x)dx R ) (c J
0 t)dx (x, R ) (c J
i
i I
i
i E
D
2
I i I
D
2
E i E
=
c
c
=
c
c
= =
= =
}
}
Positive definite functionals u(x) real
Conditions for minima
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
The finite element method
Computational fluid dynamics websites
Gallery of Fluid Dynamics
Introduction 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
The finite element method
Mesh generation
Local coordinate axes and
node numbers
Global coordinate axes
1
2 3
Finer mesh elements in
regions where the
solution varies rapidly

Meshes may be regular
or irregular polygons
Definition of local and global
coordinate axes and node numberings
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
1
F
2
F
i
T
1 i
T
+
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 (U W) = H = 0
dx
x
x
dx
du
2
AE
x
x
T(x)u(x)dx u F u F
2
1
2
2
1
1 1 2 2
} }
|
.
|

\
|
+ =
The finite element method
Example: bar under stress
dx
x
x
dx
) d(u
2
AE
x
x
)dx T(x)(u
) (u F ) (u F ) (u
2
1
2
2
1
2 2 2 1 1 1
} }
|
.
|

\
|
+
+ +
+ + = +
cq
cq
cq cq cq
dx
x
x

dx
d
dx
du
AE
x
x
dx T F F
d
d
2
1
2
1
2 2 1 1
} }
+ =
q
q q q
c
Eliminate dq/dx using integration by parts
The finite element method
Example: bar under stress
( ) dx
x
x

dx
du
AE
dx
d
dx
du
AE
dx
x
x

dx
du
AE
dx
d
x
x
dx
du
AE dx
x
x

dx
d
dx
du
AE
2
1
1 2
2
1
2
1
2
1
|
}
} }
=
=
q q q
q q
q
0 T(x)
dx
du
AE
dx
d
0
x
dx
du
AE F 0
x
dx
du
AE F
2
2
1
1
| |
= +
|
.
|

\
|
= + = +
Differential equation being solved
Boundary
conditions
The finite element method
Example: bar under stress
Introduce a finite element basis to solve the minimisation
problem H[u(x)] = 0
Assume linear displacement function
u(X) = o
1
+ o
2
X
u
i
(X) = o
1
+ o
2
X
i
u
j
(X) = o
1
+ o
2
X
j



Solve for coefficients o


i j
i j j i
1
X - X
X u - X u
= o
i j
i j
2
X - X
u - u
= o
X is the local
displacement variable
u(X)
i j X
The finite element method
Example: bar under stress
Substitute to obtain finite elements
u(X) = N
1
u
1
+ N
2
u
2


i j
j
1
X - X
X - X
N =
i j
i
2
X - X
X - X
N =
u
1
and u
2
are coefficients of the
basis functions N
1
and N
2
N
1
N
2
u(X) = [N
1
N
2
] (u)

The finite element method
Example: bar under stress
Potential energy functional Grandin pp91ff
dx T(x)u(x) dx
dx
du
2
AE
u F - u F - [u(x)]
2
x
1
x
2
2
x
1
x
2 2 1 1 } }

|
.
|

\
|
+ = H
( ) ( )
|
|
.
|

\
|
=
|
|
.
|

\
|
= =
1 -
1
u u
X - X
1

u
u
1 1 -
X - X
1

X - X
u - u

dx
du
j i
i j
j
i
i j i j
i j
|
|
.
|

\
|
|
|
.
|

\
|
|
.
|

\
|
|
.
|

\
|
=
|
|
|
.
|

\
|
=
|
.
|

\
|
j
i
j i
2
i j
2
i j
i j
2
u
u

1 1 -
1 - 1
u u
X - X
1

X - X
u - u

dx
du
The finite element method
Example: bar under stress
( )
matrix stiffness Element
1 1 -
1 - 1

X - X
1

2
EA
[k]
q [k]. . q
2
1


u
u

1 1 -
1 - 1
] u u [
X - X
1

2
EA

dX
u
u

1 1 -
1 - 1
] u u [
X - X
1

2
EA
U
i j
T
j
i
j i
i j
j
X
i
X
j
i
j i
2
i j
(

=
=
|
|
.
|

\
|
(

=
|
|
.
|

\
|
(

=
}
Strain energy
dx
dx
du
2
AE
energy train
2
2
x
1
x
|
.
|

\
|
=
}
s
per element
The finite element method
Example: bar under stress
|
|
.
|

\
|
=
j
i
j i NF
u
u
] F [F - V energy potential force Node
Node force potential energy
dx T(x)u(x) V energy potential load d Distribute
2
x
1
x
T }
=
Distributed load potential energy
dX
u
u
X - X
X - X
X - X
X - X
T(X) - V
j
i
i j
i
i j
j
j
X
i
X
T
|
|
.
|

\
|
(
(

=
}
The finite element method
Example: bar under stress
Energy functional for one element
0
u
i
=
c
H c
| |
|
|
.
|

\
|

|
|
.
|

\
|

|
|
.
|

\
|
= H
}
j
i
j
X
i
X
2 1
j
i
j i
j
i
j i
u
u
. ] N [N T(X) dX
u
u
. ] F F [
u
u
. k . ] u u [
2
1

Equilibrium condition for all i
| | | |
|
|
.
|

\
|
}

|
|
.
|

\
|

|
|
.
|

\
|
+
|
|
.
|

\
|
=
c
H c
0
1
. ] N [N T(X) dX

0
1
. ] F F [
0
1
. k . ] u [u
2
1

u
u
. k . 0] 1 [
2
1

u
j
X
i
X
2 1
j i j i
j
i
i
The finite element method
Example: bar under stress
Equilibrium condition for one element
| |
|
|
.
|

\
|
+
|
|
.
|

\
|
=
|
|
.
|

\
|
}
2
1
j
X
i
X
j
i
j
i
N
N
T(X) dX
F
F

u
u
. k
Assemble matrix for global displacement vector
| | T F u . k + =
The finite element method
Example: bar under stress
| |
element labels n
N
N
) T(X dX
...
0
0
F

...
u
u
u

... 1 0 0
1 2 1 0
0 1 2 1
0 0 1 1
K
2n
1n
j
X
i
X
n n n
1
3
3
1
|
|
.
|

\
|
=
|
|
|
|
|
.
|

\
|
=
|
|
|
|
|
.
|

\
|
=
|
|
|
|
|
.
|

\
|




=
}
T F
u
Solve resulting linear equations for u

Das könnte Ihnen auch gefallen