Strong to Weak Form Conversion: How and Why

0 downloads 163 Views 181KB Size Report
Integrate: (. ) ( ). 1. 1. 1. ,. ,. ,. ,. 0. 0. 0. ( ) v v v x x x x au u dx au u dx fu x dx. −. −. −. = ∫. ∫.
Strong, Weak and Finite Element Formulations of 1-D Scalar Problems ME 964; Krishnan Suresh 1. From Strong to Weak Strong statement:

d  du  −a  = f dx  dx 

u(0) = 0; −au,x (1) = −Q

(1.1)

To convert into weak form: 1. Multiply ODE by a virtual function u v (x ) satisfying u v (0) = 0 :

(−au,x ),x u v

= fu v

(1.2)

2. Shift Derivatives: Recall that

(−au,x u v ),x

≡ (−au,x ),x u v + (−au,x ) u,vx

(1.3)

Thus, replacing LHS

(−au,x u v ),x − (−au,x )u,vx

= fu v

(1.4)

3. Integrate: 1

1

1

∫ (−au u ) dx − ∫ (−au )u dx = ∫ fu (x )dx v

,x

v ,x

,x

,x

0

v

0

(1.5)

0

i.e., 1

−au,x u v  + au,x u,vxdx =  0 ∫ 1

0

1

∫ fu (x )dx v

(1.6)

0

4. Apply boundary conditions: 1

−Qu v (1) + ∫ au,x u,vxdx =

1

∫ fu (x )dx

0

v

(1.7)

0

i.e., 1

∫ au

1

u dx =

v ,x ,x

0

∫ fu (x )dx + Qu (1) v

v

(1.8)

0

5. Arrive at weak statement:

Find u(x ), where, u(0) = 0, s.t. 1

∫ au

1

u dx =

v ,x ,x

0

∫ fu (x )dx + Qu (1) v

v

0 v

∀u v (x )where, u (0) = 0

2. Graphical Interpretation of Strong & Weak Forms Strong form:

(1.9)

Strong Form du dx du Fourier Law : q( x) = − a dx Balance Law : Heat balance in x

f ( x)

u ( x) Kinetic Law

Kinetic Law : g ( x ) = −

Balance Law

q ( x)

g ( x)

q( x + dx) − q ( x ) = f ( x )dx dq = f dx d  du   −a  = f dx  dx 

Material Law

d  du   −a  = f dx  dx 

Differential Equation :

4

Weak Forms f ( x)

u ( x)

u v ( x)

Kinetic Law

g v ( x)

q( x)

g ( x) Material Law

v

du du & gv = − dx dx du Fourier Law : q = − a dx Kinetic Law : g = −

1

1

0

0

Virtual Work Law: ∫ qg v dx = ∫ fu v dx 1 v  du   du  v − a − dx =     ∫0  dx   dx  ∫0 fu dx 1 1 v  du   du  v ∫0  a dx   dx  dx = ∫0 fu dx 1

7

3. Equivalence Equation (1.1) is 'equivalent' to Equation (1.9). Consider the example:

d  du  −  = 1 u(0) = 0; u,x (1) = −1 (1.10) dx  dx  i.e., f = 1 & Q = −1 The exact solution is u(x ) = −x 2 / 2 as one can easily verify. Let us find the same solution via Equation (1.9). Search for a solution of the form u(x ) = Ax + Bx 2 (satisfies the essential boundary condition). Similarly, let

u v (x ) = Av x + B v x 2 . Substituting in Equation (1.9): Find A & B, s.t. 1

∫ (A + 2Bx )(A

v

1

+ 2B x )dx = v

0

∫ (A x + B x v

v

2

)dx − (Av + B v )

(1.11)

2

)dx − (Av + B v )

(1.12)

0

∀Av & B v i.e., 1

1

∫ (A

v

+ 2B x )(A + 2Bx )dx = v

0

