conatus.expert.NewtonSolver

class conatus.expert.NewtonSolver(problem, *, tol=REQUIRED, damping=1.0, max_iterations=50, ncc=None, params=None, ncc_cutoff=None, ncc_tail_tol=1e-08)[source]

Bases: object

Newton for an NLBVP. The tolerance tol is required; damping and iteration budget have declared defaults.

ncc / data: fixed coefficient fields of the problem (e.g. the coordinate r used as a weight), passed as FieldData or callables of the grids, exactly as for discretize.

Parameters:
  • problem (NLBVP)

  • tol (float)

  • damping (float)

  • max_iterations (int)

  • ncc (Mapping[E.Field, Any] | None)

  • params (Mapping[str, Any] | None)

  • ncc_cutoff (float | None)

  • ncc_tail_tol (float)

discrete_system(coeffs, params=None, *, check=True)[source]

Newton system at the iterate coeffs: per Fourier group (g, A, b, x) with F_h(x) = A x - b the discrete residual and A = F’(U) the Jacobian (used by continuation). params overrides parameter values (e.g. the continuation parameter). check=False skips the rank report of A: only for callers that solve a bordered system which stays regular where A is singular (folds in continuation), and that say so.

Parameters:
  • coeffs (Mapping[str, ndarray])

  • params (Mapping[str, Any] | None)

  • check (bool)

Return type:

tuple[Plan, list]

initial_coeffs(guess)[source]

Coefficient arrays of an initial guess (linear-only unknowns start at 0).

Parameters:

guess (Mapping[Field, Any])

Return type:

dict[str, ndarray]

solve(guess, *, require_convergence=True)[source]

Newton from guess (every nonlinear variable needs one; linear ones start at 0).

Parameters:
  • guess (Mapping[Field, Any])

  • require_convergence (bool)

Return type:

NLBVPSolution

explain()[source]
Return type:

str