0% found this document useful (0 votes)
69 views

Priori Error

The document defines several function spaces and norms: 1) L2(Ω) is the space of square-integrable functions over a domain Ω. The L2 norm measures the average size of a function. 2) H1(Ω) contains functions whose first derivatives are also in L2(Ω). The H1 norm incorporates both the L2 norm of the function and its derivatives. 3) Vh is the space of continuous piecewise linear polynomials over triangles in a mesh. Vh,0 contains functions in Vh that vanish on the boundary of Ω. 4) The mesh size h is defined as the maximum length of any triangle edge

Uploaded by

Stefano Barbieri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views

Priori Error

The document defines several function spaces and norms: 1) L2(Ω) is the space of square-integrable functions over a domain Ω. The L2 norm measures the average size of a function. 2) H1(Ω) contains functions whose first derivatives are also in L2(Ω). The H1 norm incorporates both the L2 norm of the function and its derivatives. 3) Vh is the space of continuous piecewise linear polynomials over triangles in a mesh. Vh,0 contains functions in Vh that vanish on the boundary of Ω. 4) The mesh size h is defined as the maximum length of any triangle edge

Uploaded by

Stefano Barbieri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Norms and spaces

Definition:
The space of all square
L2 (Ω) = integrable funcions defined in
the domain

is a finite number
f ∈ L2 ( Ω ) ⇒ ∫Ω
f 2 dx not infinity

(2,2)
L2 norm of f Example compute
2
f L2 ( Ω )
f ( x, y ) = x + y
2 2
2

(∫ )
f L2 ( Ω )
= ∫ ∫ ( x + y 2 ) 2 dxdy
1/ 2 (0,0)
2
f = f dx
0 0
2
L2 ( Ω ) Ω =∫ (
8
3
)
+ 4 y 2 + 2 y 4 dy = 144
5 12
0 f L2 ( Ω )
= 5
Norms and spaces

Definition:
H 1 (Ω) = {u : u , u x , u y ∈ L2 (Ω)} Ω
The function and its first derivatives are
square integrable

Example
Def:
f ( x, y ) = x + y 2
(2,2) ∇v = vx
2
+ vy
2
L2 ( Ω ) L2 (Ω) L2 ( Ω )
2 2
2
f L2 ( Ω )
= ∫ ∫ ( x + y 2 ) 2 dxdy = 144
5 2 2
0 0 ∇f L2 ( Ω )
= fx L2 ( Ω )
+ fy = 4 + 643
L2 ( Ω )
2 2
2
fx = ∫ ∫ (1) 2 dxdy = 4 (0,0)
L2 ( Ω )
0 0 Def: v = v 2L ( Ω ) + ∇v 2L ( Ω )
H 1 (Ω) 2 2
2 2
2
fy = ∫ ∫ (2 y ) 2 dxdy = 64
f ∈ H 1 (Ω)
L2 ( Ω )
0 0
3
f H 1 (Ω)
= 28
3
+ 4+
64
3
Norms and spaces

Def:
2 2
Energy norm
∇v L2 ( Ω )
= vx L2 ( Ω )
+ vy
L2 ( Ω )

∇f L2 ( Ω )
= fx
2
L2 (Ω)
+ fy
2

L2 ( Ω )
= 4 + 643 ||| v |||= ∇v L2 ( Ω )

Example f ( x, y ) = x + y 2 Example
(2,2) Compute the energy
2
2 2 norm of the function
f L2 ( Ω )
= ∫ ∫ ( x + y 2 ) 2 dxdy = 28
3
0 0

2 2
v( x, y ) = x 2 + 3 xy
2
fx L2 ( Ω )
= ∫ ∫ (1) 2 dxdy = 4 (0,0)
0 0

2 2
2
fy = ∫ ∫ (2 y ) 2 dxdy = 64
3
L2 ( Ω )
0 0
Norms and spaces

Definition: H 01 (Ω) = {u : u ∈ H 1 (Ω), u = 0 on ∂Ω}

