Solutions Linear Algebra

download Solutions Linear Algebra

of 13

Transcript of Solutions Linear Algebra

  • 8/9/2019 Solutions Linear Algebra

    1/13

    Exercise 1 (1D Petrov-Galerkin for advection-diffusion) Consider the

    following problem:

    u + u = 1, in = (0, 1),u(0) =u(1) = 0,

    (1)

    whereand are two positive constants.1) Give a physical interpretation of the different terms in (1).

    u is a diffusion term, u an advection term and the right-hand side 1is a source term.

    2) Compute the exact solution to (1).Integrating the ODE once leads to

    u + u = x + C

    with Cbeing a constant to be determined by the boundary conditions.The associated homogeneous differential equation u + u = 0 can be inte-grated as:

    u(x) =A exp

    x

    Using the method of variation of the constant, we are looking for a solutionof the non-homogeneous ODE under the form:

    u(x) =A(x)expx

    One finds

    A(x) = 1

    exp

    x

    x +

    + C

    + D

    whereD is as constant. The two boundary conditions give the values of theconstants:

    C= 1

    exp

    1

    and

    D= 1

    exp 1

    Therefore, the exact solution to (1) is:

    u(x) = 1

    x expx

    1

    exp

    1

    (2)

    1

  • 8/9/2019 Solutions Linear Algebra

    2/13

    3) Plot the exact solution for= 1, = 1, 0.1 and0.01. Note theboundary layer in x = 1. Propose an estimation of the thicknessof this boundary layer as a function of and when / is large.The exact solution is reported in Figure 1.

    Figure 1: Exact solution of the ODE for various values of

    The thickness of the boundary layer = 1 x verifies u(x) = 0. Since

    u(x) = 1

    1

    expx

    exp

    1

    x verifies:

    x =

    ln

    + ln

    exp

    1

    when / is large,

    x

    ln

    + 1

    and

    ln

    .

    2

  • 8/9/2019 Solutions Linear Algebra

    3/13

    The larger , the thicker the boundary layer.

    4) Propose a variational formulation of the equation and showthat the problem is well-posed inH10 ().

    Considering the Hilbert Space

    H10 (), 1

    , a variational formulationof the equation can be written as:

    1

    0

    uvdx +

    1

    0

    uvdx=

    1

    0

    vdx, v H10 () (3)

    whereu H10 () is the exact solution to the problem.Leta(u, v) denote the bilinear form:

    a(u, v) = 1

    0

    uvdx + 1

    0

    uvdx

    a is continuous since u, v H10 () :

    |a(u, v)|

    10

    u

    v +

    v

    dx

    Using Cauchy-Schwartz inequality,

    |a(u, v)|

    10

    u2dx

    10

    v +

    v

    2dx

    u1 1

    0v2 +

    2

    2

    v2 dx max

    1,

    u1v1

    max(, ) u1v1

    using the property10

    vv dx= 0. This shows the continuity.Letv H10 ():

    a(v, v) =

    10

    v2dx +

    10

    vv dx

    = 1

    0

    v2dx +

    2

    [v2]10

    =

    1

    0

    v2dx

    2

    10

    v2 + 1

    C

    10

    v2dx

    3

  • 8/9/2019 Solutions Linear Algebra

    4/13

  • 8/9/2019 Solutions Linear Algebra

    5/13

    The matrix associated to the problem is therefore:

    A=

    h

    2 1 + 2

    (0)

    1 2

    . . . . . .

    . . . . . .

    . . .. . .

    . . . 1 + 2

    (0) 1 2

    2

    6) Simulations in Matlab. Take = 1, h = 0.01 and plot thesolutions to(4) for values ofcorresponding to= 1and= 5. Trydifferent values of to determine an instability threshold. What

    is the meaning of this threshold for the matrix of the problem?The right-hand side vector is

    1

    0

    i

    =

    h......h

    The solutions for values of corresponding to= 1 and = 5 are reportedin Figure 2.

    The instability threshold is found for = 2.

    REMARK: This corresponds to the value of for which the matrix is nolonger an M-matrix. The discrete maximum principle is violated.

    Definition: A matrix A= [ai,j ] Rnn is said to be an M-matrix if

    It is invertible and all the entries ofA1 are non-negative.

    All its non-diagonal elements ai,j , i=j are non-positive.

    Property 1: (Continuous maximum principle) The maximum principlefor the advection-diffusion equation u +u = f on a bounded domainx holds, that is:

    f(x) 0 u(x) 0.

    Property 2: (Discrete maximum principle) Let AhUh = bh be a linearsystem associated with a P1 finite element formulation of the advectiondiffusion u +u = f with f(x) 0. Then, ifAh is an M-matrix, thesolution uh of the associated variational formulation satisfies uh(x) 0.

    5

  • 8/9/2019 Solutions Linear Algebra

    6/13

    Figure 2: Numerical solution of the Galerkin-based P1 Finite Element for-mulation for various values of

    6

  • 8/9/2019 Solutions Linear Algebra

    7/13

    Proof: Noticing first that f 0, bjh = 1

    0f jdx 0. Furthermore, Ah

    is invertible and since it is an M-matrix

    Uh = A1h bh 0.

    uh 0 holds since uh(x) =n

    j=1 Ujhj(x).

    A similar inequality exists for the upper bound of the right-hand side,ensuring that the solution remains bounded, and large oscillations cannotoccur.

    7) Letb: [0, 1] Rbe a smooth function such thatb(0) =b(1) = 0and b() > 0 on (0, 1) (b is called a bubble function). We proposeto replace the test function space Vh by another space Wh, whilekeeping the same spaceVh to look for the solution. We defineWhspanned by the functions defined by:

    i= i+

    b

    x xi1

    h

    , x [xi1, xi],

    b

    x xi

    h

    , x [xi, xi+1],

    where xi = ih is the ith node of the mesh. Choose an arbitrary

    bubble functionb and plot the basis functioni. Comment.Two arbitrary bubble functions are chosen here:

    b1(x) =x(1 x), b2(x) = sin(x)

    The two corresponding basis functions are reported in Figure 3 as well asi. The functionsigive more weightupstream than downstream. (here >0).

    8) Consider the problem: search foruh Vh such that

    a(uh, vh) =

    10

    vh, vh Wh (5)

    Compute the matrix associated to this problem. Remark: The

    approach consisting of choosing different spaces for the solutionand the test functions is referred to as thePetrov-Galerkin method.

    A=

    1

    0

    j

    i+

    1

    0

    ji

    7

  • 8/9/2019 Solutions Linear Algebra

    8/13

    Figure 3: Respective basis functions corresponding to the two bubble func-tions b1 andb2,

    8

  • 8/9/2019 Solutions Linear Algebra

    9/13

    The diffusive terms are not affected by the bubble function: 10

    j

    i= 1

    h

    10

    (i b) =

    10

    j

    i+1

    h

    10

    b =

    10

    j

    i+ 0

    The advective terms are modified.

    The matrix associated to the problem is then:

    A=

    2hh

    2

    hh

    (0)

    2

    hh

    . . . . . .

    . . . . . .

    . . .. .

    .

    . ..

    2

    h

    h(0)

    2 h

    h 2h

    h

    with

    h = + h

    10

    b(x)dx

    Defining a Peclet number h = hh

    , the matrix can be written as

    A=h

    h

    2 1 + h2

    (0)

    1 h2

    . . . . . .

    . . . . . .

    . . .. . .

    . . . 1 + h2

    (0) 1 h2

    2

    9) Show that the matrix resulting from the Petrov-Galerkinmethod(5) is the same as that resulting from the Galerkin method(4) up to the modification of the diffusion coefficient. Show thatproblem (5) is equivalent to searching for uh Vh such that

    ah(uh, vh) =

    1

    0

    vh, vh Vh (6)

    where ah is a bilinear form which depends onh.

    ah(uh, vh) =h

    10

    uhv

    h+

    10

    uhvh

    9

  • 8/9/2019 Solutions Linear Algebra

    10/13

    10) How to choose 1

    0 b as a function ofsuch that problem(6)

    is always stable.In order for the matrix to be an M-matrix, a necessary condition is:

    2

    hh

    1

    2

    1

    11) Simulation in Matlab. Take = 1, h = 0.01, a bubble

    function of your choice. Plot the solution to (6) for = 1 and= 5. Comment.

    The right-hand side vector is still:

    10

    i

    =

    h......h

    The bubble functionb2 verifies

    10

    b2= 2

    >1

    2 1

    5

    The corresponding solutions are reported in Figure 4. There are no moreoscillations for= 5.

    12) Prove and comment the following error estimate:

    |uuh|1

    1 +

    a

    infwhVh

    |uwh|1+1

    infwhVh

    supvhVh

    |a(wh, vh) ah(wh, vh)|

    |vh|1

    Hint: First notice that, generally speaking, if a(, ) is -coercive,one always have:

    uX supvX

    a(u, v)vX

    Next prove:

    |uh wh|1 supvhVh

    ah(uh wh, vh)

    |vh|1

    10

  • 8/9/2019 Solutions Linear Algebra

    11/13

    Figure 4: Numerical solution of the Petrov-Galerkin-based P1 Finite Ele-ment formulation for various values of

    11

  • 8/9/2019 Solutions Linear Algebra

    12/13

    and

    ah(uh wh, vh) =a(u wh, vh) + a(wh, vh) ah(wh, vh)Ifa is -coercive

    u2Xa(u, u)

    implies that

    uXa(u, u)

    uXsup

    vX

    a(u, v)

    vX

    Since:

    ah(vh, vh) = h

    1

    0

    v2h

    |vh|21

    ah is -coercive for the norm | |1. Therefore, ifuh, wh Vh:

    |uh wh|1 supvhVh

    ah(uh wh, vh)

    |vh|1

    Moreover

    ah(uh wh, vh) = ah(uh, vh) ah(wh, vh)

    = 1, vh ah(wh, vh)

    = a(u, vh) ah(wh, vh)

    = a(u wh, vh) + a(wh, vh) ah(wh, vh)

    Then for any wh Vh

    |u uh|1 |u wh|1+ |wh uh|1

    |u wh|1+1

    supvhVh

    |ah(uh wh, vh)|

    |vh|1

    |u wh|1+1

    supvhVh

    |a(u wh, vh)| + |a(wh, vh) ah(wh, vh)|

    |vh|1

    |u wh|1+a

    |u wh|1+

    1

    supvhVh

    |a(wh, vh) ah(wh, vh)|

    |vh|1

    1 +

    a

    |u wh|1+

    1

    supvhVh

    |a(wh, vh) ah(wh, vh)|

    |vh|1

    Since this is valid for any wh Vh,

    |uuh|1 infwhVh

    1 +

    a

    |u wh|1+

    1

    supvhVh

    |a(wh, vh) ah(wh, vh)|

    |vh|1

    (7)

    12

  • 8/9/2019 Solutions Linear Algebra

    13/13

    The error is bounded by two terms: the first term is proportional to the

    distance from the the solution u to the subspace Vh and the second termsis the error due to Petrov-Galerkin formulation: the solution uh verifies avariational formulation in ah instead ofa.

    13