Sei sulla pagina 1di 55

Weighted Residual

Methods

1
Formulation of FEM Model


Direct Method
Formulation of FEM Model Variational Method
Weighted Residuals
• Several approaches can be used to transform the physical
formulation of a problem to its finite element discrete analogue.

• If the physical formulation of the problem is described as a


differential equation, then the most popular solution method is
the Method of Weighted Residuals.

• If the physical problem can be formulated as the minimization


of a functional, then the Variational Formulation is usually used.
2
Formulation of FEM Model
Finite element method is used to solve physical problems
Solid Mechanics
Fluid Mechanics
Heat Transfer
Electrostatics
Electromagnetism
….
Physical problems are governed by differential equations which satisfy
Boundary conditions
Initial conditions

One variable: Ordinary differential equation (ODE)


Multiple independent variables: Partial differential equation (PDE)

3
Physical problems
Axially loaded elastic bar

y A(x) = cross section at x


b(x) = body force distribution
(force per unit length)
x E(x) = Young’s modulus
x u(x) = displacement of the bar at x
x=0 x=L

Differential equation governing the response of the bar


d  du 
 AE   b  0; 0 xL
dx  dx 

Second order differential equations


Requires 2 boundary conditions for solution
4
Physical problems
Axially loaded elastic bar
y

x
x
x=0 x=L
Boundary conditions (examples)
u0 at x  0 Dirichlet/ displacement bc
u 1 at x  L
u  0 at x  0
du
EA  F at x  L Neumann/ force bc
dx
Differential equation + Boundary conditions = Strong form of the
“boundary value problem”
5
Physical problems
Flexible string

y S = tensile force in string


p(x) = lateral force distribution
(force per unit length)
x=0 x=L w(x) = lateral deflection of the
x
x string in the y-direction
S S
p(x)

Differential equation governing the response of the bar

d 2u
S 2  p  0; 0 xL
dx
Second order differential equations
Requires 2 boundary conditions for solution
6
Physical problems
Heat conduction in a fin
y
A(x) = cross section at x
Q(x) = heat input per unit length per
x
unit time [J/sm]
x k(x) = thermal conductivity [J/oC ms]
x=0 x =L T(x) = temperature of the fin at x
Q(x)

Differential equation governing the response of the fin

d  dT 
 Ak   Q  0; 0 xL
dx  dx 
Second order differential equations
Requires 2 boundary conditions for solution
7
Physical problems
Heat conduction in a fin
y

x
x
x=0 x=L

Q(x)

Boundary conditions (examples)


T  0 at x  0 Dirichlet/ displacement bc
dT
k  h at x  L Neumann/ force bc
dx

8
Physical problems
Fluid flow through a porous medium (e.g., flow of water through a dam)
y

A(x) = cross section at x


Q(x) = fluid input per unit volume
x
per unit time
x k(x) = permeability constant
x=0 x=L j(x) = fluid head
Q(x)
Boundary conditions (examples)
Differential equation
j  0 at x  0 Known head
d  dj 
k   Q  0; 0 xL dj
dx  dx  k  h at x  L Known velocity
dx
Second order differential equations
Requires 2 boundary conditions for solution
9
Physical problems

10
Physical problems

11
Formulation of FEM Model
Observe:
1. All the cases we considered lead to very similar differential
equations and boundary conditions.
2. In 1D it is easy to analytically solve these equations
3. Not so in 2 and 3D especially when the geometry of the domain is
complex: need to solve approximately
4. We’ll learn how to solve these equations in 1D. The approximation
techniques easily translate to 2 and 3D, no matter how complex the
geometry

12
Formulation of FEM Model
A generic problem in 1D
d 2u
2
 x  0; 0  x 1
dx
u  0 at x  0
u  1 at x  1
Analytical solution

1 7
u ( x)   x 3  x
6 6
Assume that we do not know this solution.

13
Formulation of FEM Model
A generic problem in 1D
A general algorithm for approximate solution:
Guess u( x)  a0j o ( x)  a1j1 ( x)  a2j 2 ( x)  ...
where jo(x), j1(x),… are “known” functions and ao, a1, etc are constants
chosen such that the approximate solution
Satisfies the differential equation
Satisfies the boundary conditions
i.e.,
d 2jo ( x) d 2j1 ( x) d 2j 2 ( x)
a0 2
 a1 2
 a2 2
 ...  x  0; 0  x 1
dx dx dx
a0jo (0)  a1j1 (0)  a2j 2 (0)  ...  0
a0jo (1)  a1j1 (1)  a2j 2 (1)  ...  1

