Algorithm of Newton-Raphson method
Step 01.Start of the program
Step 02.Input the variables x0, n for the task
Step 03.Input Epsilon & delta
Step 04.for i = 1 and repeat if i <= n
Step 05.f0 = f(x0)
Step 06.df0 = df(x1)
Step 07.if |df0| <= delta
a. Print Slope too small
b. Print x0, f0, df0, i
c. End of Program
Step 08.x1 = x0-(f0/df0)
Step 09.if |(x1-x0)/x1| <epsilon
a. Print convergent
b. Print x1, f(x1), i
c. End of Program
Step 10.x0 = x1
Step 11.End Loop
Переглядів: 182 |