Question

2. Use the centered difference formula to approximate f(z) for f sin and z1, using h 1, 1/10, 1/100, ...., 1 /1015. Plot the

0 0
Add a comment Improve this question Transcribed image text
Answer #1

ANSWER:

  • Matlab code for finding differentiation clear all close all all h values hh-log space( 0,-15, 16 ) ; %Function for which erro

  • finding differentiation for all h diff_f(i) (f (x0+h)-f (x0))/h; diff b() ( (x0)-f (x0-h))/h; diff_c(i) (f (x0+h)-f (x0-h))/(

  • Loglog plot of error for different scheme at x-O 100 Forward scheme backward scheme central scheme 5 10 으 10 10 10-15 10, 10

Add a comment
Know the answer?
Add Answer to:
2. Use the centered difference formula to approximate f(z) for f sin and z1, using h 1, 1/10, 1/1...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1. Approximate the derivative of each of the following functions using the forward, backward, and...

    1. Approximate the derivative of each of the following functions using the forward, backward, and centered differ- ence formulas on the grid linspace (-5,5,100) (x+h)-f(z thforward, (r)-fr-h ckward th)-fle-h centered. For each part, make a single plot (with three curves) showing the absolute error at each grid point. (Note that the approximations are undefined at one or both endpoints.) Also state which approximations are exact (within roundoff error) (b) f:x→z? (d) f:Hsin(x) 2. Use the centered difference formula to approximate...

  • Approximating derivatives f(z +h) - f(z) f(x)-f( -h) f(x + h) - f(x - h) Forward difference Backw...

    Added the formulas, thank you! Approximating derivatives f(z +h) - f(z) f(x)-f( -h) f(x + h) - f(x - h) Forward difference Backward difference Centered difference for 1st derivative s(a) (3) 2h t)-2e-bCentered diference for 2nd derivative (4) 2 2. Write a short program that uses formulas (1), (3) and (4) to approximate f(1) and f"(1) for f(x)e with h 1, 2-1, 2-2,.., 2-60. Format your output in columns as follows: h (6+f)() error (öf(1 error f error Indicate the...

  • equidistant subdivision of [0, 2] in 20 subintervals to approximate 1. Using an sin(z) dr by the midpoint rule, esti...

    equidistant subdivision of [0, 2] in 20 subintervals to approximate 1. Using an sin(z) dr by the midpoint rule, estimate the absolute total error. equidistant subdivision of [0, 2] in 20 subintervals to approximate 1. Using an sin(z) dr by the midpoint rule, estimate the absolute total error.

  • Let f(z) = V3z sin(#) and P(z) =r-x-1. 1. Find f(e) 2. Find the real solution(s) to Px) 0. Hint: ...

    This is a MATLAB question so please answer them with MATLAB steps. Let f(z) = V3z sin(#) and P(z) =r-x-1. 1. Find f(e) 2. Find the real solution(s) to Px) 0. Hint: use the roots command. 3. Find the global minimum for f(x). Hint: plot f over [0,2] 4. Solve f()P. Hint: plot f and P over [0,21. 5. Find lim,→0+ f(x). Hint: make a vector hi make a table [x + h; f(x + h)]". 6. Find '(In 2)....

  • . (25 points) The recurrence relation for the Newton's Raphson method is a)0.1.2 f(r.) F(z.) The ...

    . (25 points) The recurrence relation for the Newton's Raphson method is a)0.1.2 f(r.) F(z.) The derivative of the function can be approximately evaluated using finite-difference method. Consider the Forward and Centered finite-difference formulas Forward Finite-Difference Centered Finite-Difference 2h It is worthwhile to mention that modified secant method was derived based on the forward finite- difference formula. Develop a MATLAB functions that has the following syntax function [root,fx,ea,iter]-modnetraph (func,x0,h,es,maxit,sethod, varargin) % modnevtraph: root location zeroes of nonlinear equation f (x)...

  • 4. For f(x) = e-* and h = 0.10 where, C = 1.** a) Use centered...

    4. For f(x) = e-* and h = 0.10 where, C = 1.** a) Use centered approximations to estimate the first and second derivatives of f(x) at x = 2. Use the east accurate formulas available. (10 pts) b) Using the most acurate forward and backward difference formulas, estimate the first derivative of f(x) at x 2. (10 pts) Forward Difference First Derivative 7.) - SD Error OM or) = -1.) + 40..) - 3 ) 2h Second Derivative 'w...

  • sin (3) + sin (2-1) sina) 1. (10+7 points) Let f(z)= =1 +... (a) Does the...

    sin (3) + sin (2-1) sina) 1. (10+7 points) Let f(z)= =1 +... (a) Does the series converge uniformly to f(x) on R? Is f() continuous? Is f(x) differentiable? (b) Calculate f(x) (i.e. write an explicit formula for f(x)).

  • Section A Q1 0 Using the following Taylor series expansion: f(x+h) = f(x)+hf'(x)+22 h 3! f"(x)+...

    Section A Q1 0 Using the following Taylor series expansion: f(x+h) = f(x)+hf'(x)+22 h 3! f"(x)+ (+0) (1.1) 4! show that the central finite difference formula for the first derivative can be written as: f'(x)= f(x+h)-f(x-1) + ch" +0(hº) (1.2) 2h Determine cp and of the derived equation. [4 marks] Consider the function: f(x) = sin +COS (1.3) 2 2 Let x =ih with n=0.25, give your answer in 3 decimals for (ii) to (vi): (ii) Evaluate f(x) for i...

  • 1. The two-point forward difference quotient with error term is given by where ξ e ll, l + hl. In...

    1. The two-point forward difference quotient with error term is given by where ξ e ll, l + hl. In class we showed an additional error term appears to due to computer rounding error, e(r). Denoting (z) f(x) +e(x) as what the com- puter stores, and supposing f"(x)M and e() e where e, M are constants, we obtained an upper bound for the error between f(r) and the computed forward difference quotient 2c h Find the minimum value of the...

  • 2. Graph the functions f(x)x(x 1)(x-2) ..(x- k) for k- 1,2,..,10. (These are examples of the poly...

    2. Graph the functions f(x)x(x 1)(x-2) ..(x- k) for k- 1,2,..,10. (These are examples of the polynomials occurring in the error formula for polynomial interpolation.) We want to produce an evenly spaced table of values for the function f(x) sin(x) for x E [O,T/2] such that, with cubic interpolation, we can give the values of the function at any point in the interval with an error less than 5 10-12. That means finding a number n such that with h-/2n...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT