Documente Academic
Documente Profesional
Documente Cultură
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
Example (2,2)
Triangle inequality
u+v L2 ( Ω )
≤ u L2 ( Ω )
+ v L2 ( Ω )
∫ 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
u uh
∫ ∫
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
∫ ∇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 (Ω)
= ∫ ∇(u − uh ) ⋅ ∇(u − vh )
Ω
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
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
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
( )
Ω Ω
≤ 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 ( Ω )
= ∑ ∫ (u − u
K K
h )2
= ∑ (u ( x , y ) − u h ( x , y ) )2
⋅| K |
K
= ∑∫ 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 − 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)
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
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 ( Ω )