Hello, if you have any need, please feel free to consult us, this is my wechat: wx91due
Math330: Intro to Scientific Computing
HW2
Spring 2025
Instructions:
• Show your work, in a reasonably neat and coherent way. All answers must be justified by valid mathematical reasoning.
• Mysterious or unsupported answers will not receive full credit. Your work should be mathe-matically correct and carefully and legibly written or typed. Work scattered all over the page without a clear ordering will receive from little to no credit.
• You must also submit all your executable Matlab codes along with your report in paper during lecture time. Please comment codes for easy understanding purpose.
• To show your results, you have to summarize about what you do and what you find, and may also discuss the reason about your observation.
• Your figures should include at least a caption, labels of axis, and legends of the plots. To compare different results, different colors or styles should be used.
1. (Programming) Textbook, p. 35 #17. Write a Matlab program that
(a) sums up 1/n for n = 1, 2, . . . , 10, 000;
(b) rounds each number 1/n to 5 decimal digits and the sums then up in 5-digit decimal arithmetic for n = 1, 2, . . . , 10, 000;
(c) sums up the same rounded numbers (in 5-digit decimal arithmetic) in reverse order, i.e., for n = 10, 000, . . . , 2, 1.
Compare the three results and explain your observations. For generating numbers with the requested precision, use the provided file round−digits.m.
2. (Programming) Textbook, p. 58 #1. Implement the bisection routine bisect and use it to find the root of the function
f(x) = √x − 1.8
starting from the interval [3, 4] (that is, a = 3 and b = 4), with atol = 1e-8.
(a) How many iterations are required? Does this iteration count match the expectations, based on our convergence analysis?
(b) What is the resulting absolute error? Could this absolute error be predicted by our convergence analysis?
3. Consider the function
g(x) = x 2 + 16/3 .
(a) This function has two fixed points. What are they?
(b) Consider the fixed point iteration xk+1 = g(xk) for this g. For which of the points you have found in (a) can you be sure that the iterations will converge to that fixed point? Briefly justify your answer. You may assume that the initial guess is sufficiently close to the fixed point.
(c) For the points you found in (b), roughly how many iterations will be required to reduce the convergence error by a factor of 10?