Methods of base::solve() for the nonlinear problem types. The solution
has sol$u (the root, a named vector), sol$resid (the residual there),
sol$retcode ("Success", "MaxIters", "Stalled",
"InitialFailure", ...) and supports symbolic indexing: sol[x],
sol[x + y], sol$ps[a].
Usage
# S3 method for class 'HomotopyProblem'
solve(a, b, ...)
# S3 method for class 'HomotopyContinuationProblem'
solve(a, b, ...)
# S3 method for class 'NonlinearProblem'
solve(a, b, ...)
# S3 method for class 'NonlinearLeastSquaresProblem'
solve(a, b, ...)
# S3 method for class 'SCCNonlinearProblem'
solve(a, b, ...)
# S3 method for class 'LinearProblem'
solve(a, b, ...)
# S3 method for class 'SteadyStateProblem'
solve(a, b, ...)
# S3 method for class 'IntervalNonlinearProblem'
solve(a, b, ...)Arguments
- a
A problem.
- b
An algorithm; see nonlinear_algorithms, interval_algorithms and steady_state_algorithms. A default is chosen when missing.
- ...
Solver options:
abstol,reltol,maxiters.
Examples
x <- Variable("x"); y <- Variable("y")
sys <- complete(System(list(0 ~ x^2 - y, 0 ~ x + y - 2), name = "ns"))
sol <- solve(NonlinearProblem(sys, list(x ~ 0.5, y ~ 0.5)), TrustRegion())
sol$retcode; sol$u; sol$resid
#> [1] "Success"
#> y x
#> 1 1
#> [1] 0 0