Description Usage Arguments Details Value Note See Also Examples
Calculates root using newton's method.
1 | newtonIteration(func, funcDeriv, p0, n0, tol, VERBOSE, VECTOR, DECIMAL)
|
func |
STRING Derivative formula write in STRING. NOTE: observes that exponential values must use '**' instead operator '^' |
funcDeriv |
STRING Deriv of func parameter. See details |
p0 |
NUMBER Initial approximation |
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 |
Depends of getFuncValue()
DEFAULT |
FLOAT Possible solution for a f(x) or 'Fail'. |
VECTOR=1 |
DATA FRAME Iterations values, where i is equal to line row |
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')
Error: Due this msg: Error in deriv.default(a,'x') : invalid expression in 'FindSubexprs' you must pass funcDeriv also.
Numerical Analysis 9ed Burden
1 | newtonIteration(func='cos(x)-x', funcDeriv='-sin(x)-1', p0=pi/4, n0=4, tol=10^-9, DECIMAL=9, VERBOSE=1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.