$25
MACM 316 - Computing Assignment 5 • Read the Guidelines for Assignments first. • Submit a one-page PDF report to Crowdmark and upload your Matlab scripts (as m-files) to Canvas. Do not use any other file formats. • Keep in mind that Canvas discussions are open forums. • You must acknowledge any collaborations/assistance from colleagues, TAs, instructors etc. • In this assignment, we consider . In Part C, you may use the csape() command function that is built into Matlab. Part A: Write a Matlab code for composite Simpson’s Rule to approximate using the points 0, 1/4, 1/2, 3/4, 1. Compute the exact solution. What is the absolute error in your composite Simpson’s Rule? Part B: Repeat Part A over the interval [0, 1] with equal node spacings . Tabulate or form a plot of the absolute error for the composite Simpson’s Rule approximation of as a function of . Using big-oh notation describe the error in your approximations as a function of . Your answer here should be of the form : what is ? How did you obtain your answer for ? Continued on page 2 f(x) = sin(x) − 1/3 ∫ 1 0 f(x) dx h = 2−m, m = 2,3,4,5 ∫ 1 0 f(x) dx h h O(hp ) p p MACM 316 - Computing Assignment 5 Part C: Here we repeat Part B using Matlab's csape() command with natural boundary conditions: In Matlab, construct a natural cubic spline to approximate by using the values given by at . For each , integrate your spline to approximate . Tabulate or form a plot of the absolute error as a function of . Using big-oh notation describe the error in your approximations as a function of . Your answer here should be of the form : what is ? Part D: What is more accurate here, composite Simpson’s Rule or integrating a natural cubic spline? Explain. Continued on page 3 f(x) f(x) h = 2−m, m = 2,3,4,5 h ∫ 1 0 f(x) dx h h O(hp ) p MACM 316 - Computing Assignment 5 Your report cannot exceed one page. It should include at least two figures or tables with proper labels. Make sure to choose axis scales appropriate for the data. Discussions should be kept brief and answer all questions asked. Point out key features, and state the take-home message for each figure/table. Submit your 1 page report for this question to Crowdmark in .pdf format according the Assignment Guidelines described in the syllabus. Submit your Matlab code to Canvas "Computing Assignment 5 - Matlab Code”. Do not include identifying information on your report. After marking, we will post a few exemplary reports as sample solutions. We appreciate your support on this. If you do not wish to have your report posted, please state so at the top of your report. MACM 316 - Computing Assignment 5 Grades will be based on 5 criteria: Writing / Clarity and conciseness: 2 marks: Writing is clear and concise 1 mark: Contains minor spelling or grammatical errors, too brief or too long, does not convey the main ideas 0 marks: Writing quality is poor and cannot be understood easily or at all Correctness of composite Simpson’s code in Part A: 2 marks: Integral answer and absolute error are correct 1 mark: Minor errors in Part A 0 marks: Integral is incorrect, poorly presented or correctness unclear. Composite Simpson’s Rule in Part B: 2 marks: Complete and correct analysis and discussion 1 mark: An appropriate value of is given and but data contains small errors, use of data is not fully appropriate, or discussion is incomplete. 0 marks: Analysis and discussion missing, incomplete, and/or incorrect Natural cubic spline in Part C: 2 marks: Complete and correct analysis 1 mark: An appropriate value of is given and but data contains small errors use of data is not fully appropriate. 0 marks: Analysis missing, incomplete, and/or incorrect Comparison of composite Simpson’s Rule and natural cubic splines: 2 marks: Complete and correct analysis and discussion 1 mark: Discussion contains small errors or is incomplete 0 marks: Analysis and discussion missing, incomplete, and/or incorrect p p