The assignment is for Matlab software. Need a code for the following:
Posted: Sat Nov 27, 2021 2:36 pm
The assignment is for Matlab software. Need a code for the
following:
Investigate the Error Behavior Simillar to the Forward, Backward and Central Difference formulas, this formula has an approximation error that is roughly proportional to h" for some positive integer a. Find a by completing the task below.
Task 2 [10 pts]: Pick a function f(x), a point Xo and a series of decreasing h values. Choose a function that you can calculate the derivative easily (as we need to compare the approximation with the exact value). If you really love polynomials, use the ones with degree > 5 and consists of several terms. Write MATLAB code to 1. compute the approximations to f'(X) for each value of h (use the for-loop) 2. calculate the absolute error for each value of h, 3. observe how the errors behave with respect to h, and determine the value of a. Write your code below: Question/observation: 1. Describe how the error decreases as h decreases. 2. The approximation error that is roughly proportional to ha for some positive integer a. Find a based on your observation. Type your answers below:
following:
Investigate the Error Behavior Simillar to the Forward, Backward and Central Difference formulas, this formula has an approximation error that is roughly proportional to h" for some positive integer a. Find a by completing the task below.
Task 2 [10 pts]: Pick a function f(x), a point Xo and a series of decreasing h values. Choose a function that you can calculate the derivative easily (as we need to compare the approximation with the exact value). If you really love polynomials, use the ones with degree > 5 and consists of several terms. Write MATLAB code to 1. compute the approximations to f'(X) for each value of h (use the for-loop) 2. calculate the absolute error for each value of h, 3. observe how the errors behave with respect to h, and determine the value of a. Write your code below: Question/observation: 1. Describe how the error decreases as h decreases. 2. The approximation error that is roughly proportional to ha for some positive integer a. Find a based on your observation. Type your answers below: