{ } Raw JSON

bundles / scipy 1.17.1 / scipy / integrate / _bvp / solve_newton

function

scipy.integrate._bvp:solve_newton

source: /scipy/integrate/_bvp.py :348

Signature

def   solve_newton ( n m h col_fun bc jac y p B bvp_tol bc_tol )

Summary

Solve the nonlinear collocation system by a Newton method.

Extended Summary

This is a simple Newton method with a backtracking line search. As advised in [1], an affine-invariant criterion function F = ||J^-1 r||^2 is used, where J is the Jacobian matrix at the current iteration and r is the vector or collocation residuals (values of the system lhs).

The method alters between full Newton iterations and the fixed-Jacobian iterations based

There are other tricks proposed in [1], but they are not used as they don't seem to improve anything significantly, and even break the convergence on some test problems I tried.

All important parameters of the algorithm are defined inside the function.

Parameters

n : int

Number of equations in the ODE system.

m : int

Number of nodes in the mesh.

h : ndarray, shape (m-1,)

Mesh intervals.

col_fun : callable

Function computing collocation residuals.

bc : callable

Function computing boundary condition residuals.

jac : callable

Function computing the Jacobian of the whole system (including collocation and boundary condition residuals). It is supposed to return csc_matrix.

y : ndarray, shape (n, m)

Initial guess for the function values at the mesh nodes.

p : ndarray, shape (k,)

Initial guess for the unknown parameters.

B : ndarray with shape (n, n) or None

Matrix to force the S y(a) = 0 condition for a problems with the singular term. If None, the singular term is assumed to be absent.

bvp_tol : float

Tolerance to which we want to solve a BVP.

bc_tol : float

Tolerance to which we want to satisfy the boundary conditions.

Returns

y : ndarray, shape (n, m)

Final iterate for the function values at the mesh nodes.

p : ndarray, shape (k,)

Final iterate for the unknown parameters.

singular : bool

True, if the LU decomposition failed because Jacobian turned out to be singular.

Aliases

  • scipy.integrate._bvp.solve_newton