Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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. 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

Students also viewed these Databases questions

Question

Bring out the limitations of planning.

Answered: 1 week ago

Question

Why should a business be socially responsible?

Answered: 1 week ago

Question

Discuss the general principles of management given by Henri Fayol

Answered: 1 week ago

Question

Detailed note on the contributions of F.W.Taylor

Answered: 1 week ago