norms and spaces definition: the space of all square integrable funcions defined in the domain is a...

21
Norms and spaces Definition : ) ( 2 L The space of all square integrable funcions defined in the domain dx f 2 is a finite number not infinity L2 norm of f 2 / 1 2 ) ( 2 dx f f L Example ) ( 2 L f compute ) 0 , 0 ( ) 2 , 2 ( 2 ) , ( y x y x f ) ( 2 L f 2 0 2 0 2 2 2 ) ( ) ( 2 dxdy y x f L 5 144 2 0 4 2 3 8 2 4 dy y y 5 12 ) ( 2 L f

Upload: draven-weatherley

Post on 14-Dec-2015

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Norms and spaces Definition: The space of all square integrable funcions defined in the domain is a finite number not infinity L2 norm of f Examplecompute

Norms and spaces

Definition:

)(2L The space of all square integrable funcions defined in the domain

dxf 2 is a finite number not infinity

L2 norm of f

2/12

)(2 dxff

L

Example)(2 L

fcompute

)0,0(

)2,2(

2),( yxyxf

)(2Lf

2

0

2

0

222

)()(

2dxdyyxf

L

5

1442

0

423

8 24 dyyy5

12

)(2

Lf

Page 2: Norms and spaces Definition: The space of all square integrable funcions defined in the domain is a finite number not infinity L2 norm of f Examplecompute

Definition:

)(1H The function and its first derivatives are square integrable

)}(,,:{ 2 Luuuu yx

Example

)0,0(

)2,2(

2),( yxyxf

5

1442

0

2

0

222

)()(

2

dxdyyxfL

4)1(2

0

2

0

22

)(2

dxdyfLx

3

642

0

2

0

22

)()2(

2

dxdyyf

Ly

Def:

2

)(

2

)()(222

LyLxL

vvv

2)(

2)()( 22

1 LvLvH

v

3

642

)(

2

)()(4

222

LyLxLfff

Def:

3

644

3

28)(1

Hf

Norms and spaces

)(1 Hf

Page 3: Norms and spaces Definition: The space of all square integrable funcions defined in the domain is a finite number not infinity L2 norm of f Examplecompute

Example

)0,0(

)2,2(

2),( yxyxf

3

282

0

2

0

222

)()(

2

dxdyyxfL

4)1(2

0

2

0

22

)(2

dxdyfLx

3

642

0

2

0

22

)()2(

2

dxdyyf

Ly

Def:

2

)(

2

)()(222

LyLxL

vvv

3

642

)(

2

)()(4

222

LyLxLfff

Norms and spaces

)(2||||||

Lvv

Energy norm

Example

xyxyxv 3),( 2

Compute the energy norm of the function

Page 4: Norms and spaces Definition: The space of all square integrable funcions defined in the domain is a finite number not infinity L2 norm of f Examplecompute

Norms and spaces

Example

xyxyxv 3),( 2

Which of the following belongs to

Definition: )(10H }on 0),(:{ 1 uHuu

)(10 H

)0,0(

)2,2(

)2()2(),( yyxxyxu

Page 5: Norms and spaces Definition: The space of all square integrable funcions defined in the domain is a finite number not infinity L2 norm of f Examplecompute

Triangle inequality

Norms and spaces

Cauchy-Schwartz inequality

baba (Real numbers)

)()()( 222

LLLvuvu

Triangle inequality

22

LLvuuv

Cauchy-Schwartz inequality

|||||| |||||| vuuv

Page 6: Norms and spaces Definition: The space of all square integrable funcions defined in the domain is a finite number not infinity L2 norm of f Examplecompute

KKPv

CvV

K

h trianglesallfor )(

),(

1

0

the space of all continuous piecewise linear polynomials

} 0:{0, onvVvV hh

the space of all continuous piecewise linear polynomials which vanishes on the boundary

Definition:

Definition:

Norms and spaces

Relations:

)( 100, HVh

)( 1 HVh

Page 7: Norms and spaces Definition: The space of all square integrable funcions defined in the domain is a finite number not infinity L2 norm of f Examplecompute

81 Kh

)0,0( )0,4(

)4,0( )4,4(

1

2 3

45

1K

2K3K

4K

5K6K

7K

)2,0(

)4,2( )4,3(

82 Kh

43 Kh

44 Kh

87 Kh

56 Kh85 Kh

the length of the longest edge on K

Kh

Mesh size h

local mesh size

Example:

KKhh max

mesh size

},,max{ 71 KK hhh Example:

4h

Page 8: Norms and spaces Definition: The space of all square integrable funcions defined in the domain is a finite number not infinity L2 norm of f Examplecompute

on 0 in

ufu

A Priori Error Estimates

0,

0,

)(),(

such that Find

hhhhh

hh

VvvFvua

Vu

u hu

)( )(),(

such that )( Find10

10

HvvFvua

Hu

? huue in what sense the error e becomes small

vuvua ),(

Page 9: Norms and spaces Definition: The space of all square integrable funcions defined in the domain is a finite number not infinity L2 norm of f Examplecompute

A Priori Error Estimates

? huue

)( 10

Hvfvvu0, hhhhh Vvfvvu

0,

0,

)(),(

such that Find

hhhhh

hh

VvvFvua

Vu

)( )(),(

such that )( Find10

10

HvvFvua

Hu

variational formulation finite element method

Page 10: Norms and spaces Definition: The space of all square integrable funcions defined in the domain is a finite number not infinity L2 norm of f Examplecompute

0, allfor ,0)( hhhh Vvvuu

Galerkin Orthogonality

The finite element approximation uh, satisfies the orthogonality

Theorem 1 (Galerkin Orthogonality).

Proof: from the variational formulation we have:

0, )( hhhhh VvvFvu

0, )( hhhh VvvFvu

subtract

0, 0)( hhhh Vvvuu

)(100, HVh

)( 10

Hvfvvu

0, hhhhh Vvfvvu

variational formulation

finite element method

Page 11: Norms and spaces Definition: The space of all square integrable funcions defined in the domain is a finite number not infinity L2 norm of f Examplecompute

0, allfor |||,||| |||||| hhhh Vvvuuu

Best Approximation

The finite element approximation uh, satisfies

Theorem 2 (Best Approximation).

Proof: have weany for 0,hh Vv

)()( |||||| 2hhh uuuuuu

)()( hhhh uvvuuu

)()()()( hhhhh uvuuvuuu

)()( hh vuuu

|||||| |||||| hh vuuu

This shows that the finite element solution uh is the closest of all functions in Vhto the exact solution u when measuring distance using the energy norm.

Page 12: Norms and spaces Definition: The space of all square integrable funcions defined in the domain is a finite number not infinity L2 norm of f Examplecompute

K

2

)(

2222

||||||KLKh uDChuu

Energy Norm Error

The finite element approximation uh, satisfies the a priori error estimate

Theorem 3 (error depends on meshsize).

Proof:

K

2

)(

222

KLK uDCh

This shows that how the error depends on the mesh size.

with a constant C independent of Kh

Start from the best approximation

|||||| |||||| vuuu h

choosing v= πu22 ||| ||| |||||| uuuu h

K

2

)(2) ( KL

uu

the gradient of the error tends to zero as the maximum mesh size h tend to zero.

Remark

K

2

)(

2222

||||||KLKh uDChuu

K

2

)(

222

C KL

uDh

2

)(

222

C

L

uDh

)(

22

||||||

Lh uDChuu

Page 13: Norms and spaces Definition: The space of all square integrable funcions defined in the domain is a finite number not infinity L2 norm of f Examplecompute

)()( 22

LLvCv

Error Depends on hFor any function Theorem (Poincare Inequality).

These constants C’s are different

Remark

)(

22

||||||

Lh uDChuu

|||||| vC

)(10 Hv

||||||)(2 hLh uuCuu

)(

22

L

uDCh

)(

2

)( 22

LLh uDChu-u

Page 14: Norms and spaces Definition: The space of all square integrable funcions defined in the domain is a finite number not infinity L2 norm of f Examplecompute

L2 error is h2we expect that the L2 error to be h2 and not h

)(

22

)( 22

LLh uDChuu

The finite element approximation uh, satisfies the a priori error estimate

Theorem 4 (The L2-error)

with a constant C independent of h

The proof uses a well-known technique called Nitsche’s trick,

on 0 in

ufu

on 0

in

e

Dual problem or adjoint problemMain problem

Page 15: Norms and spaces Definition: The space of all square integrable funcions defined in the domain is a finite number not infinity L2 norm of f Examplecompute

Remark:

Continuous Piecewise Linear Interpolation

Definition:

we define its continuous piecewise linear interpolant by

)(0 CuLet

n

kkkNuu

1

)( hVu

approximates by taking on the same values in the nodes Ni.u u

u

u

uDChuu 2)(

Page 16: Norms and spaces Definition: The space of all square integrable funcions defined in the domain is a finite number not infinity L2 norm of f Examplecompute

L2 error is h2

)(

22

)( 22

LLh uDChuu

The finite element approximation uh, satisfies the a priori error estimate

Theorem 4 (The L2-error)

with a constant C independent of h

on 0

in

e

Proof: let ϕ be the solution of the dual problem

Multiplying by e and integrating using Green’s formula

ee2

ene

e

)(

e

Cauchy-Schwartz inequality

)(2

ee

)( e

2 Dche

Che

ChuDCh 2

eChuDCh 2

uDeCh 22

Dividing by e∥∥

uDeChe 222

uDChe 22

)(

22

)( 22

LLh uDChuu

Page 17: Norms and spaces Definition: The space of all square integrable funcions defined in the domain is a finite number not infinity L2 norm of f Examplecompute

Error norms

)(

22

)( 22

LLh uDChuu

The finite element approximation uh, satisfies the a priori error estimate

Theorem (L2 Norm)

with a constant C independent of h

The finite element approximation uh, satisfies the a priori error estimate

Theorem (Energy Norm)

with a constant C independent of Kh

)(

22

||||||

Lh uDChuu

Page 18: Norms and spaces Definition: The space of all square integrable funcions defined in the domain is a finite number not infinity L2 norm of f Examplecompute

Calcuate the L2 error

K

2

)(

2

)( 22 KLhLh uuuu

K

2)( K

huu

K

2 ||),(),( Kyxuyxu h

K

22 |||||| |||||| Khh uuuu

K

yy

K

xx uhuuhu 2

K

2 )()(

||),(),(||),(),( 2

K

2 KyxuhyxuKyxuhyxu yyxx

Page 19: Norms and spaces Definition: The space of all square integrable funcions defined in the domain is a finite number not infinity L2 norm of f Examplecompute

Calcuate the L2 error

on 0 in

ufu

)1,1()1,1(

)2(2),( 22 yxyxf

)1)(1(),( 22 yxyxu

Exact solution

)(

22

)( 22

LLh uDChuu

2.01 h 1.02 h

11 Chuu h

22 Chuu h

1

2

1

2 h

h

uu

uu

h

h

1

2

1

2 h

h

uu

uu

h

h

1

2

1

2 ln / lnh

h

e

e

Page 20: Norms and spaces Definition: The space of all square integrable funcions defined in the domain is a finite number not infinity L2 norm of f Examplecompute

function [l2error] = compute_error(p, t, uh, u, u_x, u_y)% calculates the error nt = size(t, 2); % number of triangles

np = size(p,2); t1 = t(1,:); t2 = t(2,:); t3 = t(3,:); x1 = p(1, t1); x2 = p(1, t2); x3 = p(1, t3); y1 = p(2, t1); y2 = p(2, t2); y3 = p(2, t3); xc = (x1 + x2 + x3)/3; % x-coord of element midpoints

yc = (y1 + y2 + y3)/3; % y-coord of element midpoints

exact = feval(u, xc, yc); % exact sol at the midpoints

uhc = pdeintrp(p, t, uh); % FE sol at the midpoints

l2error2 =0;for K = 1:nt loc2glob = t(1:3,K); x = p(1,loc2glob); y = p(2,loc2glob); area = polyarea(x,y); loc_er = (exact(loc2glob) - uhc(loc2glob)).^2; l2error2 = l2error2 + sum(loc_er)*areaendl2error = sqrt(l2error2); [exact' , uhc', abs(exact-uhc)']

function [p,e,t,uh] = solveE(hmax)% Poisson's equation on a square [-1,1]X[-1,1] is solved% and the resulting finite element solution is stored in % the vector uh.% g = 'squareg'; % domainb = 'squareb1'; % Dirichlet dataf = '-2*((x.^2 - 1) + (y.^2 - 1))'; % right hand side [p, e, t] = initmesh(g,'Hmax',hmax); % triangulationuh = assempde(b, p, e, t, 1, 0, f); % solve pde

u = inline('(x.^2 - 1).*(y.^2 - 1)', 'x', 'y'); % exact solu_x = inline('2*x.*(y.^2 - 1)', 'x', 'y'); % u_x exact u_y = inline('2*y.*(x.^2 - 1)', 'x', 'y'); % u_y exact h1=0.2;[p1,e1,t1,uh1] = solveE(h1);[l2error1] = compute_error(p1, t1, uh1, u, u_x, u_y) h2=0.1;[p2,e2,t2,uh2] = solveE(h2);[l2error2] = compute_error(p2, t2, uh2, u, u_x, u_y) log(l2error1/l2error2)/log(h1/h2)

Page 21: Norms and spaces Definition: The space of all square integrable funcions defined in the domain is a finite number not infinity L2 norm of f Examplecompute

Calcuate the energy norm of the error

function [energy_error] = energy_error(p, t, uh, u, u_x, u_y)

)(

22

||||||

Lh uDChuu

a) Write matlab file to compute the energy norm of the error

b) Write matlab file to compute the energy norm of the error for two different meshes with meshsizes h1 and h2 and verify the rate of convergence

Exercise