Newton-Raphson Iterative Method

M.M. Yovanovich

NRMETHODCECART1.MWS

Newton-Raphson iterative method applied to the characteristic equation in cartesian coordinates.

Use Maple to illustrate how a hand calculation can be done.

> restart:

> nr:= x - f/f1;

[Maple Math]

Define the function and its derivative.

> f:= x*sin(x) - Bi*cos(x);

[Maple Math]

> f1:= diff(f,x);

[Maple Math]

Set the value of the independent parameter [Maple Math] and set the initial guess for the first root of the characteristic equation. Here we find the first root of the characteristic equation for [Maple Math] .

> Bi:= 2; x1:= 1.0;

[Maple Math]

[Maple Math]

Iterate to convergence.

> x2:= evalf(subs(x=x1, nr));

[Maple Math]

> x3:= evalf(subs(x=x2, nr));

[Maple Math]

> x4:= evalf(subs(x=x3, nr));

[Maple Math]

> x5:= evalf(subs(x=x4, nr));

[Maple Math]

> x6:= evalf(subs(x=x5, nr));

[Maple Math]

Convergence has occurred after 3 iterations. Check the function with the converged value.

> subs(x=x6, f); evalf(%);

[Maple Math]

[Maple Math]

A Maple procedure for calculating the roots of the characteristic equation.

> restart:

> nr:= x-> x - f(x)/df(x);

[Maple Math]

> f:= x-> x*sin(x) - Bi*cos(x);

[Maple Math]

> df:= x->diff(f(x),x);

[Maple Math]

Set the values of the independent parameter [Maple Math] , the initial guess for the first root of the characteristic equation, and the number of iterations.

> Bi:= 2; x1:= 1; n:= 1: N:= 10:
while n < N do x1:= evalf(subs(x = x1, nr(x)));
n:= n + 1;
print('x'[n] = x1); od:

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

Now we use Maple's capability to find roots.

> fsolve(x*sin(x)-2.*cos(x), x=0..Pi/2);

[Maple Math]

This is a convenient way to find one or many roots.