KINGDOM OF SAUDI ARABIA
Ministry of Higher Education
KING ABDULAZIZ UNIVERSITY
Faculty of Engineering at Rabigh
Midterm Exam-2
Take Home Exam
Numerical Methods-EEN332 & EEN271
Spring 2015
Due date: Monday 22/7/1436 H
@ 1:00 PM
Name (in Arabic):
ID No:
For official use only
Question No
Marks
Q1
20
Q2
20
Q3
15
Q4
15
Q5
15
Q6
15
Total
100
Q1. Consider a linear system which has the following simultaneous equations:
3x1 - 0.1 x2 - 0.2x3 =7.85
0.1x1 + 7 x2 + 0.3x3 = -19.3
0.3x1 - 0.2 x2 + 10x3 =71.4
(a)
(b)
(c)
(d)
(e)
The system can be written in this form:
Ax=b
Determine that the system singular or nonsingular.
Find the inverse of the matrix A using Gauss Jordan Method.
Find the solution of x1,x2, and x3 using Cramers Rule.
Find the solution of x1,x2, and x3 using LU method.
Use MATLAB to compute the solution of the system.
Q2.. The following system can be solved using iterative method:
12 3 5 a1 1
1 5 3 a 28
2
3 7 13 a3 76
(a) Explain the meaning of iterative method?
(b) Solve the system using Gauss-Seidel Iterative Method.
(d) Using MATLAB, solve the system using Gauss-Seidel Iterative Method.
Q3.
NUMERICAL SOLUTIONS OF NONLINEAR SYSTEMS
Consider the following Nonlinear function:
f(x)=4x3-6x1+7x-2.3
Do the following:
(a) Using MATLAB, Plot the function for interval [x=0:0.1:10];
(b) Find the root of the system using:
1- Secant Method
2- Bisection Method
3- Newtons Method
Note: Show your final results and put them in a table for 5 iterations.
(c) Write a MATLAB code to perform only one method of your choice and show your
results.
Q4. INTERPOLATION & REGRESSION
(a) Explain the difference between Regression and Interpolation.
Note: Show the details of your answer including definitions, equations, illustrations,etc.
(b) For the following data:
1.
2.
3.
4.
Voltage (v)
Current (mA)
0
3
5
8
10
11
12
14
16
0
23
50
70
75
83
90
95
96
Determine with explanation the type of this data (linear on nonlinear).
Regress the data using the Least Square Methods of order n= 2.
With MATLAB solve (2) using ployfit function and plot your results one graph.
Using MATLAB, compute the error and plot it.
(c) From the data in last table, interpolate the data at V=7 using the three polynomial
methods: (Direct, Lagrange, and Newton Divided Method).
(d) Use MATLAB to Interpolate v(t) for points i=0:1:96. Plot the interpolated and original data in
one graph.
Q5. NUMERICAL INTERGRATION
a- For the data in the table, use multiple trapezoidal method to find
the numerical integration for 3 segments.
b- Find numerical integration using Simpsons 1/8 Rule for 3 segments.
f(x)
f(x)
0.0
0.2
0.44
2.842
0.12
1.309
0.54
3.507
0.22
1.305
0.64
3.181
0.32
1.743
0.70
2.363
0.36
2.074
0.80
0.232
0.40
2.456
Q6. DISCRETE FOURIER TRANSFORM
Consider the following cosine functions:
f1 (t ) cos(2 5t )
f 2 (t ) cos(2 25t )
f 3 (t ) cos(2 50t )
t=0,1,2,,64
Each with different frequency. These functions are added together to get anew function;
f (t ) f1 f 2 f 3
a) Plot using MATLAB the functions, f1(t),f2(t), f3(t) and f(t).
b) Compute numerically the Fourier transform of f(t) sing the definition of DFT (matrix and
vectors operations).
c) Using fft in MATLAB to compute the Fast Fourier Transform FFT to get F(w). Plot its
magnitude value.