Question: Use first - order Taylor series expansion ( n = 1 ) to predict the function value of x = 3 for the following equation.

Use first-order Taylor series expansion (n=1) to predict the function value of x =3 for the following equation. The initial point will be x =1.
a) Calculate f(x) values between x =1 and x=3 with 0.1 increments using the equation above. These will be the true values.
Save the calculated true values (f(x) values) for all x values in one row vector called "y_true".
b) Use n=1(first-order) Taylor expansion to predict the function values for x values between x=1 and x=3. Start the step size from h=2. Decrease the step size by half (i.e. h/2) until satisfying the following two conditions:
(i) the absolute true relative percent error between the true function value and predicted function value is below 5% for x=3. Assign the final true error as "et_final"
(ii) The absolute approximate percent error between the current and previous function value is below 5% for x=3. Assign the final approximate error as "ea_final"
Write MATLAB code for this using a "while" loop to continue until both the true and approximate relative percent error condition is below 5% for x=3. The while loop will stop when both the errors are below 5% for x=3. Save all taylor expansion predictions for each step size for all values between x=1 and x=3.

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!