Solve for unknowns ao, a1, etc and plug them back into
This is your approximate
u ( x)  a0j o ( x)  a1j1 ( x)  a2j 2 ( x)  ... solution to the strong form
14
Formulation of FEM Model
Solution of Continuous Systems – Fundamental Concepts
Exact solutions
limited to simple geometries and boundary & loading conditions
Approximate Solutions
Reduce the continuous-system mathematical model to a discrete idealization

Variational Weighted Residual Methods


 Rayleigh Ritz Method  Galerkin
 Least Square
 Collocation
 Subdomain
15
Weighted Residual Methods
Weighted Residual Formulations
Consider a general representation of a governing equation on a region V

Lu  0
L is a differential operator
d  du 
eg. For Axial element  EA   P( x)  0
dx  dx 
d d
L EA    P( x)
dx dx

Assume approximate solution u


then Lu  R
16
Weighted Residual Methods
Weighted Residual Formulations
Lu  0 Lu  R

Exact Approximate

ERROR  L  u   R
Objective:
Define u so that weighted average of Error vanishes

Set Error relative to a weighting function w

 w L(u) dV  0
V
or  w R dV  0
V

17
Weighted Residual Methods
Weighted Residual Formulations

w
 w L(u ) dV  0
V
w 1

ERROR

18
Weighted Residual Methods
Weighted Residual Formulations

w  w L(u ) dV  0
V

ERROR

19
Appendix

20
Weighted Residual Methods

 Start with the integral form of governing equations


 Assume functional form for trial (interpolation, shape) functions
 Minimize errors (residuals) with selected weighting functions

x j Power series

sin jx, cos jx Fourier series

w j ( x)   L j ( x) Lagrange

 H j ( x)
Hermite
T ( x ) Chebychev
 j

21
Weighted Residual Methods
 Assume certain profile (trial or shape function) between nodes
J
u ( x)   a j j ( x)
j 1

 L(u )  R( x)  0 , but Residual



  w R dx   wL(u )dx  0 Weighted Residual

22
Weighted Residual Methods
 In general, we deal with the numerical integration of trial or
interpolation functions
 Trial functions:
constant, linear, quadratic, sinusoidal, Chebychev
polynomial, ….
 Weighting functions:
subdomain, collocation, least square, Galerkin, ….

 w( x, y, z) R( x, y, z)dxdydz   wL(u)dv  0
V V

23
General Formulation

 Weighted Residual Methods (WRMs)


 Construct an approximate solution
J
u ( x, y, z )  uo ( x, y, z)   a j  j ( x, y, z)
j 1

Chosen to satisfy I.C./B.C.s if possible


 Steady problems – system of algebraic equations for trial
function j (x,y,z)
 Transient problems – system of ODEs in time

24
Weighted Residual Methods

 Consider one-dimensional diffusion equation


 L(u )  0 Exact solution

 L(u )  R ( x)  0 Approximation

 In general, R 0 with increasing J (higher-order)

 wm ( x, y, z ) R( x, y, z )dxdydz  0, m  1, 2, ,M

 Weak form – integral form, discontinuity allowed


(discontinuous function and/or slope)

25
Weighted Residual Methods
 Weak form – integral formulation

Differential Form: L(u )  0




Exact Integral Form:  w(x, y,z)L(u )dxdydz  0

Discretization :  w (x, y,z)L(u)dxdydz  0
m

 R  0, but “weighted R” = 0
 Choices of shape or interpolation functions?
 Choices of weighting functions?

26
Subdomain Method

 w (x, y,z)L(u )dxdydz  0


m ; L(u )  R  0

 Equivalent to finite volume method

1, in Dm
wm  
0, outside Dm

 w L(u)dxdydz  


m Dm
R( x, y, z )dv  0
 Dm : numerical element (arbitrary control volume)
 Dm may be overlapped

27
Collocation Method

 w (x, y,z)L(u )dxdydz  0


m ; L(u )  R  0

 Zero residuals at selected locations (xm, ym, zm)


wm  x     x  xm 

 w  x R  x  dv     x  x  R( x )dv


m m

 R  xm   R  xm , ym , zm 
 No control on the residuals between nodes

28
Least Square Method

 w (x, y,z)L(u )dxdydz  0


m ; L(u )  R  0
 Minimize the square error
 R
 R ( x, y, z, am )dxdydz  0   Rdxdydz  0
2

am V V
am
R Square error
wm  x   R2  0
am
1 
 wm  x R  x  dx  2 am  dx  0 R2  0
2
R

