- All code must be uploaded via canvas.
- You can ONLY upload files with specified (allowed) filename extensions
- Only one submission needed per team (One member can upload)
- Grading will consist of using the following criteria:
- Accuracy and correctness of code input/output: 30%
- Clarity and legibility of code: 20%
- Use of comments, annotation and help provided to use the code: 20%
- Logic, computational approach or design used: 30%
- Uploading code that does not work, needs manual corrections for execution, or code with invalid MATLAB variable names, scripts or functions will lose at least 40-50% of assigned points.
- Label plots clearly so it is easy/obvious to understand what is being done
- Comment your code
- Display calculations and/or output (in Command Window) so it is easily readable.
- Test your code before submitting.
===================================================================
Problem 1 [50 points]: Calculating second derivatives.
In class, we examined how it is possible to compute forward, backward or central differences to calculate the derivatives of a function with one variable. Here, you will extend that approach to calculate the second derivative of a given function.
For a given set of vector inputs
. Calculate
Your script should output the mean absolute error
defined in MATLAB as:
>> x = linspace(1, 2, 20);
For each of the 9 methods, display clearly how the second derivative was computed and the mean absolute errors computed. For e.g. your display can read:
Second derivative: Forward, Forward, |mean error| = xx.yy;
Second derivative: Forward, Backward: |mean error| = mm.nn;
...
Remember to pay close and careful attention to the range of the returned vectors and the first derivatives, while using these functions.


0 comments