Question: i need help with Forward/Backward/Central Difference!!! (MATLAB) PLEASE HELP, this is the 4th time i've posted this.. ----------------------------------------------------------------------------------------------------------- Problem 8.2 Given the function f (x)

i need help with Forward/Backward/Central Difference!!! (MATLAB)

PLEASE HELP, this is the 4th time i've posted this..

-----------------------------------------------------------------------------------------------------------

i need help with Forward/Backward/Central Difference!!! (MATLAB) PLEASE HELP, this is the

Problem 8.2 Given the function f (x) e 0.5x sin(x), let f (x) df be the exact derivative dx We can generate a discrete function as a set of points txi,yi, where yi f(xi). Write a MATLAB code to do the following: 1. Generate an array of xi values, starting at x 3 0.0, ending at x 4.0, and at intervals of h Ax- 1.0 2. Generate an array of yi values, where yi 0.5xi sin(xi). 3. Using first-order backwards-difference discretization techniques, approximate the first derivative, zi f (xi). Note: You cannot do this at every point. It is OK if you exclude a point. 4. Calculate the error of this approximation, Ei s- zi f (xi) Note: You should only calculate the error at points where you were able to calculate za 5. Display the average value 6. Repeat Steps 1-5 using h 0.1 7. Repeat Steps 1-5 using h 0.01 Problem 8.3 Repeat Problem 8.2, but use first-order forward-difference techniques to calculate the derivative. Problem 8.4 Repeat Problem 8.2, but use a central-difference technique to calculate the derivative. Note that you may need to exclude more than one point from your calculations Problem 8.2 Given the function f (x) e 0.5x sin(x), let f (x) df be the exact derivative dx We can generate a discrete function as a set of points txi,yi, where yi f(xi). Write a MATLAB code to do the following: 1. Generate an array of xi values, starting at x 3 0.0, ending at x 4.0, and at intervals of h Ax- 1.0 2. Generate an array of yi values, where yi 0.5xi sin(xi). 3. Using first-order backwards-difference discretization techniques, approximate the first derivative, zi f (xi). Note: You cannot do this at every point. It is OK if you exclude a point. 4. Calculate the error of this approximation, Ei s- zi f (xi) Note: You should only calculate the error at points where you were able to calculate za 5. Display the average value 6. Repeat Steps 1-5 using h 0.1 7. Repeat Steps 1-5 using h 0.01 Problem 8.3 Repeat Problem 8.2, but use first-order forward-difference techniques to calculate the derivative. Problem 8.4 Repeat Problem 8.2, but use a central-difference technique to calculate the derivative. Note that you may need to exclude more than one point from your calculations

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!