0% found this document useful (0 votes)
49 views4 pages

Assign 2 Sol

The document presents the formulation and solution of a second order boundary value problem using the finite element method. It gives the weak formulation and Galerkin formulation of the problem. It then shows the results of implementing the Galerkin formulation in MATLAB, comparing the finite element solution to the exact solution for different numbers of elements. As the number of elements increases, the finite element solution converges to the exact solution.

Uploaded by

bhavin1586
Copyright
© Attribution Non-Commercial (BY-NC)
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)
49 views4 pages

Assign 2 Sol

The document presents the formulation and solution of a second order boundary value problem using the finite element method. It gives the weak formulation and Galerkin formulation of the problem. It then shows the results of implementing the Galerkin formulation in MATLAB, comparing the finite element solution to the exact solution for different numbers of elements. As the number of elements increases, the finite element solution converges to the exact solution.

Uploaded by

bhavin1586
Copyright
© Attribution Non-Commercial (BY-NC)
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/ 4

Problem 1

The general form of the given differential equation is


(0, )

(1)

Such that = 0 1 = | 1 =

= 2 = | 2 = Weak Formulation Given a(x) =1, b(x) = 0, c(x) =1, e1 =d2 =0, d1 =e2 =1, g =0, h =-1, (x) =0; (1) becomes
2 2

+ = 0

0 < <

(2)

Such that = 0 = 0 = 0 = 0

Multiplying (2) with a test function w(x) and integrating over the domain 0 < x <

2 + = 0 2

2 2 +
0

= 0
0 0

| 0

= 0
0

0 0

= 0

(3)

Since we already know the value at u (), w () = 0. Also from the natural boundary condition u (0) = 0. So (3) reduces to
0

= 0

(4)

Equation (4) is the weak form for the given problem

The trial solution space is defined as

( )2 < , = 1

The collection of weighing functions is defined as

= Weak form of the problem is

( )2 < , = 0

For equation 2 find u such that for all w

= 0
0

Galerkin Formulation
The weak form of the problem can be written as , = 0 Where , =
0

(5)

Let and such that = 1, = 0 and = 1. Therefore (5) becomes , = 0 Substituting = + in the above equation we get , = , Hence the galerkin form of the problem is For equation 2 find = + where , such that for all , = , (6)

Results
Following are the results of the Finite Element code implemented for the above galerkin form in MATLAB

Number of elements=10
Comparison of FEM and Exact Solution 1 0.8 0.6 0.4 0.2 FEM Exact

u(x)

0 -0.2 -0.4 -0.6 -0.8 -1

0.5

1.5 x

2.5

Number of elements=20
Comparison of FEM and Exact Solution 1 0.8 0.6 0.4 0.2 FEM Exact

u(x)

0 -0.2 -0.4 -0.6 -0.8 -1

0.5

1.5 x

2.5

Number of elements=100
Comparison of FEM and Exact Solution 1 0.8 0.6 0.4 0.2 FEM Exact

u(x)

0 -0.2 -0.4 -0.6 -0.8 -1

0.5

1.5 x

2.5

You might also like