Application Center - Maplesoft

App Preview:

Interval Arithmetic: Extended Interval Newton Method

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


 

NewtonMethod.mws

Extended Interval Newton Method

written by  Grimmer, Markus, Department of Mathematics, University of Wuppertal, Germany, http://www.math.uni-wuppertal.de/wrswt
<? 1999-2002 Scientific Computing/Software Engineering Research Group, University of Wuppertal, Germany>

NOTE: This worksheet demonstrates the use of the Maple package intpakX v1.0  for interval arithmetic.

This document is not the package.  It only shows how to work with the functions and types provided by intpakX v1.0 .  You must create the package in an empty directory before loading the package ( i.e., /usr/maple/intpakX/lib)  Once created, load the package as follows:

>    restart;
libname:="C:/mylib/interval", libname;
with(intpakX);

libname :=

Warning, the name changecoords has been redefined

Warning, the assigned name midpoint now has a global binding

Warning, the protected names ilog10, max and min have been redefined and unprotected

[`&*`, `&**`, `&+`, `&-`, `&/`, `&Convex_Hull`, `&arccos`, `&arcsin`, `&arctan`, `&cabs`, `&cadd`, `&cdiv`, `&cdiv_opt`, `&cmult`, `&cmult_opt`, `&cos`, `&cosh`, `&csub`, `&exp`, `&intersect`, `&intpow...
[`&*`, `&**`, `&+`, `&-`, `&/`, `&Convex_Hull`, `&arccos`, `&arcsin`, `&arctan`, `&cabs`, `&cadd`, `&cdiv`, `&cdiv_opt`, `&cmult`, `&cmult_opt`, `&cos`, `&cosh`, `&csub`, `&exp`, `&intersect`, `&intpow...
[`&*`, `&**`, `&+`, `&-`, `&/`, `&Convex_Hull`, `&arccos`, `&arcsin`, `&arctan`, `&cabs`, `&cadd`, `&cdiv`, `&cdiv_opt`, `&cmult`, `&cmult_opt`, `&cos`, `&cosh`, `&csub`, `&exp`, `&intersect`, `&intpow...
[`&*`, `&**`, `&+`, `&-`, `&/`, `&Convex_Hull`, `&arccos`, `&arcsin`, `&arctan`, `&cabs`, `&cadd`, `&cdiv`, `&cdiv_opt`, `&cmult`, `&cmult_opt`, `&cos`, `&cosh`, `&csub`, `&exp`, `&intersect`, `&intpow...
[`&*`, `&**`, `&+`, `&-`, `&/`, `&Convex_Hull`, `&arccos`, `&arcsin`, `&arctan`, `&cabs`, `&cadd`, `&cdiv`, `&cdiv_opt`, `&cmult`, `&cmult_opt`, `&cos`, `&cosh`, `&csub`, `&exp`, `&intersect`, `&intpow...
[`&*`, `&**`, `&+`, `&-`, `&/`, `&Convex_Hull`, `&arccos`, `&arcsin`, `&arctan`, `&cabs`, `&cadd`, `&cdiv`, `&cdiv_opt`, `&cmult`, `&cmult_opt`, `&cos`, `&cosh`, `&csub`, `&exp`, `&intersect`, `&intpow...
[`&*`, `&**`, `&+`, `&-`, `&/`, `&Convex_Hull`, `&arccos`, `&arcsin`, `&arctan`, `&cabs`, `&cadd`, `&cdiv`, `&cdiv_opt`, `&cmult`, `&cmult_opt`, `&cos`, `&cosh`, `&csub`, `&exp`, `&intersect`, `&intpow...
[`&*`, `&**`, `&+`, `&-`, `&/`, `&Convex_Hull`, `&arccos`, `&arcsin`, `&arctan`, `&cabs`, `&cadd`, `&cdiv`, `&cdiv_opt`, `&cmult`, `&cmult_opt`, `&cos`, `&cosh`, `&csub`, `&exp`, `&intersect`, `&intpow...
[`&*`, `&**`, `&+`, `&-`, `&/`, `&Convex_Hull`, `&arccos`, `&arcsin`, `&arctan`, `&cabs`, `&cadd`, `&cdiv`, `&cdiv_opt`, `&cmult`, `&cmult_opt`, `&cos`, `&cosh`, `&csub`, `&exp`, `&intersect`, `&intpow...
[`&*`, `&**`, `&+`, `&-`, `&/`, `&Convex_Hull`, `&arccos`, `&arcsin`, `&arctan`, `&cabs`, `&cadd`, `&cdiv`, `&cdiv_opt`, `&cmult`, `&cmult_opt`, `&cos`, `&cosh`, `&csub`, `&exp`, `&intersect`, `&intpow...

Extended Interval Newton Method

intpakX v1.0 offers the Interval Newton Method for the computation/enclosure of all zeros of a continuously differentiable real function.
You can do the computation with or without graphical output of the intervals computed in the iteration steps.

>    f:=x->sin(exp(sqrt(x-2)));
X:=[8.,10.];

f := proc (x) options operator, arrow; sin(exp(sqrt(x-2))) end proc

X := [8., 10.]

>    compute_all_zeros(f,X,0.001);

`Digits = `, 10

`       `

[9.584440425, 9.590102305]

`contains exactly one zero.`

[8.405771237, 8.406299401]

`contains exactly one zero.`

`       `

`Number of enclosures of zeros: `, 2

`Number of Iterations steps: `, 5

>    compute_all_zeros_with_plot(f, X, 0.001, 10, 10);

`Digits = `, 10

`      `

`Iteration step `, 1

`xold=`, [8., 10.]

`xnew1=`, [9.289288473, 10.]

`xnew2=`, [8., 8.710711527]

[Maple Plot]

`Iteration step `, 2

`xold=`, [9.289288473, 10.]

`xnew1=`, [9.462634907, 9.590834649]

[Maple Plot]

`Iteration step `, 3

`xold=`, [9.462634907, 9.590834649]

`xnew1=`, [9.584440425, 9.590102305]

[Maple Plot]

`Iteration step `, 4

`xold=`, [8., 8.710711527]

`xnew1=`, [8.401353571, 8.456507702]

[Maple Plot]

`Iteration step `, 5

`xold=`, [8.401353571, 8.456507702]

`xnew1=`, [8.405771237, 8.406299401]

[Maple Plot]

[9.584440425, 9.590102305]

` contains exactly one zero.`

[8.405771237, 8.406299401]

` contains exactly one zero.`

`         `

`Number of enclosures of zeros: `, 2

`Number of iteration steps: `, 5


Optionally, you can specify values for the number of Digits used and for the number of iteration steps to be done
(the latter for the graphical version only; it's annoying to get heaps of graphics when you didn't want them.)


The enclosing intervals are stored in the global variable
zeros.

>    zeros[1]; zeros[2];

[9.584440425, 9.590102305]

[8.405771237, 8.406299401]

Disclaimer:  While every effort has been made to validate the solutions in this worksheet, Waterloo Maple Inc. and the contributors are not responsible for any errors contained and are not liable for any damages resulting from the use of this material.