29
Galerkin Method

 w (x, y,z)L(u )dxdydz  0


m ; L(u )  R  0

 Weighting function = trial (interpolation) function

wm  x   m  x 

 w  x R  x  dx     x  R  x  dx
m m

 For orthogonal polynomials, the residual R is orthogonal to


every member of a complete set!

30
Numerical Accuracy

 How do we determine the most accurate method?


 How should the error be “weighted”?
 Zero average error?
 Least square error?
 Least rms error?
 Minimum error within selected domain?
 Minimum (zero) error at selected points?
 Minimax – minimize the maximum error?
 Some functions have fairly uniform error distributions comparing
to the others

31
Application to an ODE

 Consider a simple ODE (Initial value problem)


 dy
  y 0 , 0 x1
 dx  y  e x


 y (0)  1
 Use global method with only one element
 Select a trial function of the form of
N
y  1 ajx j
j 1

 Automatically satisfy the auxiliary condition


 aj = constant, not a function of time

32
Application to an ODE

 Consider a cubic interpolation function with N = 3


N
y  1   a j x j  1  a1 x  a2 x 2  a3 x 3
j 1

 QUESTION: Which cubic polynomial gives the best fit to the


exact (exponential function) solution?
 Definition of best fit?
 Zero average error, least square, least rms, …?

33
Residual

 Substitute the trial function into governing equation


dy N  N
j 
N
R  L( y )   y   ja j x   1   a j x   1   a j x j 1 ( j  x)
j 1

dx j 1  j 1  j 1

 For cubic interpolation function N = 3


R( x)  1  a1 (1  x)  a2 (2x  x 2 )  a3 (3x 2  x 3 )
 (a1  1)  (2a2  a1 ) x  (3a3  a2 ) x 2  a3 x 3  0
 The residual is a cubic polynomial  R  0
 Determine the optimal values of aj to minimize the error (under
pre-selected weighting functions)

34
Subdomain Method
 Zero average error in each subdomain
D1 D2 D3
Uniform spacing
x0 x1 x2 x3
xm
1 xm  a a a 
0
wm Rdx  
xm1
R( x)dx  0  (a1  1) x  (a2  1 ) x 2  (a3  2 ) x 3  3 x 4 
 2 3 4  xm1
 1/ 3 5 8 11 1
m  1 : 0
Rdx  0 
18
a1  a2 
81 324
a3 
3
 1.0156 

ai  0.4219 
2/3 3 20 69 1
m  2 :  Rdx  0  a1  a2 
18 81 324
a3 
3

1/ 3
 0.2813 
 1 1 26 163 1
m  3 :

 2/3
Rdx  0  a1 
18 81
a2 
324
a3 
3

 Note: R(0) = 0.0156  0, R(1) = 0.0155  0


35
Subdomain Method

Net area under each curve = 0

y  1  1.0156 x  0.4219x 2  0.2812x 3


R  0.0156  0.1719x  0.4219x 2  0.2812x 3
Zero average error in each subdomain

36
Subdomain Method

 Nonuniform subdomains?
D1 D2 D3

x0 x1 x2 x3 Grid clustering in high-


D1 D2 D3 gradient regions

x0 x1 x2 x3

m  1 : x1

  x0
Rdx  0
 x2
Different coefficients
m  2 :  Rdx  0 for different choices of

x1
subdomains
m  3 : x3

 x2
Rdx  0

37
Least Square Method

 Minimum square errors over the entire domain


N
R
R( x)  1   am (mx m1  x m )   mx m 1  x m
m 1 am
1 1 R( x)
0
wm Rdx  
0 am
R( x)dx  0
N
 x )dx   a j   mj x m  j 2  ( j  m) x m  j 1  x m  j  dx
