Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a well commented MATLAB program to calculate the 1 st , 2 nd , and 3 rd derivative of an equation using forward finite

Write a well commented MATLAB program to calculate the 1st ,2nd , and 3rd derivative of
an equation using forward finite difference, backward finite difference and central finite
difference methods with an error of the second order O(h2
) for forward and backward finite
different methods and an error of 4th order for central finite method O(h4
).
In your program give the user the capability to insert the step size and the value at which
the derivative is to be calculated. Write the equation in a separate .m file as function.
5
2- Use your program to find the 1st,2nd, and 3rd derivatives of the following equation (f(x)=
x4+2x -
2
) at x=1 using two different values for the step size, the first value is h1=0.25
and the second one is h2=0.01.
Solution 1 at h1=0.25:
First_D_Forward=
Second_D_Forward =
Third_D_Forward =1.
First_D_Backward=
Second_D_Backward =
Third_D_Backward =
First_D_Central=
Second_D_Central =
Third_D_Central =
Solution 2 at h2=0.01:
First_D_Forward=
Second_D_Forward =
Third_D_Forward =1.
First_D_Backward=
Second_D_Backward =
Third_D_Backward =
First_D_Central=
Second_D_Central =
Third_D_Central =
6
Discussion and Analysis
1. Calculate the relative error in the answers for all methods found using h=0.25 assuming
that the answers found using step size h=0.01 is the right one

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_2

Step: 3

blur-text-image_3

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

Next Generation Databases NoSQLand Big Data

Authors: Guy Harrison

1st Edition

1484213300, 978-1484213308

More Books

Students also viewed these Databases questions