Skip to contents

SCCNonlinearProblem(sys, op) decomposes a square nonlinear system into its strongly connected components: equations are matched to unknowns and the blocks are ordered so that each depends only on earlier ones. solve() then solves the blocks in sequence, which is faster and more robust than one large Newton iteration. The fields var_sccs and eq_sccs list the unknown and equation indices of each block, and scc_kinds how each is solved: blocks affine in their unknowns by a linear solve, blocks with homotopy() nodes by continuation, and the others by the nonlinear algorithm given to solve().

Usage

SCCNonlinearProblem(
  sys,
  op = list(),
  ...,
  jac = TRUE,
  guesses = list(),
  missing_guess_value = NULL
)

Arguments

sys

A complete time independent System with as many equations as unknowns.

op

Operating point: values of unknowns and parameters.

...

Solver options stored with the problem.

jac

Generate the symbolic Jacobian.

guesses, missing_guess_value

As in NonlinearProblem().

Value

An SCCNonlinearProblem.

Examples

x <- Variable("x"); y <- Variable("y"); z <- Variable("z")
sys <- complete(System(list(0 ~ x^3 - 8, 0 ~ y - 2 * x, 0 ~ z^2 + z - y), name = "chain"))
prob <- SCCNonlinearProblem(sys, list(x ~ 1, y ~ 1, z ~ 1))
length(prob$var_sccs)
#> [1] 3
prob$scc_kinds
#> [1] "nonlinear" "linear"    "nonlinear"
solve(prob)$u
#>        x        y        z 
#> 2.000000 4.000000 1.561553