1 1
   (mx m 1 m
0 0
j 1

 For arbitrary N (symmetric matrix)


N
 mj 1  1 m
 aj  1   1  
j 1  m  j 1 m  j 1  m 1 m 1

38
Least Square Method

 For cubic interpolation function (N=3)


R   a1  1   2a2  a1  x   3a3  a2  x 2  a3 x 3
 R
   1  x  Rdx  0
1
m  1, w1   1 x
 a1
0

 R
   2x  x 2  Rdx  0
1
m  2, w2   2x  x 2

 a2 0

 R
 3x  x    3x 2  x 3  Rdx  0
1
m  3, w3 
2 3

 a3 0

 Nonuniform weighting of residuals over the domain

39
Least Square Method

 Cubic trial function


3
 mj mj  m
 aj   
j 1  m  j 1 m  j  1  m  1
 1 1 1 1
m  1 , 3 a1  4 a2  5 a3  2
 1.0131 
 1 8 2 2 0.4255 
 m  2 , a1  a2  a3   ai   
 4 15 3 3
0.2797 
 1 2 33 3
m  3 , 5 a1  3 a2  35 a3  4

 R(0) = 0.0131  0, R(1) = 0.0151  0

40
Least Square Method

Weighted average errors = 0


Minimum sqaure error

41
Least Square Method
Weighted average error =
Net area under curve = 0

Weighted average error = 0

Weighted average error = 0

42
Galerkin Method

 Weighting function = Trial function


 m ( x )  x 0
, x 1
, x 2
, x 3
, , x N 1


 m
w ( x )   m ( x )  x m1

N
R( x)  1   am (mx m1  x m )
m 1

 jx  x m j 1  dx
N
dx   a j 
1 1 1 1
 wm Rdx   x R( x)dx  0    x
m 1 m 1 m j 2
0 0 0 0
j 1

N
 j 1  1
 
j 1   


 j
a 
j m 1 j m  m
N

S
j 1
mj a j  dm  SA  D

43
Galerkin Method

 For cubic interpolation function (N=3)

R   a1  1   2a2  a1  x   3a3  a2  x 2  a3 x 3
m  1, W  x0  1 1
  Rdx  0
 1 0
 1
m  2, W2  x  x
1
  xRdx  0

0

m  3, W3  x 2
1
  x 2 Rdx  0
 0

 Small weighting of residuals near x = 0


 Largest weight for residuals near x = 1

44
Galerkin Method
 Cubic trial function
3
 j 1  1
 a j   
j 1  m  j 1 m  j  m
 1 2 3
m  1, 2
a1  a2  a3  1
3 4
  1.0141 

a1  a2  a3   ai  0.4225 
1 5 11 1
m  2,
 6 12 20 2
0.2817 
 1 3 13 1
m  3, a1  a2  a3 
 12 10 30 3

 y( x)  1  1.0141x  0.4225x  0.2817 x
2 3



 R ( x )  0.0141  0.1691x  0.4226 x 2
 0.2817 x 3

 R(0) = 0.0141  0, R(1) = 0.0141  0


45
Galerkin Method

W1 = 1
Weighting functions
W2 = x
W3 = x2

Weighted residuals xR

x2R

46
Galerkin Method

Order of
approximation:
Linear, Quadratic, and Cubic
Trial functions

47
Galerkin Method

48
Galerkin Method
 Alternative choice of weighting functions
R  (a1  1)  (2a2  a1 ) x  (3a3  a2 ) x 2  a3 x 3
3
 1  (1  x)a1  (2x  x 2 )a2  (3x 2  x 3 )a3  1   a j j
j 1

m  1, W  1  x 1
  (1  x ) Rdx  0
 1 0
 1
 m  2, W2  2x  x 2
  (2x  x 2 ) Rdx  0

0

m  3, W3  3x 2  x 3
1
  (3x 2  x 3 ) Rdx  0
 0

 More uniform weighting functions


 Identical to the least square method
49
Collocation Method

 R = L(u) = 0 at collocation points


x0 x1 x2 R(u )  0 but R(u )  0
1
0
wm Rdx  R( xm )  (a1  1)  (2a2  a1 ) xm  (3a3  a2 ) xm2  a3 xm3
m  1 : x1  0  a1  1
  1   1 

ai   3 / 7   0.4286 
1 1 3 5
 m  2 : x2   a1  a2  a3  1
 2 2 4 8
 2 / 7  0.2857 
m  3 : x3  1  a2  2a3  1
3 2 2 3 5
y ( x)  1  x  x  x  y (1)  2  e  2.71828
7 7 7
 Identical to Galerkin method if the residuals are evaluated at x =
0.1127, 0.5, 0.8873
50
Collocation Method

Zero residuals at collocation points


R(0) = R(0.5) = R(1) = 0

But y  yexact at
collocation points
y(1) = 2.7142857  e

51
Taylor-series Expansion

 Truncated Taylor-series

2 3
 1   1 
 ai  1 / 2    0.5 
x x
e  1 x  
x

2 ! 3!
1 / 6  0.1667 

 R(0) = 0, R(1) =  1/6 =  0.1667  0


 Poor approximation at x = 1
 Power series has highly nonuniform error distribution

52
Interpolation Functions

53
Numerical Accuracy

54
Interpolation Functions

Comparison of
numerical errors
for weighted
residual methods

55

Potrebbero piacerti anche