nlsolve
sequentially tries multiple nonliear equation solvers
until a solution is found or all solvers have been tried.
nlSolversnlsolve(start, func, solvers = nlSolvers, control, ...)
If at least one solver succeeds, a numeric vector of solutions
will be returned, with attribute attr(*, 'nlsolve.metho')
set to a string indicating the name of the success solver being used,
and with attribute attr(*, 'nlsolve.success')
being a logical
scalar indicating whether any solver succeeded. When all solvers
fail, the last one is returned, but with nlsolve.success
being
set to FALSE
.
nlSolvers
is currently a named list of length 8.
A numeric vector of starting values.
An objective function of which the zeros are sought.
A (named) list, with each element being itself
a list with components named solve
, success
and
result
. See the solvers
argument of glmsolve
.
See the control
argument of glmsolve
.
Additional arguments.
Long Qu
Currently supported solvers are c('broyden', 'nleqslv.Broyden',
'nleqslv.Newton','fsolve','newtonsys','sane','dfsane','BBsolve')
.
They are respectively broyden
in the pracma
package, nleqslv
in the nleqslv
with
method='Broyden'
or with method='Newton'
, functions
fsolve
and newtonsys
in the pracma
package, and functions sane
,
dfsane
, and BBsolve
in the
BB
package.
broyden
, nleqslv
,
fsolve
, newtonsys
,
sane
, dfsane
, BBsolve
,
glmsolve
.
str(nlSolvers) ## list of existing solvers
Run the code above in your browser using DataLab