Question: MATLAB for forward, backward, and central difference Please show output The aim of this lab is to test the accuracy of several finite difference formulas

MATLAB for forward, backward, and central difference

Please show output

MATLAB for forward, backward, and central difference Please show output The aim

The aim of this lab is to test the accuracy of several finite difference formulas for numerical differentiation. Consider the function f()5 We choose uniformly spaced grid points on the interval -3,3], namely Xi =-3 + ih, where i = 0, , n and h = 6 Create a single script named main.m that does the following: x2 +0.25 ) Numerically approximate f(for i -1, ,n - 1 using the forward difference, backward difference, and central difference scheme. Plot these schemes as well as the actual f'(xi) on the same figure. For example, the figure with n 50 is shown below. Produce a figure for n 50,100 and 200 (3 figures in total, each figure has 4 curves) 4 Forward Backward Central Actual 2 -4 -2 2 4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!