Example (2,2)

Which of the following


belongs to H 01 (Ω) Ω
v( x, y ) = x 2 + 3 xy (0,0)
u ( x, y ) = x( x − 2) y ( y − 2)
Norms and spaces

Triangle inequality (Real numbers) a+b ≤ a + b

Triangle inequality

u+v L2 ( Ω )
≤ u L2 ( Ω )
+ v L2 ( Ω )

Cauchy-Schwartz inequality Cauchy-Schwartz inequality

∫ uv ≤ u L2
v L2 ∫

uv ≤ ||| u ||| ||| v |||

Norms and spaces

Definition:

v ∈ C 0 (Ω), 
Vh =  
v
 K ∈ P 1 ( K ) for all triangles K 
the space of all continuous
piecewise linear polynomials

Definition: Relations:

Vh , 0 = {v ∈ Vh : v = 0 on ∂Ω} Vh H 1 (Ω)
the space of all continuous
piecewise linear polynomials Vh , 0 H 01 (Ω)
which vanishes on the boundary
Mesh size h

local mesh size mesh size Example:

the length of the


h = max hK h = max{hK 1 ,  , hK 7 }
hK = K
longest edge on K h=4

Example: (0,4) (2,4) (3,4) (4,4)


5 4
hK 1 = 8 hK 3 = 4 K6 K5
K7
hK 2 = 8 hK 4 = 4 K1
(0,2) 1
K4
hK 5 = 8 hK 6 = 5 K2
hK 7 = 8
K3
2 3
(0,0) (4,0)
A Priori Error Estimates
− ∆u = f in Ω
u=0 on ∂Ω a (u , v) = ∫ ∇u ⋅ ∇v

Find u ∈ H 01 (Ω) such that Find uh ∈ Vh , 0 such that


a (u , v) = F (v) ∀v ∈ H 01 (Ω) a (uh , vh ) = F (vh ) ∀vh ∈ Vh , 0

u uh

e = u − uh = ? in what sense the error


e becomes small
A Priori Error Estimates
variational formulation finite element method

Find u ∈ H 01 (Ω) such that Find uh ∈ Vh , 0 such that


a (u , v) = F (v) ∀v ∈ H 01 (Ω) a (uh , vh ) = F (vh ) ∀vh ∈ Vh , 0

∫ ∫
1
∇ u ⋅ ∇ v = fv ∀v ∈ H (Ω)
Ω Ω
0
∫ ∇u

h ⋅ ∇vh = ∫ fvh ∀vh ∈ Vh , 0

e = u − uh = ?
Galerkin Orthogonality
Theorem 1 (Galerkin Orthogonality).
The finite element approximation uh, satisfies the orthogonality


∫ ∇(u − u h ) ⋅∇vh = 0, for all vh ∈ Vh , 0

Proof: from the variational formulation we have: variational formulation

∫ ∇u

h ⋅ ∇vh = F (vh ) ∀vh ∈ Vh , 0 ∫ ∇u h ⋅ ∇vh = ∫ fvh ∀vh ∈ Vh , 0
Ω Ω

∫ ∇u ⋅ ∇v

h = F (vh ) ∀vh ∈ Vh , 0 Vh , 0 ⊂ H 01 (Ω)

finite element method


subtract
∫ ∫
1
∇ u ⋅ ∇ v = fv ∀v ∈ H 0 (Ω)

∫ ∇(u − u h ) ⋅ ∇vh = 0 ∀vh ∈ Vh , 0 Ω Ω
Best Approximation
Theorem 2 (Best Approximation).
The finite element approximation uh, satisfies

||| u − uh ||| ≤ ||| u − vh |||, for all vh ∈ Vh , 0

Proof: for any vh ∈ Vh , 0 we have

||| u − u h |||2 = ∫ ∇(u − uh ) ⋅ ∇(u − uh )


