Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

previous newton function: function root=newton(f,fprime,x0,tol) if(abs(f(x0))<=t

ID: 3850933 • Letter: P

Question

previous newton function:

function root=newton(f,fprime,x0,tol)
if(abs(f(x0))<=tol)
    root = x0;
    return;
else
    while(abs(f(x0))>tol)
        xnew=x0-(f(x0)/fprime(x0));
        x0=xnew;
    end
    root = x0;
end
end

n from newton from the previous exercise so that it works on a system n of equations The function fprime now the Jacobian matrix and the Newton update is written mathematically as J-1F(xn), n-+1 although in numerical practice on does not compute the inverse of Jacobian but solves a linear system of equations in which (xn) is the right- hand side.

Explanation / Answer

Answer for Question:

See the below modified version of newton method which returns the Jacobian series

function root=newton(f,fprime,x0,tol)
if(abs(f(x0))<=tol)
root = x0;
return;
else
while(abs(f(x0))>tol)
xnew=x0-(fprime(x0)/f(x0));
x0=xnew;
end
root = x0;
end
end