falsePosition: falsePosition

Description Usage Arguments Details Value Note See Also Examples

View source: R/main.r

Description

Calculates root using false position method.

Usage

1
falsePosition(func, p0, p1, n0, tol, VERBOSE, VECTOR, DECIMAL)

Arguments

func

STRING Derivative formula write in STRING. NOTE: observes that exponential values must use '**' instead operator '^'

p0

NUMBER Lower boundary

p1

NUMBER Upper boundary

tol

OPTIONAL NUMBER Tolerance, how close to 0 must be. NOTE: default value is 10⁻¹⁵

n0

NUMBER Maximum n0s to run. It will loop n0 times, however, if find root, will stop before.

VERBOSE

OPTIONAL BOOLEAN See results for each iteration

VECTOR

OPTIONAL BOOLEAN Return a Data frame with calculated values, instead of P, i.e., not show if 'Fail'.

DECIMAL

OPTIONAL NUMBER Pass a value to round variables. By default, is settled to 13

Details

Depends of getFuncValue()

Value

DEFAULT

FLOAT Possible solution for f(x) or 'Fail'.

VECTOR=1

DATA FRAME Iterations values, where i is equal to line row

Note

How to see response for (i in 2:nrow(l))

cat( sprintf("%d\t %.9f\t %.9f\t %.9f\t %.9f", l[i,1],l[i,2],l[i,3],l[i,4],l[i,5]), sep='\n')

See Also

Numerical Analysis 9ed Burden

Examples

1
2
3
falsePosition(func='cos(x)', p0=1, p1=2, n0=15)
falsePosition(func='x^3 + 4*x^2 - 10', p0=1, p1=2, n0=15, VERBOSE=1)
falsePosition(func='x^3 + 4*x^2 - 10', p0=1, p1=2, n0=15, VECTOR=1, DECIMAL=9)

ppcamp/r-edo-solver documentation built on Dec. 30, 2021, 12:19 a.m.