Ω This shows that the finite
element solution uh is the
= ∫ ∇(u − uh ) ⋅ ∇(u − vh + vh − uh ) closest of all functions in Vh
Ω to the exact solution u when
measuring distance using
= ∫ ∇(u − uh ) ⋅ ∇(u − vh ) + ∫ ∇(u − uh ) ⋅ ∇(vh − uh ) the energy norm.
Ω Ω

= ∫ ∇(u − uh ) ⋅ ∇(u − vh )

≤ ||| u − uh ||| ||| u − vh |||


Energy Norm Error
Theorem 3 (error depends on meshsize).
The finite element approximation uh, satisfies the a priori error estimate
2
||| u − uh ||| ≤ 2
∑ ChK
2
K
2
Du 2
L (K )
This shows that how
the error depends on
the mesh size.
with a constant C independent of hK

Proof: Start from the best approximation Remark


2
||| u − uh ||| ≤ ||| u − v ||| 2
||| u − u h ||| ≤ ∑ Ch
K
2
K Du 2
L2 ( K )

choosing v= πu 2
≤ Ch 2 ∑ D 2u
L2 ( K )
||| u − uh ||| ≤ ||| u − π u |||
2 2 K

2 2 2
≤ Ch D u
∑ ∇(u − π u )
2
= L2 ( K )
L2 ( Ω )
K
||| u − u h ||| ≤ Ch D 2u
2 L2 ( Ω )
≤ ∑ Ch
K
2
K Du 2
L2 ( K )
the gradient of the error tends to zero as
the maximum mesh size h tend to zero.
Error Depends on h
Theorem (Poincare Inequality). For any function v ∈ H 01 (Ω)

v L2 ( Ω )
≤ C ∇v L2 ( Ω )
= C ||| v |||

Remark
||| u − u h ||| ≤ Ch D 2u
L2 ( Ω )
These constants
C’s are different
u − uh L2 ( Ω )
≤ C ||| u − uh |||

≤ Ch D 2u
L2 ( Ω )

u-uh 2
L (Ω)
≤ Ch D 2u
L2 ( Ω )
L2 error is h2
we expect that the L2 error to be h2 and not h

Theorem 4 (The L2-error)


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

u − uh L2 ( Ω )
≤ Ch 2 D 2u
L2 ( Ω )
with a constant C independent of h
The proof uses a well-known technique called Nitsche’s trick,
Main problem Dual problem or adjoint problem
− ∆u = f in Ω − ∆φ = e in Ω
u=0 on ∂Ω φ =0 on ∂Ω
Continuous Piecewise Linear Interpolation

Definition: Let u ∈ C 0 (Ω)


we define its continuous piecewise linear
interpolant π u ∈ V by
n
h
u
π u = ∑ u ( N k )ϕ k
k =1

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

πu
∇(u − πu ) ≤ Ch D u 2
L2 error is h2
Theorem 4 (The L2-error)
The finite element approximation uh, satisfies the a priori error estimate
2 2
u − uh
L2 ( Ω )
≤ Ch D u
L2 ( Ω )
with a constant C independent of h

Proof: let ϕ be the solution Cauchy-Schwartz inequality 2


e ≤ Ch 2 e D 2u
of the dual problem
2
− ∆φ = e in Ω e = ∫ ∇e∇(φ − πφ )

Dividing by ∥e∥
φ =0 on ∂Ω ≤ ∇e ∇(φ − πφ ) e ≤ Ch 2 D 2u
Multiplying by e and integrating
≤ ∇e ch D 2φ
using Green’s formula
u − uh ≤ Ch 2 D 2u
≤ ∇e Ch ∆φ
∫ e = − ∫ e∆φ
2 L2 ( Ω ) L2 ( Ω )

( )
Ω Ω
≤ Ch D 2u Ch ∆φ
= ∫ ∇e∇φ − ∫ en ⋅ ∇φ
Ω ∂Ω ≤ (Ch D u ) Ch e
2

= ∫ ∇e∇φ ≤ Ch 2 e D 2u

= ∫ ∇e∇(φ − πφ )

