• Nie Znaleziono Wyników

Solution of ODE by FEM

N/A
N/A
Protected

Academic year: 2021

Share "Solution of ODE by FEM"

Copied!
10
0
0

Pełen tekst

(1)

Solution of ODE by FEM

Jerzy Pamin

e-mail:jpamin@L5.pk.edu.pl

(2)

Problem formulation

Problem to be solved

Solve boundary value problem

u 00 (x) + 6x 2 = 0 x ∈ (0, 1) , bcs: u(0) = 1 , u 0 (1) = − 1 2 using Galerkin formulation of FEM and 2 elements with linear interpolation.

Analytical solution

u 00 (x) = −6x 2 u 0 (x) = −2x 3 + C u(x) = − 1

2 x 4 + Cx + D u analit = − 1

2 x 4 + 3

2 x + 1

(3)

Weighted residual method

Global model via WRM

R = u 00 (x) + 6x 2 , Z 1

0

w(x)R(x)dx = 0 ∀w 6= 0 Z 1

0

wu 00 dx + Z 1

0

w 6x 2 dx = 0 ∀w

Weak formulation

− Z 1

0

w 0 u 0 dx + [wu 0 ] 1 0 + Z 1

0

w 6x 2 dx = 0 ∀w | · (−1) Z 1

0

w 0 u 0 dx − w(1)u 0 (1) + w(0)u 0 (0) − Z 1

0

w 6x 2 dx = 0 , u(0) = 1

Note that u 0 (1) = − 1 2 and u 0 (0) is unknown

(4)

FE discretization

2 elements with linear interpolation

0 0.5 1 x

1 2

i

x i x j

u i u j

3 2 j

e 1

x 1 x 2

Topology e = 1 i = 1 j = 2 e = 2 i = 2 j = 3 Transformation x e ∈ (0, l e )

x = x e + d e d 1 = 0, d 2 = 0.5

Shape functions N i = 1 − x l e e = 1 − 2x e N j = x l e e = 2x e N = [N i , N j ] q e =

 u i

u j



Bubnov-Galerkin approximation

u ≡ u e = N q e , w ≡ w e = N b = b T N T

(5)

Finite element equations

Integral equation for FE

Z l e 0

w 0 u 0 dx e − w(l e )u 0 (l e ) + w(0 e )u 0 (0 e ) − Z l e

0

w 6x 2 dx e = 0 ∀w Z l e

0

w 0 u 0 dx e − w(l e )u 0 (l e ) + w(0 e )u 0 (0 e ) − Z l e

0

w 6(x e + d e ) 2 dx e = 0 Substitute interpolation u = N q e , w = b T N T , invoke ∀b

Z l e 0

b T N 0T N 0 q e dx e −b T N T (l e )u 0 (l e )+b T N T (0 e )u 0 (0 e )−

Z l e 0

b T N T 6(x e +d e ) 2 dx e = 0 ∀b

Z l e 0

N 0T N 0 q e dx e −N T (l e )u 0 (l e )+N T (0 e )u 0 (0 e )−

Z l e 0

N T 6(x e +d e ) 2 dx e = 0

Notice that N T (l e ) =

 0 1



, N T (0 e ) =

 1 0



Z l e 0

N 0T N 0 dx e q e

 −u 0 (0 e ) u 0 (l e )



− Z l e

0

N T 6(x e + d e ) 2 dx e = 0

(6)

Finite element equations

Finite element matrices

Z l e 0

N 0T N 0 dx e q e

 −u 0 (0 e ) u 0 (l e )



− Z l e

0

N T 6(x e + d e ) 2 dx e = 0

K e = Z l e

0

N 0T N 0 dx e , p e = Z l e

0

N T 6(x e +d e ) 2 dx e , p e b =

 −u 0 (0 e ) u 0 (l e )



Notice that N 0 = [−2 , 2]

Matrix equation for FE

K e q e − p e b − p e = 0

K e q e = p e + p e b

Numerical model at element level

(7)

Computations

Compute matrices for each element

K 1 = K 2 = Z 0.5

0

 −2 2



 −2 2  dx e =

 2 −2

−2 2



p 1 = Z 0.5

0

 1 − 2x 1 2x 1



6(x 1 ) 2 dx 1 =

 0.0625 0.1875



p 2 = Z 0.5

0

 1 − 2x (2) 2x (2)



6(x (2) + 0.5) 2 dx (2) =

 0.6875 1.0625



p 1 b =

 −u 01 (0 1 ) u 01 (l 1 )



, p 2 b =

 −u 02 (0 2 ) u 02 (l 2 )



(8)

Global set of equations

Assembly

Add element matrices to zeroed global arrays according to topology K = X

e

K e , q = X

e

q e , p = X

e

p e , p b = X

e

p e b ,

Kq = p + p b

K =

2 −2 0

−2 2 + 2 −2

0 −2 2

 q =

 u 1 u 2 u 3

 p =

 0.0625 0.8750 1.0625

p b =

−u 01 (0 1 ) u 01 (l 1 ) − u 02 (0 2 )

u 02 (l 2 )

 =

−u 0 (0) 0 u 0 (1)

(9)

Boundary conditions and solution

Set of 3 equations in 5 unknowns

2 −2 0

−2 4 −2

0 −2 2

 u 1

u 2

u 3

 =

 0.0625 0.8750 1.0625

 +

−u 0 (0) 0 u 0 (1)

 but we have boundary conditions u 1 = u(0) = 1 and u 0 (1) = −0.5!

Notice that until now the solution is independent of the boundary conditions.

Set of 3 equations in 3 unknowns

2 −2 0

−2 4 −2

0 −2 2

 1.0

u 2

u 3

 =

 0.0625 0.8750 1.0625

 +

−u 0 (0) 0

−0.5

 First solve equations 2 and 3, then equation 1 to obtain

u 2 = 1.71875 , u 3 = 2 , u 0 (0) = 1.5

(10)

Solution

Comparison of approximate and analytical solutions

Solutions Solution derivatives

Cytaty

Powiązane dokumenty

Institute of Mathematics and Computer Science, Czestochowa University of Technology, Poland email:

A new method for analytic determination of extremum of the transients in linear systems, Bulletin of the Polish Academy of Sciences: Technical Sciences

ANNALES SOCIETAT1S MATHEMATICAE POLONAE Series I: COMMENTATIONES MATHEMATICAE XXII (1981) ROCZNIKI POLSKIEGO TOWARZYSTWA MATEMATYCZNEGO1. Séria I: PRACE MATEMATYCZNE

This lecture was prepared within project ”The development of the didactic potential of Cracow University of Technology in the range of modern construction”, co-financed by the

Faculty of Civil Engineering, Cracow University of Technology URL: www.CCE.pk.edu.pl. Computational Methods, 2020

Nonlinear problems Geometrical nonlinearity Physical nonlinearity Cracking.. Final

Ahmed, State dependent vector measures as feedback controls for impul- sive systems in Banach spaces, Dynamics of Continuous, Discrete and Impul- sive Systems 8 (2001), 251–261..

However, the solution of potential (V) of a partial differential equation (PDE) in three real variables