Info
This question is closed. Reopen it to edit or answer.
help me with this code :(
2 views (last 30 days)
Show older comments
Task 1.
a) Implement an interpolating numerical derivation method that allows you to calculate derivatives of order 1 and 2 of a given function by its values on n points (n>=3). The written function will have as data vector input containing the values of the x-points and the values of the function for which we want to calculate the derivatives on these points, y, the point on which derivatives are calculated and the order of the derivative (1 or 2). The function goes returns the value of the derivative of the corresponding order on that point
b) Consider the test functions: f 1 (x) = x; f 2 (x) = x 2; f 3 (x) = x 4; f 4 (x) = sin x, defined on the interval [-10,10] for f1-f3 and [-pi, pi] for f4 1. Represent graphically the derivatives of order 1 and 2 obtained numerically by using the function from point a). As input data from point a) will be considered a number of n points equidistant in the intervals mentioned above. The run will be done with the values of n = 3, 5, 10. 2. Study the error made by the method comparing the values of the derivatives obtained by the method numerical derivation with the exact values obtained by deriving (manually) the test functions and calculating the value derivatives on the same points (n points equidistant in the definition range of the functions f1-f4, with n = 3,5,10). Errors will be reported (in tabular form or by graphical representation) for:
1. Order 1 derivative, for the 4 separate test functions, using the 3 values of n (for f1 with n = 3, 5, 10 in the same table, for a number of m = 100 equidistant points or on the same color chart different for each n, for f2 the same etc). Interpret the results.
2. Derivative of order 2, for the 4 separate test functions, using the 3 values of n (for f1 with n = 3, 5.10 in the same table, for a number of m = 100 equidistant points or on the same color chart different for each n, for f2 the same etc). Interpret the results.
0 Comments
Answers (0)
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!