Assignment Task
Introduction
In engineering simulation, one often needs to compute derivatives of a function. In this Assignment, a periodic function is considered. File contains a set of uniformlydistributed data points in the period of 0 to 1,
(ti, fi), i = 1, 2,….. , N,
where t is the independent variable, measured in seconds, f is the dependent variable, measured in metres, and N is the number of data points. Your task is to numerically find derivatives of function f (t). Let h be a time step, i.e. h = ti+1 − ti. The following numerical scheme is to be used to estimate the first-order derivative of function f (t)
Requirements
For this assessment item, you must perform hand calculations:
1. Estimate df /dt at t1 and t10. Report the results rounded to four significant You must also produce MATLAB code which:
2. Repeats Requirement Verify the answers by using the reported results from Require- ment 1.
3. Loads File into Verify that the load has been successful by comparing the obtained first and last rows of the numeric data part with those from copy-and-paste.
4. Estimates df /dt at every grid point by directly applying (2)-(4), where loops are used (scalar-based computation). Verify the answers by using the results from Requirement
5. Plots the original function and its first-order derivative. Check the results (the mathe- matical relation between the two functions).
6. Constructs the matrix D using Compute by means of (5). dt Verify the answers by using the results from Requirement 4.
7. Constructs the matrix D without using any loops (vectorised code). Compute by means of (5). Verify the answers by using the results from Requirement 6.
8. Estimates d2f/dt2 at every grid point, where the matrix D is utilised. Plot the first- and second-order derivatives of f (t). Check the results (the mathematical relation between the two functions).
9. Produces an ASCII file that stores the values of x and the approximate values of df /dt and d2f/dt2, where the values are rounded to two decimal places for the variable x and four significant figures for the variables df /dt and d2f/dt2.
10. Has appropriate comments You must submit pseudocode for Requirement 6.
You must submit a short video (10-30 seconds) where you discuss:
the part of the code of which you are most proud; and
the part of the code which you found most difficult to get working correctly.
Your video must show the relevant part(s) of the code while you are discussing them. Your video will be marked based on whether one is submitted or not: full marks for this item if a video is submitted; zero marks if a video is not submitted. Your video should not be in full HD format (i.e. your video should be no more than 1280 pixels across), so that the file size does not become too large. There is a lot of verification involved in this assignment. This is to help you: by checking your answers, you know if what you are doing is correct (you should never trust the answer supplied by a computer!).