Sale!

CS 323 Midterm Exam 1 solved

Original price was: $35.00.Current price is: $30.00. $25.50

Category:

Description

5/5 - (4 votes)

Problem 1: Theoretical assignment
1. Use Newton’s method to solve x + e
x = 0 with an accuracy of 3 decimal
places. Please show the specific results at each iterative steps until it
converges.(Initial guess x0 = −1).
2. Use Secant method to solve x + e
x = 0 with an accuracy of 3 decimal
places. Please show the specific results at each iterative steps until it
converges. (Initial guess x0 = −1, x1 = −1.1).
1
3. Plot absolute value of residual V.S. iterative steps.
Note:
1. This is a theoretical assignment, you need to solve it by hand. You can
use computer to evaluate exponent function if necessary, but you do not
need to program everything.
2. Rough definition of converged solution: the results with 3 decimal places
doesn’t change, and both methods can get converged results within 10
steps in this case.
3. The solution of Problem 1 should include:
(a) Question 1: write down each iterative step of Newton’s method, show
the specific evaluation to get xk. Show xk and the associated residual
at each step. (Points: 20)
(b) Question 2: write down each iterative step of Secant method, show
the specific evaluation to get xk. Show xk and the associated residual
at each step. (Points: 20)
(c) Question 3: only output one figure including both secant and Newton’s methods. x axis: iterative steps; y axis: absolute value of
residual at each step (You have got these values from Questions 1
and 2.) (Points: 5)
Problem 2: Programming assignment Define Aii = 40 and Ai+1,i =
Ai−1,i = −10 and the other entries in A are 0. i and j are the slot label at rows
and columns, respectively. For example, if A is a 5 × 5 matrix, then
A =






40, −10, 0, 0, 0
−10, 40, −10, 0, 0
0, −10, 40, −10, 0
0, 0, −10, 40, −10
0, 0, 0, −10, 40






(1)
Following the description, solve AX = B, where the sizes of A and B are
1000 × 1000 and 1000 × 1, respectively. All the entries in B are 1.
1. Use Jacobi, Gauss-Seidel, and SOR method to solve AX = B. To demonstrate the results X, please do not show the specific X, you only need to
show L1, L∞, and L2 norms of X.
2. Plot norm-2 of residual vector V.S. iterative steps
Note:
1. You only need to solve the system with A1000×1000, the A5×5 is only for
demonstration.
2
2. Since SOR recovers Gauss-Seidel method, you are required to directly
program SOR method, and set ω = 1 for Gauss-Seidel simulation, and use
ω = 1.1 for SOR simulation.
3. Only use norm of residual ≤ Tolerance ( = 10−10) as the stop criteria;
4. The solution of Problem 2 should (only) include:
(a) Question 1: L1, L∞, and L2 norms of X solved by Jacobi, GaussSeidel, and SOR methods. In total, 9 numbers. (Program A1000×1000–
Points: 12, all norms–Points: 18)
(b) Question 2: You are required to merge 3 lines into one single plot.
Each line represents the residual of one method. (Points: 20)