07 finite elements weq

Upload: modfars

Post on 02-Jun-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 07 Finite Elements Weq

    1/11

    1Finite element method

    Finite Elements: 1D acoustic wave equation

    Helmholtz (wave) equation (time-dependent)

    Regular gridIrregular grid

    Explicit time integration

    Implicit time integratonNumerical Examples

    Scope : Understand the basic concept of the finite elementmethod applied to the 1D acoustic wave equation.

  • 8/10/2019 07 Finite Elements Weq

    2/11

    2Finite element method

    Acoustic wave equation in 1D

    How do we solve a time-dependent problem suchas the acoustic wave equation?

    where v is the wave speed.using the same ideas as before we multiply this equation withan arbitrary function and integrate over the whole domain, e.g. [0,1], and

    after partial integration

    f uvut = 22

    dx f dxuvdxu j j jt =1

    0

    1

    0

    21

    0

    2

    .. we now introduce an approximation for u using our previous

    basis functions...

  • 8/10/2019 07 Finite Elements Weq

    3/11

    3Finite element method

    Weak form of wave equation

    )()(~1

    xt cuu i N

    ii

    =

    =

    together we obtain

    )()(~1

    222 xt cuu i N

    iit t t

    =

    =

    note that now our coefficients are time-dependent!... and ...

    =+1

    0

    1

    0

    21

    0

    2 j j

    iii j

    iiit f dxcvdxc

    which we can write as ...

  • 8/10/2019 07 Finite Elements Weq

    4/11

    4Finite element method

    Time extrapolation

    =+1

    0

    1

    0

    21

    0

    2 j j

    iii j

    iiit f dxcvdxc

    ... in Matrix form ...

    gc Avc M T T =+ 2&&

    M A b

    ... remember the coefficients c correspond to theactual values of u at the grid points for the right choiceof basis functions ...

    How can we solve this time-dependent problem?

    stiffness matrixmass matrix

  • 8/10/2019 07 Finite Elements Weq

    5/11

  • 8/10/2019 07 Finite Elements Weq

    6/11

    6Finite element method

    Mass matrix

    =+ 10

    1

    0

    21

    0

    2 j j

    iii j

    iiit f dxcvdxc

    ... lets recall the definition of our basis functions ...

    =1

    0

    dx M jiij ii

    i

    ii

    i x x x

    elsewhere

    h x for h x

    xh for h

    x

    x =

  • 8/10/2019 07 Finite Elements Weq

    7/11

  • 8/10/2019 07 Finite Elements Weq

    8/118Finite element method

    Matrix assembly

    % ass embl e mat r i x Mi j

    M=zer os( nx) ;

    f o r i =2: nx- 1,

    f o r j =2: nx- 1,

    i f i ==j ,

    M( i , j ) =h( i - 1) / 3+h( i ) / 3;

    el sei f j ==i +1

    M( i , j ) =h( i ) / 6;

    el sei f j ==i - 1

    M( i , j ) =h( i ) / 6;el s e

    M( i , j ) =0;

    end

    end

    end

    % assembl e mat r i x Ai j

    A=zer os( nx) ;

    f o r i =2: nx- 1,

    f o r j =2: nx- 1,

    i f i ==j ,

    A( i , j ) =1/ h( i - 1) +1/ h( i ) ;

    el sei f i ==j +1

    A( i , j ) =- 1/ h( i - 1) ;

    el sei f i +1==j

    A( i , j ) =- 1/ h( i ) ;el s e

    A( i , j ) =0;

    end

    end

    end

    Mij A ij

  • 8/10/2019 07 Finite Elements Weq

    9/119Finite element method

    Numerical example

  • 8/10/2019 07 Finite Elements Weq

    10/1110Finite element method

    Implicit time integration

    ... let us use an implicit finite-difference approximation for the time derivative ...

    gc Avc M T T =+ 2&&

    ... leading to the solution at time t k+1 :

    gc Avdt

    ccc M k

    T k k T =+

    +

    ++

    12

    211 2

    [ ] ( )( )12122

    1 2

    + ++=

    k

    T T T

    k cc M gdt Adt v M c

    How do the numerical solutions compare?

  • 8/10/2019 07 Finite Elements Weq

    11/1111Finite element method

    Summary

    The time-dependent problem (wave equation) leads to theintroduction of the mass matrix.

    The numerical solution requires the inversion of a systemmatrix (it may be sparse).

    Both explicit or implicit formulations of the time-dependent partare possible.

    The time-dependent problem (wave equation) leads to theintroduction of the mass matrix.

    The numerical solution requires the inversion of a systemmatrix (it may be sparse).

    Both explicit or implicit formulations of the time-dependent partare possible.