AMS 326 Numerical Analysis Instructor: Peng Zhang Homework 1 Page 1 Homework 1 ****************************************************************************** Assignment Date: Wednesday (02/16/2022) 11:00 AM EST Collection Date: Wednesday (03/02/2021) 11:00 PM EST Grades: 2 problems are worth 100 points. Submission: Blackboard Academic integrity is expected of all students at all times, whether in the presence or absence of members of the faculty. Understanding this, I declare that I shall not give, use, or receive unauthorized aid in this examination. I have been warned that any suspected instance of academic dishonesty will be reported to the appropriate office and that I will be subjected to the maximum possible penalty permitted under the university guidelines. Minimal Requirement for Report Content 1. Problem description for each question. For example, how do you complete the task How do you understand the question and design the solution framework 2. Algorithm description and pseudo-code describing the main structure of your programs. Also, source code with compile and run-time guides including, but not limited to, arguments. 3. Results (numbers, figures, tables, etc.) as requested by the assignments. 4. Comments on your program performance, including, but not limited to, accuracy analysis and speed performance and/or comparison in terms of wall-clock running times. Also provide your other answers specific questions by the problem sets. A computer program, if required, must be provided. ****************************************************************************** Problem 1.1 (50 Points) Write a computer program to find the root of the following equation (you may use the provided mathematical functions such as sin(), etc.) () = 2.020 3 4 sin(3) 1.949 by going through the following steps. (Your results must have 4 digits of accuracy.) (a) Plot a figure for the function () above in interval ∈ [ 1, 2] by using any graphing program of your choice. (b) From the above figure, please use eyeballs to guess the value (labeled as “1”) of one of the roots. Report 1. (c) Since the “root 1 ” you obtained above is an approximation, you design a small interval around the root [1 , 1 + ]where “ �
�� is small enough that within this interval there is one and only one root. Report “ ”. AMS 326 Numerical Analysis Instructor: Peng Zhang Homework 1 Page 2 (d) Use the Bisection method, and the interval you selected in (c), to find the root 0. Please report the number of iterations you need to get this solution. Report the solution and performance (# of iterations, approaching speed to the root, wall clock times). (e) Repeat the above steps (b)-(d) to find all roots in interval ∈ [ 1, 2] using the Bisection method. Here, you must provide the description for the algorithm, pseudocode, numerical formulas, a discussion on the stopping criteria, and report the solution (# of iterations, approaching speed to the root, wall clock times). (f) Repeat the above steps (b)-(d) to find all roots in interval ∈ [ 1, 2] using the Newton’s method or Secant method (either of them). Here, you must provide the description for the algorithm, pseudocode, numerical formulas, a discussion on the stopping criteria, and report the solution (# of iterations, approaching speed to the root, wall clock times). (g) Compare the accuracy and speed performances (such as # of iterations, approaching speeds, wall clock running times, etc.) between method (e) and method (f). Explain and discuss the causes for these performance differences based on your results. Problem 1.2 (50 Points) Below is a “kidney” equation (2 + 2)2 = 3 + 3 (red curve) that can be graphed as Dig a disc from the kidney. The disc is ( 0.25)2 + ( 0.25)2 = 0.125 (blue curve). (1) Write a computer program to use the Rectangle method to compute the area of the remaining kidney (for an accuracy of up to four significant digits). (2) Write a computer program to use the Trapezoidal method to compute the area of the remaining kidney (for an accuracy of up to four significant digits). (3) Write a computer program to use the Monte Carlo method to compute the area of the remaining kidney (for an accuracy of up to four significant digits). (4) Compare the accuracy and speed performances for these methods in the (1) to (3) methods. Estimate the number of floating-point operations needed for each method you used. Present and Compare the wall-clock times for these methods.