numerically approximate the real roots of an expression using an iterative method - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Education : Student Package : Numerical Analysis : Visualization : Student/NumericalAnalysis/Roots

Student[NumericalAnalysis][Roots] - numerically approximate the real roots of an expression using an iterative method

Calling Sequence

Roots(f, x=[a, b], opts)

Roots(f, [a,b], opts)

Roots(f, x=a, opts)

Roots(f, a, opts)

Parameters

f

-

algebraic; expression in the variable x representing a continuous function

x

-

name; the independent variable of f

a

-

numeric; in the first two calling sequences, one of two initial approximates to the root; in the remaining calling sequences, the initial approximate root

b

-

numeric; in the first two calling sequences, one of two initial approximates to the root

opts

-

(optional) equation(s) of the form keyword=value, where keyword is one of fixedpointiterator, functionoptions, lineoptions, maxiterations, method, output, pointoptions, showfunction, showlines, showpoints, showverticallines, stoppingcriterion, tickmarks, caption, tolerance, verticallineoptions, view; the options for approximating the roots of f

Description

• 

The Roots command numerically approximates the roots of an algebraic function, f, using the specified method and returns the specified outputs.

• 

Given an expression f and an initial approximate a or a pair of initial approximates [a, b], the Roots command computes a sequence pk, k=0..n, of approximations to a root of f, where n is the number of iterations taken to reach a stopping criterion.

• 

See method in the Options section to see which methods require one initial approximate (and hence the last two calling sequences) and which methods require a pair of initial approximates (and hence the first two calling sequences).

• 

If method = fixedpointiteration or method = steffensen is specified, the first argument f may be substituted with an option of the form fixedpointiterator = fpexpr. See method = fixedpointiteration in the Options section for details.

Notes

• 

Both Newton's method and the secant method have the limitation that they may produce a divergent sequence of approximates if the initial approximates a and b are not sufficiently close to the root.

Examples

withStudent[NumericalAnalysis]:

f:=x37x2+14x6

f:=x37x2+14x6

(1)

Rootsf,x=3.2,tolerance=102

3.416190743

(2)

Rootsf,x=2.7,3.2,method=bisection,tolerance=102,output=information

nanbnpnfpnrelative error12.73.22.9500000000.0548750000.0847457627122.9500000003.23.0750000000.0633281250.0406504065032.9500000003.0750000003.0125000000.0121855470.0207468879742.9500000003.0125000002.9812500000.0194465260.0104821802952.9812500003.0125000002.9968750000.0031445140.005213764338

(3)

f:=x23x2:

Rootsf,x=1,output=sequence

1.,3.000000000,1.222222222,0.6417233560,0.5630533137,0.5615533585,0.5615528128

(4)

Rootsf,x=0.3,method=modifiednewton,output=plot,stoppingcriterion=absolute

Rootsf,x=0.3,method=modifiednewton,output=plot,stoppingcriterion=absolute,verticallineoptions=color=gold,linestyle=dash

Rootsf,x=1.3,5,method=secant,output=animation,stoppingcriterion=function_value,tickmarks=5,5

See Also

Roots, Student[Calculus1][Roots], Student[NumericalAnalysis], Student[NumericalAnalysis][Bisection], Student[NumericalAnalysis][FalsePosition], Student[NumericalAnalysis][FixedPointIteration], Student[NumericalAnalysis][ModifiedNewton], Student[NumericalAnalysis][Newton], Student[NumericalAnalysis][Secant], Student[NumericalAnalysis][Steffensen], Student[NumericalAnalysis][VisualizationOverview]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam