You are on page 1of 1

EEE 212: Numerical Technique Laboratory

Mohammad Asif Zaman Lecturer, Department of Electrical and Electronic Engineering, Bangladesh University of Engineering and Technology, Dhaka 1000.

Report work of Exp. 10 (for Section: A2 and B1 students only). Submission deadline: 26th October, 2012.

18th October, 2012.

Problem 1: The voltage distribution, V(x), in a particular one dimensional space is given by the following ODE:

d 2V x dV 2 1 V x, V (1) 2, V (3) 1 . 2 dx 5 dx
Solve the boundary value problem in the range x = 1 to x = 3. Use step size, h = 0.01. Plot V vs. x. Also plot the electric field, E, as a function of x. Note that,
E dV . dx

Use finite difference method. Problem 2: A tri-diagonal matrix is created when finite difference method is used to solve one dimensional boundary value problems (like Problem 1). Use the built in backslash operator (A\b) of MATLAB and pseudo-inverse command of MATLAB to solve the matrix equation. Use tic-toc command to note the simulation time required. Then, write your own code, employing Thomas algorithm to solve the matrix equation. Note the simulation time in this case. Show the simulation time of the three methods in tabular form for the following step size, h, values: (i) h = 0.1 (ii) h = 0.01 (iii)h = 0.001 (iv) h = 0.0001 (v) h = 0.00001 Note that when the value of h is decreased, the resulting matrix dimension increases. Indicate the matrix dimension in the result table.
[Hint: To make the Thomas algorithm work fast, convert the tri-diagonal 2D matrix into three 1D matrices. Memory access of three 1D matrices is faster than a large 2D matrix, which helps the program run faster.]

Study Materials: Thomas Algorithm for solving tri-diagonal matrices: http://www.iitg.ernet.in/jiten/Extra/thomas.pdf http://www3.ul.ie/wlee/ms6021_thomas.pdf

You might also like