∫ (A x + B x v

v

0

i.e., 1

∫ {A

v

B

0

v

}

 1    1 2x 2x   

{

}

A   dx = B   

1

∫ {A

v

B

v

0

}

1 B v   1 

 x  v  2  dx − A x   

{

}

(1.13)

i.e.,

{

v

A

B

v

}

1   ∫ 0

 1   A v   1 2x dx    = A 2x    B      

1   ∫ 0

1  2x 

{

}

1

{

B

v

}∫ 0

1 B v   1  

 x    dx − Av  2 x   

{

}

(1.14)

1   1 

(1.15)

i.e.,

{A

v

B

v

}

2x   A dx    = Av   2 4x   B    

{

1

B

v

}∫ 0

 x  v  2  dx − A x   

{

B

v

}

i.e.,

1 1  A    = Av B v   B  1 4 / 3     Find A & B, s.t.

1/ 2  − Av B v  1/ 3  

1 1  A    = Av B v   B  1 4 / 3     ∀Av & B v

−1/ 2  B v   −2 / 3  

{

Av

{

Av

}

}

{

{

}

{

1 B v   1  

}

}

(1.16)

(1.17)

This is true if and only if:

1 1  A −1/ 2      1 4 / 3 B  = −2 / 3       i.e., A = 0, B = −1/ 2 , i.e., u(x ) = −x 2 / 2 . We obtain the same solution.

(1.18)

4. Why Weak Formulation? Consider the example:

d  du  −1 −  =   dx  dx  1 + x 2

u(0) = 0; u,x (1) = 0

(1.19)

It is difficult to integrate Equation (1.19) to obtain the exact solution. So, let us try an approximate solution: u(x ) = Ax + Bx 2 where A and B are constants (satisfies the essential boundary condition). Substituting in Equation (1.19), we have:

−B =

−1 1 + x2

A + 2B = 0

(1.20)

The above suggests that B is not a constant (that's about it!!). Now consider the weak formulation. As before, let u(x ) = Ax + Bx 2 and

u v (x ) = Av x + B v x 2 . Substituting: Find A & B, s.t.

{A

v

B

v

}

1 1  A    1 4 / 3 B  =    

1

∫ 0

 −1  (Av x + B v x 2 )  dx 1 + x 2 

(1.21)

∀Av & B v Evaluate right hand side numerically, we have:

1 1  A  −0.3469       1 4 / 3 B  = −0.21439       i.e., u(x ) ≈ −0.75x + 0.4x 2

(1.22)

Weak formulations naturally promote computing approximate solutions to challenging problems, and are 'equivalent' to strong forms.

5. Finite Element Solutions of Weak Formulation Consider the model problem:

Find u(x ), where, u(0) = 0, s.t. 1

∫ au

1

u dx =

v ,x ,x

0

∫ fu (x )dx + Qu (1) v

v

(1.23)

0

∀u v (x )where, u v (0) = 0 Break up the domain into finite elements; thus: x i +1

∑∫ e

xi

x i +1

au,x u,vxdx = ∑ ∫ fu vdx + Qu v (1) e

(1.24)

xi

Define linear shape functions:

1 − ξ  1 + ξ  L1(ξ ) =  ; L2 (ξ ) =  , −1 ≤ ξ ≤ 1    2   2  Now, let (over a single element):

(1.25)

x = L1 (ξ )x i + L2 (ξ )x i +1 u = L1(ξ )ui + L2 (ξ)ui +1

(1.26)

u v = L1(ξ )uiv + L2 (ξ )uiv+1 Note that:

x − xi dx h = L1,ξ x i + L2,ξ x i +1 = i +1 = 2 2 dξ

{

u,x =

2 2 L1,ξui + L2,ξui +1 ) = L1,ξ ( h h

u,vx =

2 2 v L1,ξuiv + L2,ξu,vi +1 ) = ui ( h h

{

 ui  L2,ξ u   i +1  L1,ξ  u,vi +1   L2,ξ   

}

(1.27)

}

Considering integration over a single element:L

L1,ξ  2 u,vi +1   L1,ξ L2,ξ L2,ξ  h −1    1 L1,ξ L1,ξ L1,ξ L2,ξ    ui      a  d ξ ui +1   ∫ L L L L 2,ξ 2,ξ  −1  2,ξ 1,ξ    

x i +1



1

∫a

au,x u,vxdx =

xi

=

{

2 v ui h

u,vi +1

{

}

2 v ui h

{

}

 ui  h u  d ξ  i +1  2

}

(1.28)

and x i +1



L1  h u,vi +1   d ξ L2  2  

1

fu vdx =

∫ {

}

f uiv

−1

xi

Thus, from Equation (1.24) and Equation (1.28), we have:

{

2 v ui ∑ e h 1

 1 L1,ξ L1,ξ  u,vi +1  ∫ a   −1 L2,ξ L1,ξ 

}

{

= ∑ ∫ f uiv e

u,vi +1

}

−1

L1,ξ L2,ξ    ui  d ξ   L2,ξ L2,ξ   ui +1  

L1  h   d ξ + Qu v (1)   L2  2  

(1.29)

The element stiffness matrix and element forcing vector are : 1 L1,x L1,x h  Ke =  ∫ a  2  −1 L2,x L1,x  1 L1  h fe = ∫ f   d ξ L2  2 −1   

L1,x L2,x   d ξ  L2,x L2,x   

(1.30)

After assembly, and eliminating the virtual variables, we have:

Ku = f

(1.31)

where

K = ∑ Ke e

f = ∑ fe + fQ e

(1.32)

The essential (Dirichlet) boundary conditions are imposed via the Lagrange multiplier method:

Ku = f

(1.33)

where

K C T  f  u   , u =   , f =   K =  (1.34) λ     b  0  C      where C & b capture the boundary condition at x = 0 . The variables λ are the Lagrange multipliers that contain useful information about the sensitivity of the essential boundary conditions.

6. Non-Linear Problems Equations (1.31) and (1.33)is valid for both linear and non-linear problems. For linear problems, the equation is solved once since the stiffness matrix and forcing vector are independent of u . On the other hand, for non-linear problems, either the stiffness matrix or the forcing vector or both is dependent on u . So, Equation (1.31) reads: (1.35) [K (u )]u = f (u ) where:

K (u ) = ∑ Ke (u ) e

(1.36)

f (u ) = ∑ fe (u ) + fQ e

and 1 L1,ξ L1,ξ 2  Ke (u ) =  ∫ a(u )  h  −1 L2,ξ L1,ξ 1 L1  h fe (u ) = ∫ f (u )   d ξ L2  2 −1  

L1,ξ L2,ξ   d ξ  L2,ξ L2,ξ   

(1.37)

while Equation (1.33) reads

K (u )u = f (u )

(1.38)

i.e., a non-linear problem. We will consider two different methods of solving Equation (1.38): 1. Picard iteration 2. Newton Raphson iteration

6.1 Picard Iteration Theorems (for Picard's Method) Theorem 1: (Banach's Fixed Point Theorem) If ϕ(x ) : ℜn → ℜn is a continuous function such that: d (ϕ(x ), ϕ(y )) < d (x , y ), ∀x , y (1.39) n where d (.,.) is an appropriate metric defined in ℜ , then the iteration:

x n +1 = ϕ(x n )

(1.40)

will converge (to a fixed point of ϕ(x ) ). Theorem 2: If ϕ(x ) is a differentiable function in a range [a, b ] , then ϕ(x ) has a unique fixed point if ϕ,x (x ) < 1 for all x ∈ [a, b ] . Proof: Mean Value Theorem. From Equation (1.38), ϕ(u ) : K (u )

−1

f (u )

Suppose:

K (u )  

−1

f (u ) − K (v )

−1

f (u ) < u − v , ∀u, v

(1.41)

then the Picard iteration for Equation (1.35) will proceed as follows: 1. Guess u 0 (say 0). Set n = 0. 2. Assemble K (u n ) & f (u n )





−1

= K (u n ) f (u n ) 4. Stop when u n +1 − u n < ε , else go to step 2. 3. Compute u

n +1

Of course, establishing Equation (1.41) is not easy … a case-by-case analysis at best! We will later consider stiffening versus softening non-linear problems, and study the convergence of Picard iteration.

6.2 Newton-Raphson Iteration Theorem (for N-R Method): If h(x ) is a second order differentiable in [a, b ] , and if

h(x * ) = 0 where x * = [a, b ] , and h,x (x * ) = 0 then the sequence:

x n +1 = x n − h(x n )/ h,x (x n )

(1.42)

*

will converge to x Proof: See popular text-books on numerical methods. Derivation of the Tangent Matrix The non-linear equation that we must solve is:

R(u ) = [K (u )]u − f = 0

(1.43)

Applying Equation (1.42): −1

u n +1 = u n − [T (u n )] R(u n ) where T (u n ) is the tangent or Jacobian matrix given by:   ∂ ∑ K im um   m ∂Ri  Tij = = ∂u j ∂u j Considering a single element (for linear shape functions m = 1, 2 ):  2 e  ∂ ∑ K im um  e e 2 2 2  ∂ (K im um )  ∂K im e ∂um Tije = m =1 =∑ =∑ um + ∑ K im ∂u j ∂u j ∂u j m =1 m =1 ∂u j m =1

(1.44)

(1.45)

(1.46)

Considering the definition of element stiffness matrix in Equation (1.30), we have: 1 h 1 ∂u   h   a ( x , u ) L L d ξ = a ( x , u ) L L d ξ   i , x m , x , u i , x m , x  2 ∫   2 ∫ ∂u j  −1  −1 Further, since u = L1u1 + L2u2 , we have: e h 1  ∂K im =  ∫ a,u (x , u )Lj Li,x Lm,xd ξ  ∂u j  2 −1  e ∂K im ∂ = ∂u j ∂u j

(1.47)

(1.48)

The second term in Equation (1.46):

∂ um = K ije ∂u j

2

∑K

e im

m =1

(1.49)

Thus, substituting Equation (1.48) and Equation (1.49) in Equation (1.46), we have:

h 1   T = ∑  ∫ a,u (x , u )Lj Li,x Lm ,xd ξ  um + K ije  m =1   2 −1 h 1  2  e Tij =  ∫ a,u (x , u )Lj Li ,xd ξ  ∑ Lm ,x um + K ije  m =1  2 −1 2

e ij

(1.50)

(1.51)

Thus, Equation (1.51) is used to assemble the tangent matrix. Applying zero boundary conditions on ∆u n , we have:

T (u n ) C T  ∆u n  R(u n ) =         C      ζ 0 0      

(1.52)

Thus, we must assemble both the stiffness matrix and the tangent matrix T (u n ) defined via Equation in each step. Thus, the Newton-Raphson iteration will proceed as follows: 1. Guess u 0 (say 0). Set n = 0. 2. Assemble [K (u n )] & f (u n ) 3. Assemble/ compute [T (u n )] & R(u n ) −1

4. Compute ∆u n +1 = T (u n ) R(u n ) per Equation (1.52) 5. Compute u n +1 = u n + ∆u n +1 6. Stop when u n +1 − u n < ε , else go to step 2.