Two-Point Boundary Value Problem Weak Formulation and FEM Solution Małgorzata Stojek CUT - L52 March 24 Małgorzata Stojek (CUT - L52 Two-Point Boundary Value Problem March 24 / 3
Strong Formulation Find u(x C 2 ([, 2] such that u = f (x x (, 2 f (x = x u ( = u(2 = exact solution: u(x = 6 x 3 x + 3 Małgorzata Stojek (CUT - L52 Two-Point Boundary Value Problem March 24 2 / 3
Weak Formulation u = f (x vu dx = vf dx v V Małgorzata Stojek (CUT - L52 Two-Point Boundary Value Problem March 24 3 / 3
Weak Formulation u = f (x vu dx = vf dx v V integration by parts, (gh = g h + gh. Taking g = v, h = u one obtain ( vu = v u + v ( u v ( u = vu = v u ( vu v u dx [ vu ] 2 = v u dx v(2u (2 + v(u ( = vf dx vf dx Małgorzata Stojek (CUT - L52 Two-Point Boundary Value Problem March 24 3 / 3
Weak Formulation u = f (x vu dx = vf dx v V integration by parts, (gh = g h + gh. Taking g = v, h = u one obtain ( vu = v u + v ( u v ( u = vu = v u ( vu v u dx [ vu ] 2 = v u dx v(2u (2 + v(u ( = vf dx vf dx BCs: u ( =, u(2 = assumption: v V (v = at Dirichlet boundary, v(2 = v u dx u (2 + v( ( = v u dx = vf dx vf dx + v( Małgorzata Stojek (CUT - L52 Two-Point Boundary Value Problem March 24 3 / 3
Basis Shape Functions 2 2 2 2 2 2 u(x = u ϕ (x + u 2 ϕ 2 (x + u 3 ϕ 3 (x Małgorzata Stojek (CUT - L52 Two-Point Boundary Value Problem March 24 4 / 3
Global Approach - not recommended u (x = u ϕ + u 2 ϕ 2 + u 3 ϕ 3 v {ϕ, ϕ 2, ϕ 3 } ϕ i v u dx = vf dx + v( ( u ϕ + u 2 ϕ 2 + u 3 ϕ 3 dx = ϕ i f dx + ϕ i (, i =, 2, 3 ϕ 2 ϕ dx ϕ 2 ϕ 2 dx ϕ ϕ 3 dx ϕ 2 2 ϕ dx ϕ 2 2 ϕ 2 dx ϕ 2 ϕ 3 dx ϕ 3 2 ϕ dx ϕ 3 2 ϕ 2 dx ϕ 3 ϕ 3 dx u u 2 u 3 = ϕ f dx + ϕ 2 f dx + ϕ 3 f dx + Małgorzata Stojek (CUT - L52 Two-Point Boundary Value Problem March 24 5 / 3
Element by Element Approach K gl ij = ϕ i ϕ j dx = ϕ i ϕ j dx + ϕ i ϕ j dx = Kij + Kij 2 Property of basis shape functions: ϕ i for elements NOT CONTAINING i-node K gl = ϕ ϕ dx + ϕ 2 ϕ dx + ϕ ϕ 2 dx + + ϕ 2 ϕ 2 dx + ϕ 2 ϕ 2 dx + ϕ 2 ϕ 3 dx + + 2 ϕ 3 ϕ 2 dx + ϕ 3 ϕ 3 dx Małgorzata Stojek (CUT - L52 Two-Point Boundary Value Problem March 24 6 / 3
Assembly of Global Stiffness Matrix Kij el = el ϕ i ϕ j dx Małgorzata Stojek (CUT - L52 Two-Point Boundary Value Problem March 24 7 / 3
Assembly of Global Stiffness Matrix Kij el = el ϕ i ϕ j dx ( K2 2 el = Małgorzata Stojek (CUT - L52 Two-Point Boundary Value Problem March 24 7 / 3
Assembly of Global Stiffness Matrix K gl = Kij el = el ϕ i ϕ j dx ( K2 2 el = + = 2 Małgorzata Stojek (CUT - L52 Two-Point Boundary Value Problem March 24 7 / 3
Assembly of Global Force Vector P = ϕ xdx ϕ 2 xdx Pi el = el = ϕ i f dx = el ( x + xdx (xxdx ϕ i xdx = ( /6 /3 Małgorzata Stojek (CUT - L52 Two-Point Boundary Value Problem March 24 8 / 3
Assembly of Global Force Vector P = P 2 = ϕ xdx ϕ 2 xdx ϕ 2 xdx ϕ 3 xdx Pi el = el = = ϕ i f dx = el ( x + xdx (xxdx ( x + 2xdx (x xdx ϕ i xdx = = ( /6 /3 ( 2/3 5/6 Małgorzata Stojek (CUT - L52 Two-Point Boundary Value Problem March 24 8 / 3
Assembly of Global Force Vector P = P 2 = P gl = ϕ xdx ϕ 2 xdx ϕ 2 xdx ϕ 3 xdx 6 3 + 2 3 5 6 Pi el = el = = = ϕ i f dx = /6 5/6 el ( x + xdx (xxdx ( x + 2xdx (x xdx ϕ i xdx = = ( /6 /3 ( 2/3 5/6 Małgorzata Stojek (CUT - L52 Two-Point Boundary Value Problem March 24 8 / 3
Linear System of Eqns 2 u u 2 u 3 = /6 5/6 Dirichlet (essential BC, u 3 = u(2 = u 2 u 2 ( 2 + u u 2 =, det K gl = 7/6 5/6 = ( 7/6 Małgorzata Stojek (CUT - L52 Two-Point Boundary Value Problem March 24 9 / 3
Linear System of Eqns 2 u u 2 u 3 = /6 5/6 Dirichlet (essential BC, u 3 = u(2 = u 2 u 2 ( u u 2 2u 2 u ( 2 = ( 7 6, Solution is: + u u 2 =, det K gl = 7/6 5/6 = ( 7/6 ( u u 2 = ( 3 3 6 Małgorzata Stojek (CUT - L52 Two-Point Boundary Value Problem March 24 9 / 3
Exact vs FE Solution nodal values u ex (x = 6 x 3 x + 3 u FE (x = 3 ϕ (x + 3 6 ϕ 2(x u ex ( = 3 = u FE ( = 3 u ex ( = 6 + 3 = 3 6 = u FE ( = 3 6 u ex (2 = = u FE (2 = Neuman (natural BC u ex (x = ( 6 x 3 x + 3 x = 2 x 2 u ex ( = u FE (x = 3 ϕ 3 (x + 6 ϕ 2 (x u FE ( = 7 6 Małgorzata Stojek (CUT - L52 Two-Point Boundary Value Problem March 24 / 3
u ex = 6 x 3 x + 3, 3 3 ( x + + 6 x u FE = 3 6 ( x + 2 u ex = 2 x 2, u FE = 3 + 3 6 = 7 6 3 6 u 4 3 2..5..5 2. x u'..5..5 2. 2 3 ( 2 x 2 dx = 7 6, ( 2 x 2 dx = 3 6 Małgorzata Stojek (CUT - L52 Two-Point Boundary Value Problem March 24 / 3
Funkcja błędu rozwiązania e(x = u FE u ex e(x = 3 3 ( x + + 6 x ( 6 x 3 x + 3 3 6 ( x + 2 ( 6 x 3 x + 3 e(x = 6 x 3 6 x 6 x 3 7 6 x + Małgorzata Stojek (CUT - L52 Two-Point Boundary Value Problem March 24 2 / 3
Norma energetyczna błędu e e dx = e (x = = a (e, e = e e dx ( 6 x 3 6 x x = 2 x 2 6 ( 6 x 3 7 6 x + x = 2 x 2 7 6 e e dx + ( 2 x 2 6 e e dx 2 dx + = 45 + 7 9 = 9 =.2 9.2 =.459 47 ( 2 x 2 7 2 dx 6 Małgorzata Stojek (CUT - L52 Two-Point Boundary Value Problem March 24 3 / 3