nsolve(f, x, x0) finds a root near x0 as SymPy's nsolve(): mpmath's
secant method for one equation and its damped Newton method for systems,
at prec significant digits plus a guard of 20 bits, with the root
verified and rounded to prec digits. For systems give lists of
equations, symbols and starting values.
Usage
nsolve(
f,
x,
x0,
tol = NULL,
maxit = NULL,
prec = 15,
maxsteps = NULL,
verify = TRUE,
dict = FALSE,
solver = NULL
)Arguments
- f
An equation or list of equations.
- x
A symbol or list of symbols.
- x0
Starting value(s).
- tol
Tolerance, or
NULLfor mpmath's default of2^10times the working machine epsilon.- maxit
Maximum iterations, or
NULLfor the solver's default (30 secant steps, 10 Newton steps).- prec
Number of significant digits.
- maxsteps
SymPy's name for
maxit.- verify
If
FALSE, return the last iterate without checking that it is a root within the tolerance.- dict
If
TRUE, return a list holding one named list of the solution, as SymPy'sdict=True.- solver
The mpmath solver:
"secant"(one equation; givex0as two values for the two starting points) or"mdnewton"(systems).