Upload
thasarathanr1993939
View
214
Download
1
Embed Size (px)
DESCRIPTION
ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
Citation preview
function NewtonRaphsonMethod%Implmentaton of Newton-Raphson method to determine a solution.%to approximate solution to x = cos(x), we let f(x) = x - cos(x)
i = 1;p0 = 0.5*pi; %initial conditionsN = 100; %maximum number of iterationserror = 0.0001; %precision required
syms 'x'f(x) = x - cos(x); %function we are solvingdf = diff(f); %differential of f(x)
while i