Been having a really hard time with this question, I hope you can help! Thanks i
ID: 3282732 • Letter: B
Question
Been having a really hard time with this question, I hope you can help! Thanks in advance!
1Newton's Method is an application of Taylor Polynomials for finding roots of functions. In general, solving an equation f(x 0 is not easy, though we can do it in simple cases like find roots of quadratics If the function is complicated, we can approximate the solution using an iterative procedure also known as a numerical method. One simple method is called Newton's Method. Suppose that x = c is an (unknown) zero off(x) and that f(x) is differentiable in an open interval that contains c: To approximate c 1. Make an initial approximation x cloee to c 2. Determine a new approximation using the formula f'(%) IfIxn*i- x i less than the desired accuracy (which will be specified), let x i serre as the final approximation. Otherwise, retum to step 2 and calculate a new approximation Each caleulation of a successive approximation i called iteration. Example: To use three iterations of Newton's Method to approximate a zero of f(x)x2- 2: where x 1 ia the initial guess. We need to know f'(x)-2x, and we now can use the formula (we are given that xo = 1) (1.5)2 2 15-1.5 (2.25 2)/3 142 fx.) 1.42 1.41 f(xz) 2(1.42) Notice that the answer ia getting closer to the corect anawer x 2 0 which gives x2 2x2 1.41 Now, write a MATLAB program that uses Newton's Method to approximate a zero off(x) = x-1000. where x3 is the initial guess. Use Newton's Method and continue until two successive approximations differ by less than 0.0001. Run your program and determine the value of zero of fx). What is the zero of f(Hand in your MATLAB program and output.Explanation / Answer
f(x) = x^7-1000
Above is the equation which we have to find the roots using MATLAB program with taking initial guess of x is equal to 3.
Newton Raphson's method helps to find the minimum value of any function or root of equation which leads to change in gradient at that point is zero or we can say that differentiation of function is zero at that particular point.
Below is the matlab code to find the zero of f(x) (root of f(x) where f(x) = 0) (Run below code on MATLAB to get the results)
---------------------------------------------------------------------------------------------------------------------------------------------------------
f = @(x) x^7-1000; %f is the given function
fp = @(x) 7*x^6; %fp is the differentiation of f with respect to x
x = -3; %initial guess
for i = 1:1000, xo = x; x = x - f(x)/fp(x);
err = abs((x-xo)/xo); %error between two successive value of x
if err<0.0001
break
end
end
root = xo %root or zero of f(x)
---------------------------------------------------------------------------------------------------------------------------------------------------------
Output after runnung the MATLAB code:
Thus the zero of f(x) = x^7-1000 is equal to 2.6827
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.