Starting from:

$25

MACM 316 - Computing Assignment 4

MACM 316 - Computing Assignment 4 • 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. The Matlab spline() command does not allow for natural boundary conditions. To obtain a spline with natural boundary conditions, we instead use pp = csape(x, y, ‘variational’) where the word “variational” arises from the correspondence between natural boundary conditions and variational calculus. Please note that in this assignment you are not permitted to use the fnder() function. Part A: In Matlab, use pp = csape(x, y, ‘variational’) to construct a natural cubic spline approximating using the values of at . Examine pp.coefs to determine the the cubic polynomial employed by the spline over the interval [0.25 0.5]. Output the polynomial. Differentiate this cubic polynomial to approximate and . Output the approximations to and . Part B: We now examine the accuracy of the approximations obtained by differentiating a natural cubic spline. Consider the interval [0, 1] with equal node spacings . Tabulate or form a plot of the absolute error for and as a function of . Using big-oh notation describe the error in your approximations to and as a function of . Your answers here should be of the form : what is ? Explain how you find Continued on page 2 f(x) = sin(x) − 1/3 f(x) x = 0, 0.25, 0.5, 0.75, 1.0 f′(0.25) f′′(0.25) f′(0.25) f′′(0.25) h = 2−m, m = 2,3,4,… f′(0.25) f′′(0.25) h f′(0.25) f′′(0.25) h O(hp ) p p . MACM 316 - Computing Assignment 4 Your report cannot exceed one page. It should include at least one figure or table 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 4 - 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. Continued on page 3 MACM 316 - Computing Assignment 4 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 Data: 2 marks: Data is correct, well presented and relevant to the report 1 mark: some data is missing, unimportant data is included 0 marks: No data, data is incorrect, data is irrelevant, poor presentation Correctness: 2 marks: In Part A, derivatives are correct 1 mark: Minor errors in part A 0 marks: Derivatives are incorrect, poorly presented or correctness unclear. Rate of convergence for : 2 marks: Complete and correct analysis and discussion 1 mark: An appropriate value of is given but use of data is not fully appropriate, or discussion is incomplete. 0 marks: Analysis and discussion missing, incomplete, and/or incorrect Rate of convergence for : 2 marks: Complete and correct analysis and discussion 1 mark: An appropriate value of is given but use of data is not fully appropriate, or discussion is incomplete. 0 marks: Analysis and discussion missing, incomplete, and/or incorrect f′ p f′′ p

More products