Weak form of Boundary Value Problems Simulation Methods in Acoustics
Note on finite dimensional description of functions Approximation: N f (x) ˆf (x) = q j φ j (x) j=1 Residual function: r(x) = f (x) ˆf (x) Collocation and Galerkin with test functions ψ i (x) ψ i, r = for all i = 1, 2... N Collocation: ψ i (x) = δ(x i ) Galerkin: ψi (x) = φ i (x) Other ψ φ choices are possible, but not used often in practice
The boundary value problem Given a BVP (PDE + BCs) A{u(x)} = f (x) x Ω (1) B i {u(x)} = ḡ i (x) x Γ i Γ i = Γ (2) A and B i are differential operators Example (Poisson equation) 2 u(x) x 2 = 1 x Ω = [, 1] (3) u(x) = x = (Dirichlet) (4) u(x) x In our example: A = 2 / x 2, f (x) 1 B1 = 1, ḡ 1 (x) B 2 = / x, ḡ 2 1 = 1 x = 1 (Neumann) (5) i
Weak form construction Construction steps: 1. Multiply PDE by a sufficiently well behaved 1 function ψ(x) 2. Integrate over the whole domain Ω 3. Integration by parts as much as possible (shift derivatives) 4. Apply BC 1. Multiply the PDE by the test function ψ(x) ψ(x)a{u(x)} = ψ(x)f (x) x Ω 2. If the equality holds, the integrals must be also equal ψ(x)a{u(x)} dx = ψ(x)f (x) dx ψ(x) Ω Statement: The solution of the weak form must also be the solution of the strong (original) form of the PDE Proof: The weak form must hold for all ψ(x). We can choose test functions that are nonzero only in B δ (x ) for any x Ω. Thus, the original equation must hold for all x Ω. Then, why it is a weak form? 1 The definition well behaved depends on the type of PDE and BC Ω
Weak form example I. Look at the Poisson equation example: 2 u(x) x 2 = f (x) x Ω = [, 1], f (x) 1 1. Multiply by the test function ψ(x) ψ(x) 2 u(x) x 2 2. The weak form is written as ψ(x) 2 u(x) x 2 dx = Ω = ψ(x)f (x) Ω ψ(x)f (x) dx 3. Apply integration by parts on the l.h.s. Recall that x 2 x 1 f g dx = [fg] x2 x 1 x 2 x 1 fg dx With f = u/ x and g = ψ(x) [ ψ(x) u(x) ] 1 1 ψ(x) u(x) + dx = x x x 1 ψ(x)f (x) dx
Weak form example II. 4. Apply boundary conditions u() = u(x) x = 1 x=1 ( ψ x=1 + ψ u ) + x x= 1 ψ u x x dx = 1 ψ(x)1 dx Let s compare the strong and weak forms Strong: 2nd derivative of u, Weak: 1st Strong: f continuous on Ω, Weak: integrable (f ψ integrable) The weak form imposes less strict criteria on u and f! But it requires some conditions for ψ(x). We can express these criteria using function space definitions: Strong: u C 2 (Ω), f C (Ω) Weak: u C 1 (Ω), f C 1 (Ω), u, u/ x L 2 (Ω)
Sobolev space definition Square-integrable functions (in Lebesgue sense) { } L 2 (Ω) = f : Ω R f 2 = f 2 dx < Sobolev space the function and its derivatives are in L p H 1 (Ω) = { f L 2 (Ω), f } x L2 (Ω) Note: derivatives are meant in a weak sense g(x) is the weak derivative of u, i.e. g = u/ x if and only if ψ(x) ψ(x)g(x) dx = u(x) dx ψ(x) C (Ω) Ω Ω x The weak derivative is unique Note: C (Ω) means infinite times differentiable functions having a compact support on Ω Ω
Example: solve the weak form Let s search the solution in the form: u(x) = Ax + Bx 2 ψ(x) = Âx + ˆBx 2 Find A, B such that the weak form is satisfied for all Â, ˆB Substitute: Âx + ˆBx 2 x=1 + (Âx + 2 ˆBx ) ( A + 2Bx + 1 ) ( ) (Â + 2 ˆBx A + 2Bx dx = 1 Rearrange (A and B on l.h.s.) [Â ˆB ] 1 [ ] [ ] 1 [1 ] A 2x dx = [ Â ˆB ] ( 1 2x B Evaluating the integrals [Â [ ] [ ] 1 1 A [Â ˆB] = 1 4/3 B [ ] 1/2 ˆB] 2/3 ) x= (Âx + ˆBx 2 ) dx We obtain the solution: A =, B = 1/2, thus u(x) = x 2 /2 [ ] x x 2 dx [ Â ˆB ] [ ]) 1 1
How did we solve? By choosing the trial functions (u(x) = Ax + Bx 2 ) the trial function space was discretized (x and x 2 are its two elements). Thus, we arrived at a finite dimensional problem (number of dimensions is d = 2 in this example) By letting ψ(x) = Âx + ˆBx 2 we used the Galerkin method. Note that we cannot apply the collocation method (ψ i = δ(x i )) as ψ/ x must be in L 2 By means of the discretization the BVP was reduced to an algebraic set of linear equations! Thus, in the end a system of linear equations was solved. In this case, we luckily got the analytical solution, however, in general we only get an approximate solution
Another solution Let s solve with a different right hand side: 2 u(x) x 2 = 1 1 + x 2 u() =, u (1) = All the same until we get [Â [ ] [ 1 1 A ˆB] 1 4/3 B By dropping [ Â ˆB ] [ ] [ ] 1 1 A = 1 4/3 B ] = [ Â ˆB ] 1 [ ] log(2)/2 π/4 1 [ ] x 1+x 2 x 2 dx [ Â ˆB ] 1+x 2 [ ] A = B [ ].7425.3959 The discretized weak form gives an approximate solution
Visualization of the example The approximation gets better if we increase the dimensionality of our function space, e.g. by adding higher order polynomials u(x) -.2 -.4 -.6 -.8 Order = 2 Weak solution u(x) -d 2 u(x)/dx 2 f = -1/(x 2 + 1) -1.2.4.6.8 1 x u(x) -.2 -.4 -.6 -.8-1 Order = 5 Weak solution u(x) -d 2 u(x)/dx 2 f = -1/(x 2 + 1) -1.2.2.4.6.8 1 x
Beam example I. Solve the following BVP (static deflection of a clamped free Euler Bernoulli beam) EIu (x) = f (x) Construct the weak form EI u() = u () = (Dirichlet) u (L) = u (L) = (Neumann) L ψ(x)u (x) dx = L Integration by parts once... ( ) L EI [ψu ] L ψ u dx = ψ(x)f (x) dx L... and twice ( ) L EI [ψu ] L [ψ u ] L + ψ u dx = f ψ dx L f ψ dx
Beam example II. Choose the test and trial function spaces as ( ) iπ φ i = ψ i = sin i = 1... n 2L ( ) (i n)π φ i = ψ i = cos i = n + 1... 2n = N 2L Note: by letting ψ i = φ i we use the Galerkin method The approximations using the above spaces reads as u(x) û(x) = ψ(x) ˆψ(x) = N q j φ j (x) = φ(x)q j=1 N w j φ j (x) = w T φ T (x) j=1 Note: φ is a row vector, q and w are column vectors
Beam example III. Notice that the expressions [ ψu ] L [ ψ u ] L Can all be written in a similar form φ (α) 1 w T φ(β) 1 φ (α)..... 1 φ (α) φ (α) N φ(β) L 1 φ(β) N N φ(β) N ψ u dx q 1. Integration L dx or evaluation of φ(α) i j (product of shape functions and their derivatives) at a fixed point is needed. Each term gives an N N matrix in the square brackets. On the r.h.s. we have a column vector in the brackets L φ 1 (x)f (x) w T. dx = w T b φ N (x)f (x) φ (β) q N
Beam example IV. Write the system in matrix notation: EI [ w T (A 1 + A 2 + A 3 ) ] q = w T b Note that this is a scalar equation This must hold for all vectors w T, which is only possible if EI Aq = b Thus, we arrive at a system of linear algebraic equations
Beam example V. Satisfying the BCs Contrary to the previous example, our trial (shape) functions do not satisfy the Dirichlet BCs. (φ i (), φ i () ) Constraints must be imposed: [ ] φ1 () φ 2 () φ N () q 2 { φ 1 () φ 2 () φ N () =. } The same in matrix form: A c q = We already know some methods for constraints...... let s use the Lagrange method [ ] { } { } EI A A T c q b = A c λ This can finally be solved to get q and λ q 1 q N
Beam Solution The weak solution with n = 5 (N = 1) and two discrete loads as shown by the arrows in the figure.4.2 Weak solution Forces u(x) -.2 -.4 -.6.2.4.6.8 1 1.2 x Just to remember: the weak solution is a function ( πx û (x) =.6926 sin 2 ( πx.8171 cos 2 ) +.1739 sin (πx).7489 sin ) + 1.388 cos (πx).5373 cos ( 3πx 2 ( 3πx 2 ) +.3287 sin (2πx).217 sin ).839 cos (2πx) +.53 cos ( ) 5πx 2 ( ) 5πx 2