3. You are given a function f(x)-2x1+ 3x3 on the interval [-2.2] and you want to
ID: 3601277 • Letter: 3
Question
3. You are given a function f(x)-2x1+ 3x3 on the interval [-2.2] and you want to calculate the first derivative of this function at the points on this interval. Write a MATLAB program that (a) Given the number N of subintervals, calculates the first derivative of the function, f, at each point i, including the boundary points, with the first-order accuracy (this can be done as a self-written MATLAB function). You can use any formula of O(h) of your choice. (b) Given the number N of subintervals, calculates the first derivative of the function, f at each point ri, including the boundary points, with the second-order accuracy (this can be done as a self-written MATLAB function). You can use any formula of O(h2) of your choice. (c) Calculates two measures of error defined as N +1 The first error is called the error in infinity norm (max, stands for the maximum value among all the points), and the second error is called the error in L2 norm. Here ftrue(i is the true value of derivative at the given point r, Run your program with the number of intervals N equal to 8, 16, 32, 64 and document the ELand EL errors for each run. Plot EL versus N, in log-log plot, for both the O(h) and O(h2) derivatives on the same plot. Also, plot EL versus N, in log-log plot, for both the O(h) and O(h2) derivatives (on the same plot, but different from Ei errors). Estimate the order of accuracy for each derivative from the two plots. Discuss if you obtain the expected order of convergence, for both error measures.Explanation / Answer
Whether you complete all 6 stages or 1, be sure to tell your teacher about this program so all your classmates can solve with you! Teachers from all over the country use our program, at no cost, to teach their classes not only to solve, but math, art, science, and more. Hundreds of schools compete at solving cubes as a group and classes create really cool mosaic designs too. We even have ongoing mosaic contests each year. So check out our site and learn how you can do even more with a Rubik's Cube!
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.