Error norms
Theorem (Energy Norm)
The finite element approximation uh, satisfies the a priori error estimate

||| u − u h ||| ≤ Ch D 2u
L2 ( Ω )

with a constant C independent of hK

Theorem (L2 Norm)


The finite element approximation uh, satisfies the a priori error estimate
2 2
u − uh 2
L (Ω)
≤ Ch D u
L2 ( Ω )
with a constant C independent of h
Calcuate the L2 error

2 2
u − uh L2 ( Ω )
= u − uh L2 ( K )
K

= ∑ ∫ (u − u
K K
h )2

= ∑ (u ( x , y ) − u h ( x , y ) )2
⋅| K |
K

||| u − u h |||2 = ∑ ||| u − u


K
h |||2K

= ∑∫ x x ∫ y y
(u
K K
− uh ) 2
+ (u − uh ) 2

= (
∑ x
u ( x , y ) − uhx ( x , y ) )2
⋅ | K | + (u y ( x , y ) − uh y ( x , y ) )2
⋅| K |
K
Calcuate the L2 error
− ∆u = f in Ω u − uh ≤ Ch 2 D 2u
u=0 on ∂Ω 2
L (Ω) L2 ( Ω )

Ω = (−1,1) × (−1,1)
f ( x, y ) = −2( x 2 + y 2 − 2)
Exact solution
u ( x, y ) = ( x 2 − 1)( y 2 − 1)
h1 = 0.2 h2 = 0.1

u − uh1 ≈ Ch1α u − u h 2 ≈ Ch2α

u − uh 2 h2α u − uh 2 h 
α
≈ α ≈  2 
u − uh1 h1 u − u h1  h1 

 e2   
α ≈ ln  / ln h2 
 h 
 e1   1 
function [l2error] = compute_error(p, t, uh, u, u_x, u_y)
% calculates the error
function [p,e,t,uh] = solveE(hmax)
nt = size(t, 2); % number of triangles % Poisson's equation on a square [-1,1]X[-1,1] is solved
np = size(p,2); % and the resulting finite element solution is stored in
t1 = t(1,:); t2 = t(2,:); t3 = t(3,:); % the vector uh.
x1 = p(1, t1); x2 = p(1, t2); x3 = p(1, t3); %
y1 = p(2, t1); y2 = p(2, t2); y3 = p(2, t3);
g = 'squareg'; % domain
xc = (x1 + x2 + x3)/3; % x-coord of element midpoints b = 'squareb1'; % Dirichlet data
yc = (y1 + y2 + y3)/3; % y-coord of element midpoints f = '-2*((x.^2 - 1) + (y.^2 - 1))'; % right hand side
exact = feval(u, xc, yc); % exact sol at the midpoints
uhc = pdeintrp(p, t, uh); % FE sol at the midpoints [p, e, t] = initmesh(g,'Hmax',hmax); % triangulation
l2error2 =0; uh = assempde(b, p, e, t, 1, 0, f); % solve pde
for K = 1:nt
loc2glob = t(1:3,K); u = inline('(x.^2 - 1).*(y.^2 - 1)', 'x', 'y'); % exact sol
x = p(1,loc2glob); y = p(2,loc2glob); u_x = inline('2*x.*(y.^2 - 1)', 'x', 'y'); % u_x exact
area = polyarea(x,y); u_y = inline('2*y.*(x.^2 - 1)', 'x', 'y'); % u_y exact
loc_er = (exact(loc2glob) - uhc(loc2glob)).^2;
l2error2 = l2error2 + sum(loc_er)*area h1=0.2;
end [p1,e1,t1,uh1] = solveE(h1);
l2error = sqrt(l2error2); [l2error1] = compute_error(p1, t1, uh1, u, u_x, u_y)

[exact' , uhc', abs(exact-uhc)']


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)
Calcuate the energy norm of the error

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

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

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

||| u − u h ||| ≤ Ch D 2u
L2 ( Ω )

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy