Vi PDF
Vi PDF
ax − b
x
−b
Problem: Sove ax = b x=
a
Reformulate the problem:
Consider E = 12 ax2 + bx
Find x∗ : E(x∗ ) = min E(x)
x
x
1. Rayleigh-Ritz Method:
Functional
an ∞ dimension
Au = u= f (x) (1a) vector
u(0) = α u(1) = β (1b)
1 1 2
Consider the functional: E[u] = 2 (u ) + f u dx ← potential energy functional.
0
Claim: If u∗ : E[u∗ ] = min E[u] and u∗ satisfies (1b) then u∗ solves (1).
u
Proof:
1
∗ 1 ∗ 2
E(ε) = E[u + εη] = u + εη + f (u∗ + εη) dx
2
0
1
E (0) = (u∗ + εη )η + f η dx
ε=0
0
1
= (u∗ ) η + f η dx
0
1 1
∗
= u η − u∗ − f η dx = 0
0
0
22
⇒ Since η is arbitrary we could choose η = u∗ − f
⇒ u∗ − f = 0 ← Euler -Lagrange equation for E[u].
N −1
How is this useful? Let us assume that U (x) = αk Ψk (x)
k=1
↑ basis functions
Then
1 N −1
2
1
N
E(α) = αk Ψk (x) + f (x) αk Ψk (x) dx
2
0 k=1 k=1
For a min:
1 N
−1
∂E
0= = αk Ψk · Ψj + f (x)Ψj (x) dx
∂αj
0 k=1
N −1 1 1
= αk Ψk Ψj dx + f (x)Ψj (x) dx, j = 1, . . . , N − 1
k=1 0 0
1 1
⇒ Aα = b where Akj = Ψk Ψj dx bj = − f (x)Ψj (x)dx.
0 0
Example : u = −x2 x
u(x) = (1 − x3 )
u(0) = 0 = u(1) 12
Assume {Ψj } = 1, x, x2 , x3
U3 (x) = c0 + c1 x + c2 x2 + c3 x3
U3 (0) = c0 = 0 u3 (1) = c1 + c2 + c3 = 0 −c2 x + c2 x2 = c3 x + c3 x3
U3 (x) = ax(1 − x) + bx2 (1 − x) −c2 x(1 − x)
= a{x − x2 } +b {x2 ± x3 } c2 = −c1 − c3
Ψ1 Ψ2
1 1 1
4 1
A11 = (1 − 2x)2 dx = 1 − 4x + 4x2 dx = x − 2x2 + x3 =
3 3
0 0 0
1 1 1
2 2 2 4 3
3 4 9 5
4 20 − 45 + 27 2
A22 = (2x − 3x ) dx = 4x − 12x + 9x dx = x − 3x + x = =
3 5 15 15
0 0 0
1
1
A12 = A21 = (1 − 2x)(2x − 3x2 ) dx =
6
0
1
1
b1 = + x2 (x − x2 ) dx =
20
0
23
1
1
b2 = x2 (x2 − x3 )dx =
30
0
⎡ 1 1
⎤⎡ ⎤ ⎡ 1
⎤
3 6 a 20
⎣ ⎦⎣ ⎦=⎣ ⎦⇒a= 1 b=
1
1 2 1 15 6
6 15 b 30
x
U3 (x) = (1 − x)(2 + 5x)
30
Exact:
x
uex (x) = (1 − x3 )
12
Notice that the basis functions {Ψi } were required to satisfy the BC u(0) = 0 = u(1). B-C that have
to be forced onto the trial solution are called essential B-C – typically these involve the solution
values and not the derivatives. In the case of derivative B-C it is possible to build the B-C into the
energy functional to be minimized.
u(0) = α u (1) = β
Consider
u = f (x)
Eg. 2:
7x x3
u = −x = f uexact = 2 + −
2 6
u(0) = 2 u (1) = 3
↑ essential ↑ natural
24
↓ satisfies homogeneous version of essential BC
N
N
UN (x) = α + ai Ψi (x) = ai Ψi (x) a0 = 1 Ψ0 (x) = 2
i=1 i=0
1
1 2
E(a) = ai Ψi + f ai Ψi dx − 3 ai Ψi (1)
2
0
1
∂E
0= = ai Ψi Ψj + f Ψj dx − 3Ψj (1)
∂aj
0
0 = Ψi , Ψj ai + (f, Ψj ) − 3Ψj (1)
0 = Aa + b
1 1 1 1
2 4 3 4
A11 = dx = 1 A21 = A12 = 2x dx = 1 A22 = 4x dx = x =
3 3
0 0 0 0
1
b1 = (−x) · x dx − 3 = −3 13
0 1 1 a1 10/3 43 1
⇒ = ⇒ a1 = a2 = −
1 1 4/3 a2 13/4 12 4
b2 = (−x)x2 dx − 3 = −3 14
0
43 x2
U2 (x) = 2 + x−
12 4
b
I[u] = F (x, y, y ) dx y(a) = 0, y(b) = 0
a
b
∂F ∂F
0 = δI = δy + (δy ) dx
∂y ∂y
a
b b
∂F d ∂F ∂F
= δy − − δy dx
∂y dx ∂y ∂y
a a
d ∂F ∂F
⇒ − =0 Euler-Lagrange Eq.
dx ∂y ∂y
F = p(u )2 + qu2 − 2f u
Eg.1 − (pu ) + qu = f ∂F
= 2qu − 2f
u (a) = α u(b) = β ∂u
b ∂F
= 2pu
I[u] = p(u )2 + qu2 − 2f u dx + αu ∂u
∂ ∂F ∂F
a
− = 2 (pu ) − qu + f = 0
∂x ∂u ∂u
25
Eg. 2: Sturm-Lioville Eigenvalue problems:
b b
Multiply by v and integrate +(pu ) v + quv dx + λ ruv dx = 0
a a
b
p(u )2 − qu2 dx
a I1
λ = I[u] = =
b I2
ru2 dx
a
δI1 I2 − I1 δI2 1
δλ = = (δI1 − λδI2 )
I22 I2
b b
2pu δu − 2quδu − λruδu dx −2 (pu ) + qu + λru δu dx
a a
= = =0
b b
ru2 dx ru2 dx
a a
∴ δλ = 0 ⇒ the function u0 which minimizes I[u] is an eigenfunction of (1) and
λ = I[u0 ] is its eigenvalue.
What do we do for nonlinear or dissipative problems for which potential energy functionals don’t
exist or cannot be found easily?
Consider a BVP
Lu = f in Ω = (a, b) (1a)
u(a) = α ; u (b) + σu(b) = β (1b)
An approximate solution U won’t in general satisfy (1a) and we associate with U the so-called
residual
r(U ) = LU − f
Note that r(u) = 0
exact ↑
A whole class of methods are obtained by considering various ways to minimize the residual in
some sense, usually:
b
r(U )φi dx = 0
a
↑ test or weight functions
N
where U= ai Ψi (x) ← basis function
i=1
26
1. Collocation: weight functions = δ(x − xi ) basis functions polynomials:
Eg:
u − u = 0
u(0) = 1, u(1) = 0
i+1
(A) Let Ψi (x) = x − x which satisfy the homogeneous B-C for the problem
U (x) = 1 − x + a1 x2 − x + a2 x3 − x
r(U ) = {a1 2 + a2 6x} − a1 (2x − 1) + a2 3x2 − 1 + 1
= (3 − 2x) a1 − a2 3x2 − 6x − 1 + 1
If we choose x1 and x2 are chosen to be the zeros of the 2nd degree Legendre polynomial
1 2 1
U2 (x) = 1 − x − (x − x) − (x3 − x)
4 6
(e − ex )
The exact solution is u(x) = .
(e − 1)
x u(x) U1 (x) U1 − u U2 U2 − u U3 U3 − u
1/4 0.834704 0.837750 3.05×10−3 0.835938 1.23×10−3 0.769965 −6.47 × 10−2
1/2 0.622459 0.636364 1.39 × 10−2 0.625000 2.54 × 10−3 0.506144 −1.16 × 10−1
3/4 0.349932 0.360795 0.351563 1.63 × 10−3 0.269965 −8.00 × 10−2
Where to collocate?
DeBoor, C. and Swartz, B. , Collocation at Gaussian points, SIAM J. Num. Anal. 10 (1973),
582–606.
27
2. Method of moments: weight functions φi = xi .
Eg:
u + u + x = 0
u(0) = 0 = u(1)
Let U (x) = a1 x(1 − x) + a2 x2 (1 − x) + . . .
r(U ) = x + a1 (−2 + x − x2 ) + a2 (2 − 6x + x2 − x3 )
1 1
r(U ) · 1 dx = 0 and r(U ) · x dx = 0
0 0
⎡ 11 11
⎤⎡ ⎤ ⎡ 1
⎤
6 12 a1 2
⇒ ⎣ ⎦⎣ ⎦=⎣ ⎦
11 19 1
22 a2
20 3
122 110
U (x) = x(1 − x) + x
649 649
sin x
uex (x) = −x
sin 1
3. Galerkin method: ‘Expand U (x) and w(x) in terms of the same basis functions.’
N
N
u(x) = ai Ψi w(x) = bi Ψ i
i=1 i=1
N N N
r ai Ψi bi Ψi dx = 0 ⇒ r ai Ψi Ψj dx = 0
Ω i=1 i=1 Ω i=1
Eg. u + u + x = 0
u(0) = 0 = u(1)
28
Relationship between Rayleigh Ritz and Galerkin:
1
I[u] = u2 − u2 + 2f u dx
0
1 1
0 = δI = 2u δu − 2uδu + 2f δu dx I(a) = ai Ψi ai Ψj − ai Ψi aj Ψj
0
0
1
1 +2f aj Ψj dx
= u δu − u + u − f δu dx
0
∂I
0 0 = =2 ai (Ψi , Ψk ) − ai (Ψi , Ψk )
1 ∂ak
+(f, Ψk )}
⇒0 = (u + u − f )δu dx
f = −x
0
1
= r(u)δu dx
0
Rayleigh-Ritz and Galerkin methods are identical for this problem. – true in general for linear
problems but not for nonlinear problems.
1
WR ⇒ (u + u + x)v dx = 0
0
u(0) = 0 = u(1) v satisfy homogeneous Dirichlet i.e. v(0) = 0 = v(1)
Say we wanted to express u in terms of functions that are not twice differentiable then we integrate
by parts to throw as many derivatives as needed from u to v.
1 1 1
(u + u + x)v dx = u v + −u v + uv + xv dx = 0.
0 0 0
Now if we let u = ai Ψi and v = bi Ψi we have since v is arbitrary
− ai (Ψi , Ψj ) + ai (Ψi , Ψj ) + (x, Ψj ) = 0
i
Aa = b
where
[A]jj = (Ψi , Ψj ) − (Ψi , Ψj ); b = (x, Ψj )
Identical to Rayleigh-Ritz eqs.
29
What about a natural BC?
u + u + x = 0
(S)
u(0) = α u (1) = β.
1
(u + u + x)v dx = 0 ∀v ∈ H01
0
1 1
u v − u v − uv − xv dx = 0
0
0
1
βv(1) − u v − uv − xv dx = 0
0
b
W Residual u + f v dx = 0 ←− can’t plug in Ni (x) =
a
N
uh (x) = ui Ni (x)
i=0
Ni (x) = δ(x − xi−1 ) − 2δ(x − xi ) + δ(x − xi+1 )
Ni (x) =
We must therefore relax the continuity required of the trial so-
lution by going to a weak formulation of the problem.
b b
u v + −u v + f v dx = 0
a a
b b
∴ u v dx = Hv(b) + f v dx
a a
a(u, v) = Hv(b) + (f, v) ←− (∗)
⎫
(W) Given f ∈ L2 and constants G, H find ⎪
⎪
⎪
u ∈ {u ∈ H 1 , u(a) = g} = Hg1 such that for all ⎪
⎬
v ∈ H01 = {v ∈ H 1 , v(a) = 0} we have that H k = {u : u(k) ∈ L2 } ← Sobolov space
b b ⎪
⎪
⎪
⎪
u v dx = Hv(b) + f v dx ⎭
a a
30
Claim: If u is a solution of (S) then usatisfies (W ). Conversely, provided u is sufficiently differen-
tiable then if u satisfies (W ) it follows that u also satisfies (S).
(S) ⇒ (W )( See *)
(W ) ⇒ (S)
b b
u v dx = Hv(b) + f v dx for all v ∈ H01
a a
b b b
u v − u v dx = hv(b) + f v dx
a a a
b
(u + f )v dx + {H − u (b)}v(b) = 0
a
v arbitrary ⇒ u + f = 0 u (b) = H
↑ natural BC
Using Finite Element Basis Functions: It is useful in the calculation of the integrals to trans-
form each of the subintervals in turn to the same standard interval – on which we construct cardinal
basis functions
N1 N2
x0 xi x xi+1 x3
hi+1 N1 (ξ) N2 (ξ)
−1 0 1
ξ
⎫
N1 (ξ) = 12 (1 − ξ) ⎬
1
Na (ξ) = (1 + ξ ξa )
⎭ 2
N2 (ξ) = 12 (1 + ξ)
−1 a = 1
ξa =
1 a=2
Transformation:
2 2
ξ(x) = c1 + c2 x ξ(xi ) = c1 + c2 xi = −1 c2 = =
xi+1 − xi hi+1
(xi + xi+1 )
ξ(xi+1 ) = c1 + c2 xi+1 = 1 c1 = −
hi+1
2x − (xi + xi+1 )
ξ(x) =
hi+1
hi+1 ξ + (xi + xi+1 )
Similarly x(ξ) =
2
31
Notice we can express the transformation in terms of Na (ξ):
2
x(ξ) = Na (ξ)xa
a=1
2
dx dNa dNa ξa
= (ξ)xa = (ξ) =
dξ dξ dξ 2
a=1
2
1 1 hi+1
= ξa xa = (−xi + xi+1 ) =
2 2 2
a=1
dξ 2
=
dx hi+1
Galerkin approximation:
N
Let uh (x) = GN0 (x) + Ni (x)ui
i=1
N
v h (x) = Ni (x)vi ←− arbitrary
i=1
a uh , v h = hv h (b) + f, v h
b ⎛ N ⎞
b
N N
⇒
ui Ni (x) ⎝ ⎠
vi Nj (x) dx = h vj Nj (b) + f vj Nj (x) dx
a i=1 j=1 a j=1
N
vj arbitrary ⇒ ui Ni , Nj = hNj (xN ) + (Nj , f ) j = 1, . . . , N
i=1
Ku = f
stiffness matrix ↑
b
Kij = Ni , Nj = Ni Nj dx
i−2 i−1 i i+1 i+2
a
fj = hNj (xN ) + (Nj , f )
Notice :
b
2
ui Kij uj = h h
ui a(Ni , Nj )uj = a u , u = u dx ≥ 0 pos. semi def.
1≤ij≤N ij a
32
uh = 0
=⇒ uh = const but since uh (0) = 0
not included
=⇒ uh (x) = ui Ni (x) = 0
↑ form a basis ⇒ ui ≡ 0.
∴ u Ku ≥ 0
T
=0⇒u=0
(c) Kij = 0 if |i − j| ≥ 2
33
The trick to doing the integrals is to calculate them element by element: so called assembly of the
stiffness matrix:
b
N xe
Kij = Ni Nj dx = Ni (x)Nj (x) dx
a e=1 xe−1
N
e
= kab
e=1
xe
e
kab = Na (x)Nb (x) dx
xe−1
1 1
dNa dNb dx Na (ξ) = (1 + ξ ξa )
= (ξ)ξ (x) ξ (x) · dξ 2
dξ dξ dξ ξa
−1 Na (ξ) =
2
1
2 ξa ξb ξa ξb (−1)a+b dξ
=
2
=
2
= · dξ = e = dx xe − xe−1 he
he 2 2 h he
−1
⎡ ⎤
1 −1
1 ⎣ ⎦ and kab
∴ [kab
e
] = e
= 0 if a, b ∈ {e − 1, e}
he
−1 1
Assembly:
fj = f (x)Na (x) dx
e=1 x
e−1
34
2
xe
fae = fb Nb (x)Na (x)dx
b=1 xe−1
Simple Examples
(1) N = 1 N0
N1
(a) x
1−x
u = 0 f ≡0
ue = G + Hx
u(0) = G u (1) = G
1
k11 = ·1=1
1 1
0
1
f1 = H · 1 + x · 0 dx = H
0
−u0 + u1 = f1
⇒ u1 = H + G
∴ uh=1 (x) = GN0 (x) + (G + H)N1 (x) = G + Hx
(b)
f (x) = p
u + p = 0 up = Ax2 2A + p = 0
p
ue (x) = α + βx − x2
2
u(0) = G = α
u (x) = β − px u (1) = β − p = H β = (p + H)
x2
ue (x) = G + Hx + p x −
2
1
p
f1 = H + x p dx = H +
2
0
p
k11 u1 = H + +G
2
px does not capture exact solution because
⇒ uh (x) = G + Hx +
2 ue ∈ {set of piecewise linear functions on (0, 1)} .
p
however uh (0) = G uh (1) = G + H + = ue (1) exact at nodes
2
(c)
f = qx
x x2
ue (x) = G + Hx + q 1−
2 3
1
q
f1 = H + q x2 dx = H +
3
0
q
u1 = H + +G
3
35
qx
uh (x) = G + Hx +
3
h q
u (1) = G + H + = ue (1) Galerkin exact at nodes
3
1
(2) N = 2 h= 2
(a) f ≡ 0: u0 = G N1 N2
⎡ ⎤
⎡ ⎤⎡ ⎤ 1
1 ⎣
2 −1 u1 ⎢ HN1 (1) + 0 N1 · 0 dx + 2G ⎥
⎦⎣ ⎦=⎢ ⎥
(1/2) ⎣ 1 ⎦
−1 1 u2 HN2 (1) + N2 · 0 dx
x1 x2 = 1
0
⎡ ⎤⎡ ⎤ ⎡ ⎤ h = 1/2
4 −2 u1 2G
⎣ ⎦⎣ ⎦=⎣ ⎦
−2 2 u2 H
H
u1 = G +
2
u2 = G+H
h H
u (x) = GN0 + G + N1 (x) + (G + H)N2 (x)
2
= G + Hx
(b) f = p:
⎡ ⎤
1
⎡ ⎤⎡ ⎤
⎢ 2G + p N1 dx ⎥ ⎡ ⎤
4 −2 ⎢ u1 0 ⎥ 2G + p/2
⎣ ⎦⎣ ⎦=⎢
⎢
⎥ ⎣
⎥= ⎦
⎢ 1 ⎥
−2 2 u2 ⎣ ⎦ H + p/4
H + p N2 dx
0
⎡ ⎤ ⎡ ⎤
u1 3p/8 + G + H/2
⎣ ⎦=⎣ ⎦
u2 p/2 + G + H
(c)
f = qx
h 11q q
u N1 (x) + N2 (x)
= G + Hx +
48 3
H 11q
uh (1/2) = G + + = uexact (1/2)
2 48
36
Using a finite difference approximation
N =2
u + f = 0 f =p
u(0) = G u (1) = H
1 2 3
0
U2 − 2U1 + G 1 G
n=1: = −p [2U1 − U2 ] = hp +
h2 h h
U3 − 2U2 + U1 U3 − U1
n=2: = −p = H ⇒ U3 = U1 + 2hH
h2 2h
2U2 − 2U1 − 2hH h
∴ = hp =⇒ U2 − U1 = H + p
h 2
⎡ ⎤⎡ ⎤
2 −1 U1
1 ⎦ = G/h + hp
∴ ⎣ ⎦⎣ h = 1/2
h H + h2 p
−1 1 U2
We consider
u + f = 0
(1)
u(a) = G u,x (b) = G
x
0 x < x
δ(x − x )dx =
1 x > x
−∞
G,x + H(x − x ) = c1
= H(x − x )
G +
x − x = c1 x + c2
x
(i) G,x (b) + H(b − x ) = c1 0 x < x
H(x − x )dx =
(x − x ) x ≥ x
0 + 1 = c1 −∞
(ii) G(a) +
a − x = a + c2
0 + 0 = a + c2
G = x − a
∴ G(x, x ) = (x − a) −
x − x x − a
G = (x − a)
a x b
37
Theorem 1: uh (x) the PWL Galerkin approximation is exact at the nodes; i.e., uh (xi ) = uex (xi )
Lemma 1: a(ω h , u − uh ) = 0 ∀ ωh ∈ vh
Proof:
u → classical or strong solution
(W) ⇒ a(u, ω) = (f, ω) + Hω(b) ∀ ω ∈ H0 (∗)
(S) ⇒ (W)
v h = ω h = ci Nij ; Ni ∈ H0
(G) ⇒ a(uh , ω h ) = (f, ω h ) + Hω h (b) (∗∗) ∀ω ∈ h
h
v ⊂ H0
∴ (∗) ⇒ a(u, ω h ) = (f, ω h ) + Hω h (b) (∗ ∗ ∗)
a(u − uh , ω h ) = 0 ∀ ωh ∈ vh
a(ω h , u − uh ) = a(u − uh , ω h ) symmetry
Proof:
Gxx + δ(x − x ) = 0
G(a) = 0 = Gx (b)
b b b
0= Gxx + δ(x − x ) ω dx = Gx ω + −Gx ωx + δω dx ∀ ω ∈ H0
a
0 a
∴ a(G, ω) = (δ(x − x ), ω) ∀ω ∈ H0
Proof: u − uh ∈ H0
u ∈ Hg1 and uh ∈ v h + {gN0 } ⇒ uh (a) = u(a) = g ⇒ u − uh ∈ H0
∈ H0
a G x, x − ω h , u − uh = a(G, u − uh ) − a(ω h , u − uh )
= (δ(x − x ), u − uh ) − 0
L(2) L(1)
= u(x ) − uh (x )
38
Notes:
3. For this problem it is as if we knew the exact solution and fed this information in at the
nodes. Thus the only error in the Galerkin approximation is the interpolation error:
h2 h2
∴ ||u − uh ||∞ ≤ ||u ||∞ = ||f ||∞ since u + f = 0.
8 8
4. It is not possible to use this technique for all problems as it relied on the fact that G ∈ v h which
is not necessarily true for all problems. For further analysis see Strang and Fix, p. 39–51.
N
Theorem: (Error in PWL approximation) Let f ∈ P C 2,∞ (0, 1) then ||f − fi Ni (x)|| ≤
i=0
1 2
8 h ||f ||∞
Proof:
f (x) fi+1
Σfi Ni (x)
fi for any 0 ≤ i ≤ N
xi xi+1
Claim: For each x ∈ [xi , xi+1 ] ∃ ξx ∈ [xi , xi+1 ] : e(x) = 12 f (ξx )w(x)
Proof:
1) x = xi , xi+1 any ξx suffices.
2) Choose an arbitrary x = x̃. Choose λ such that
39
0 0 0
x x θ
then θ(x) has 3 zeros on [xi , xi+1 ] and
θ = 0
Rolle ⇒ ∃ ξx ∈ [xi , xi+1 ] : θ (ξx ) = 0 0 0 0
θ” = 0
0
But
Theorem 2: Assume u ∈ c1 [a, b]. Then there exists at least one point c ∈ (a, b) at which uh,x (c) =
uexjx (c).
Proof:
uh (xi+1 ) − uh (xi ) 1
If α = xi then uh,x (xi ) = = u (xi ) + hi+1 u (xi ) + O(h2i )
xi+1 − xi 2
xi+1 + xi xi+1 + xi
If we choose α = then uh,x (x) = u + O(h2i )
2 2
Conclusion:
For linear elements the midpoints are superconvergent with respect to derivatives, i.e. most accu-
rate derivatives are calculated there. These are called the BARLOW points. (See Barlow, Int. J.
40
of Num. Meth. Eng., p. 243–251, 1976.
Lagrange elements:
We use the Lagrange polynomials to construct the basis functions:
(
d+1 )(
d
Lda (ξ) = (ξ − ξb ) (ξa − ξb )
b=1 b=1
b=a b=a
d = 1: FIGURE
(ξ − 1) 1
L11 (ξ) = = (1 − ξ) = N11 (ξ)
(−1 − 1) 2
(ξ − (−1)) 1
L12 (ξ) = = (1 + ξ) = N21 (ξ)
1 − (−1) 2
d = 2: FIGURE
(ξ − 0) (ξ − 1) 1 N12 (ξ)
L21 (ξ) = = ξ(ξ − 1) = N12 (ξ)
(−1 − 0) (−1 − 1) 2
−1 0 1
3
1 1 1 1
Note: Nk2 (ξ) = ξ 2 − ξ + 1 − ξ 2 + ξ + ξ 2 = 1
2 2 2 2
k=1
41
d=3:
1
L31 (ξ) = (1 − ξ)(9ξ 2 − 1) = N13 (ξ)
16
9
L32 (ξ) = (3ξ − 1)(ξ 2 − 1) = N23 (ξ)
16 ξ1 ξ2 ξ3 ξ4
9 −1 −1/3 1/3 1
L33 (ξ) = − (3ξ + 1)(ξ 2 − 1) = N33 (ξ)
16
1
L34 (ξ) = (1 + ξ)(9ξ 2 − 1) = N43 (ξ)
16
42
Example:
2 1 1 2 4 3 7
e
k11 = (2ξ − 1) dξ = 2
4ξ − 4ξ + 1 dξ = ξ + ξ =
h 2 2h 2h 3 0 3h
−1 −1
1 1
2 1 2 2 2 ξ 3 1 8
e
k12 = (2ξ − 1)(−2ξ)dξ = − 2ξ − ξ dξ = − · 4 = −
h 2 h h 3 0 3h
−1 −1
1 1 1
2 1 1 2 2 1 4ξ 3 1
e
k13 = (2ξ − 1) (2ξ + 1)dξ = + ·2 4ξ − 1dξ = −ξ =
h 2 2 4h h 3 0 3h
−1 0
1
e 2 2 8 ξ 3 1 16
k22 = (−2ξ) dξ = 2 =
h h 3 0 3h
−1
⎡ ⎤
7 −8 1
1 ⎣ −8 16 −8 ⎦
[k e ] =
3h
48 −8 7
2
Let f = p :⇒ ue (x) = G + Hx + p x − x2
For 1 element h = 1
0 2
u0 u1 u2
⎡ ⎤⎡ ⎤ ⎡ 8 2 ⎤
16 −8 u1 3G + 3 ·p
1 ⎣ ⎦⎣ ⎦=⎣ ⎦
3 p
−8 7 u2 H+ 6 − G
3
xe 1 1
h ξ3 h
f1 = p · N1 (x)dx = (1 − ξ 2 )dξ = h ξ − =2 p
2 3 0 3
xe−1 −1
1 1
h 1 2 h ξ 3 h
f2 = H+ (ξ + ξ )dξ = H + p 2 = H + p
2 2 4 3 6
−1 0
43
⎡ ⎤ ⎡ ⎤⎡ ⎤ ⎡ ⎤
u1 7/48 1/6 8G + 2p 7G/6 − G/6 + 7/24p + H/2 + 1/12p
∴ ⎣ ⎦=⎣ ⎦⎣ ⎦=⎣ ⎦
u2 1/6 1/3 −G + 3H + 1/2p 4G/3 + 1/3p − G/3 + H + p/16
⎡ ⎤
G + 3/8p + H/2
N1 (x) = 4x(1 − x)
=⎣ ⎦
N2 (x) = x(2x − 1)
G + 1/2p + H
3
∴ uh (x) = GN0 (x) + G + H/2 + p N1 (x) + (G + p/2 + H) N2 (x)
8
3 p
= G + (H/2N1 (x) + HN2 (x)) + pN1 (x) + N2 (x)
8 2
1 3 1
= G+H 4x − 4x2 + 2x2 − x + p 4x − 4x2 + (2x2 − x)
2 8 2
p
2 2
= G + Hx + 3x − 3x + 2x − x
2
p
= G + Hx + 2x − x2
2
x2
= G + Hx + p x − the exact solution
2
44