Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

MATLAB program Problem #1 1. Write a computer program to find the derivative of

ID: 3283405 • Letter: M

Question

MATLAB program

Problem #1 1. Write a computer program to find the derivative of sin(x) at x-/3 using backward, forward and central 2. Perform a grid resolution analysis. Iteratively decease ?? and recalculate the solution. Find the optimum ?? 3. Determine the rate of convergence, n, of each of the three methods. Plot log(et) vs. log(Ax) for the three differencing for each scheme and show a plot of the log of the absolute error, et, vs. ??. schemes along with the lines of theoretically predicted slope. Note that the only slopes (rates of convergence) of the theoretic lines matter, not their magnitudes. Use the following equation for determining n: d log(et) nd log(Ar) 4. Also plot ??, log(et) and n at each grid resolution step in tabular form. 5. Plot the total absolute error as a function of ??, find the minimum error, and comment on truncation vs. roundoff error.

Explanation / Answer

Q1: