Overview of the NumericalMethods Package

Calling Sequence
    NumericalMethods[command](arguments)
    command(arguments)

Description

List of NumericalMethods Package Commands

BackSubstitute        IntNumeric        MatrixEliminate        MatrixIterate        ODENumeric        ODENumericTaylor        PowerIterate        Root        SpectralRadius

Examples

> with(NumericalMethods):
> IntNumeric(sin(x), x=0..Pi, method=trapezoid, romberg=2, numsteps=21, output=information);
Using step size 0.149600.
Approximation of the integral by the chosen method with n=21 is  1.996268599.
Approximation of the integral by the chosen method with n=2*21 is  1.999067410.
The Romberg error estimate of the latter integral approximation is 0.000933.

2.000000348

> Root(exp(-x)-x, xinit=0, method=newton, tolerance=0.000001);
k=00  x=  0.0000000000   f(x)=  1.0000000000  test= 0.0000000000
k=01  x=  0.5000000000   f(x)=  0.1065306597  test= 0.5000000000
k=02  x=  0.5663110032   f(x)=  0.0013045098  test= 0.0663110032
k=03  x=  0.5671431650   f(x)=  0.0000001965  test= 0.0008321618
k=04  x=  0.5671432904   f(x)=  0.0000000000  test= 0.0000001254

.5671432904

> ODENumericTaylor(diff(y(x),x,x)=-3*diff(y(x),x)-2*y(x), yinit=[1,-1], x=0..3.5, degree=2, stepsize=0.7, output=fullgraph,solution=exp(-x));

Plot_2d

> MatrixEliminate(<<6,9>|<3,1>>, pivoting=euclidean);

Matrix(%id = 149671704)

> MatrixIterate(<<2,1>|<-1,3>>, <1,2>, xinit=<1.3,2.3>, method=gaussseidel, tolerance=0.001, stoppingcriterion=residual);
k=01  x=[  1.6500000000,  0.1166666667],   res= 2.1833333330   test= 2.1833333330,
k=02  x=[  0.5583333335,  0.4805555553],   res= 0.3638888883   test= 0.3638888883,
k=03  x=[  0.7402777775,  0.4199074073],   res= 0.0606481477   test= 0.0606481477,
k=04  x=[  0.7099537035,  0.4300154320],   res= 0.0101080250   test= 0.0101080250,
k=05  x=[  0.7150077160,  0.4283307613],   res= 0.0016846707   test= 0.0016846707,
k=06  x=[  0.7141653805,  0.4286115400],   res= 0.0002807790   test= 0.0002807790,

Vector[column](%id = 150482736)

> PowerIterate(<<3,2>|<1,2>>, xinit=<1.3,2.3>, tolerance=0.001, matrix=[shift,3.5]);

Iterating with the matrix (A-3.5*E)
k=01  x=[  1.0000000000, -0.5151515152],    lambda= -1.9310595090
k=02  x=[  0.3661202185, -0.9999999998],    lambda= -2.3503344020
k=03  x=[  0.5299877603, -1.0000000000],    lambda= -2.5220075840
k=04  x=[  0.4941429595, -1.0000000000],    lambda= -2.4952372930
k=05  x=[  0.5011769229, -1.0000000000],    lambda= -2.5009384380
k=06  x=[  0.4997648367, -0.9999999998],    lambda= -2.4998117470
k=07  x=[  0.5000470415, -1.0000000000],    lambda= -2.5000376290

.999962371, Vector[column](%id = 150679380)