Method of Finite Elements I

Method of Finite Elements I

Method of Finite Elements I PhD Candidate - Charilaos Mylonas HIL H33.1 Quadrature and Boundary Conditions, 26 March, 2018 Institute of Structural Engineering Method of Finite Elements I 1 Quadrature Boundary conditions Outline 1 Quadrature Integration in 1D Integration in 2D and 3D 2 Boundary conditions Penalty method Lagrange multiplier method Institute of Structural Engineering Method of Finite Elements I 2 Quadrature Integration in 1D Boundary conditions Integration in 2D and 3D Outline 1 Quadrature Integration in 1D Integration in 2D and 3D 2 Boundary conditions Penalty method Lagrange multiplier method Institute of Structural Engineering Method of Finite Elements I 3 Quadrature Integration in 1D Boundary conditions Integration in 2D and 3D Integration Basic numerical integration Riemann sum Comments: Both simple but inefficient! useful techniques in other contexts we use many more points than needed Trapezoidal rule in order to achieve good accuracy Institute of Structural Engineering Method of Finite Elements I 4 Quadrature Integration in 1D Boundary conditions Integration in 2D and 3D Numerical Integration in 1D example: Euler-Bernoulli beam We are going to apply the Galerkin method to the Euler Bernoulli beam, but with the basis 2 3 4 N1(x) = x N2(x) = x N3(x) = x ··· Instead of the Hermite basis functions, and discretize only displacements! Strong form: d2 d2w EI(x) = f(x) dx2 dx2 multiply with test function u(x) and integrate by parts twice a Z 1 d2w(x) d2u(x) Z 1 EI(x) dx = f(x)u(x)dx 2 2 0 dx dx 0 a 1 boundary terms [·]0 zero by basis selection Institute of Structural Engineering Method of Finite Elements I 5 Quadrature Integration in 1D Boundary conditions Integration in 2D and 3D Numerical integration - Galerkin method code The full commented code of the following demo will be made available to you in case you would like to play around. This code is a comparisson between analytical and numerical evaluation of integrals needed in the implementation of the Galerkin procedure. In the following slides the most important parts of the code are highlighted. Namely: The definition of the load the assembly of the system with analytical integration (symbolic integration) the assembly of the system with numerical integration (Gauss-Legendre) Institute of Structural Engineering Method of Finite Elements I 6 Quadrature Integration in 1D Boundary conditions Integration in 2D and 3D Numerical Integration in 1D results 1 symsx% Coordinate axis 2 symsq(x) 3 % The loading of the beam: 4 q(x) =x.^2 − 0.3∗ x.^4 5 NBASIS= 4; 6 f o ri =1:NBASIS 7 Phi(i)=x.^(i+1); 8 end 9 % Compute the integrals needed for the stiffness matrix: 10 f o ri=1:NBASIS 11 f o rj=1:NBASIS 12 K(i,j)= ... 13 i n t(EI ∗ d i f f(Phi(i),2) ∗ d i f f(Phi(j),2),0,L); 14 end 15 % Analytical computation of the load vector: 16 f(i)= int(q(x) ∗ Phi(i),0,L); 17 end Institute of Structural Engineering Method of Finite Elements I 7 Quadrature Integration in 1D Boundary conditions Integration in 2D and 3D Numerical integration for LHS 1 q u a d r o r d e r= QUAD ORD; 2 3 %Loading the Gauss−Legendre quadrature nodes 4 % and weights fora file: 5 n o d e s w e i g h t s=W f q u a d r o r d e r −1g; 6 nodes=(nodes w e i g h t s.nodes+1) ∗L/2; 7 w e i g h t s=W f q u a d r o r d e r −1g.weights; 8 9 f o ri=1:N b a s i s 10 f o rj=1:N b a s i s 11 V= eval(subs(EI ∗ d i f f(Phi(i),2) ∗ d i f f(Phi(j),2),nodes)); 12 K approx(i,j)=V' ∗ w e i g h t s; 13 % Note that we don't integrate analytically! 14 % we can get EXACT results without doing so 15 end 16 17 f a p p r o x(i)= eval(subs(Phi(i) ∗q(x),nodes))' ∗ w e i g h t s; 18 end Institute of Structural Engineering Method of Finite Elements I 8 Quadrature Integration in 1D Boundary conditions Integration in 2D and 3D Numerical Results Institute of Structural Engineering Method of Finite Elements I 9 Quadrature Integration in 1D Boundary conditions Integration in 2D and 3D Conclussions Notice the errors in the approximation (1:7e−13 for quadrature of order 4!). This is close to machine precission (the "eps" command in matlab). 1D Quadrature order "N" means we evaluate the function inside the integral "N" times, and we sum the results according to some weight (see next slide). Instead of integrating analytically a function, we can get EXACT results by carefully selecting points of evaluation (instead of regular intervals as in trapezoidal and Riemann sums). The accuracy of the approximation depends on the Gaussian quadrature order Institute of Structural Engineering Method of Finite Elements I 10 Quadrature Integration in 1D Boundary conditions Integration in 2D and 3D Optimal points and weights integration for polynomials: Quadrature - Optimal weights given the nodes n For a polynomial f(x) = a0 + a1x + ··· + anx , the integral is approximated as N Z 1 X f(x)dx ' wif(xi) −1 i=1 2 3 Assume xi are given. Also, for simplicity, f(x) = a0 + a1x + a2x + a3x . Then, Z 1 Z 1 Z 1 Z 1 2 3 a0 dx + a1 xdx + a2 x dx + a3 x dx = −1 −1 −1 −1 4 X 2 3 wi(a0 + a1xi + a2xi + a3xi ) i=1 We equate all the terms, for every ai term. we arrive at the following linear system: 2 3 8 9 8 R 1 dx 9 1 1 1 1 > w1 > > −1 > > > > R 1 xdx > 6 x1 x2 x3 x4 7 < w2 = < −1 = 6 2 2 2 2 7 = 1 x x x x w R x2dx 4 1 2 3 4 5 > 3 > > −1 > 3 3 3 3 :> ;> > R 1 3 > x1 x2 x3 x4 w4 : x dx ; −1 | {z } Vandermonde matrix Institute of Structural Engineering Method of Finite Elements I 11 Quadrature Integration in 1D Boundary conditions Integration in 2D and 3D Non-Gaussian Quadrature Numerical computation of weights N-point quadrature, extact for polynomials up to degree N-1 Weights can be negative, in practice they have values of very different scales and solution of the system for high order quadrature is numerically unstable! The technique will approximate well integrals of functions that are approximated well with the corresponding polynomials. Lower order quadrature works, but as we will see it is far from the best we can do! (half as good). Institute of Structural Engineering Method of Finite Elements I 12 Quadrature Integration in 1D Boundary conditions Integration in 2D and 3D Legendre polynomials In the following, we will see how the Legendre polynomials are important for quadrature in 1D. We are to use xi such that this integral is exact for every polynomial f(x) with degree n < 2N − 1. For a given N, solution xi are roots of the Legendre orthogonal polynomial of degree N Institute of Structural Engineering Method of Finite Elements I 13 Quadrature Integration in 1D Boundary conditions Integration in 2D and 3D Orthogonal polynomials a Legendre orthogonal polynomials Lnsatisfy (by construction) : Z 1 2 hLk;Lmi = Lk(x)Lm(x)dx = δmk −1 2m + 1 From now on this integral is going to be refered to as L2 inner product. Formulas for the first few polynomials areb, L0(x) = 1 L1(x) = x 1 2 L2(x) = (3x − 1) 2 1 3 L3(x) = (5x − 3x) 8 1 4 2 L4(x) = (35x − 30x + 3) 8 aThere are more general definitions of orthogonality and Gaussian quadrature where R hf; giw = Ω f(x)g(x)w(x)dx. The resulting polynomials are useful in other important contexts (stochastic finite elements!) bThey are computed with a process known as Gram-Schmidt orthogonalization Institute of Structural Engineering Method of Finite Elements I 14 Quadrature Integration in 1D Boundary conditions Integration in 2D and 3D Legendre orthogonal polynomials and quadrature The roots of Legendre polynomials of degree N, used as integration nodes, yield the exact integral for f polynomial of maximum degree 2N − 1. Outline of proof: 2N−1 1 consider a polynomial f2N−1(x) = a0 + a1x + ··· + a2N−1x 2 Apply polynomial divission with Legendre polynomial of degree N: f2N−1(x) = g(x) LN (x) + r(x) |{z} |{z} degree≤N−1 degree≤N−1 (N) (N) 3 fx1 ; ··· ; xN g are the N roots of the Legendre polynomial of degree N. For brevity, we (N) ommit the superscript xi = xi. Chose the quadrature nodes to be these exact points: 0 N 0 N Z 1 : Z 1 : X X g(x)Ln(x)dx + r(x)dx = wig(xi)Ln(xi) + wir(xi) −1 −1 i=1 i=1 4 Since Ln(xi) = 0, the first term of the RHS vanishes. Moreover, since the degree of g(x) is lower than N, the first integral term on the left is also zero! That is, through orthogonality and the abillity to express polynomials of order N − 1 with a polynomial basis that contains all the monomials (such as the Legendre basis order N)! Institute of Structural Engineering Method of Finite Elements I 15 Quadrature Integration in 1D Boundary conditions Integration in 2D and 3D Considering again that we are evaluating the quadrature rule on the roots of Legendre polynomial of degree N, the term LN becomes zero : 0 f2N−1(xi) = g(xi)LN(xi) + r(xi) = r(xi) Finally we are left with N Z 1 Z 1 X f2N−1(x)dx = r(x) = wif2N−1(xi) −1 −1 i=1 And we are left with the task of determining the weights as in the non-gaussian case.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    27 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us