scipy 1.8.0 Pypi GitHub Homepage
Other Docs
ParametersReturns
solve_newton(n, m, h, col_fun, bc, jac, y, p, B, bvp_tol, bc_tol)

This is a simple Newton method with a backtracking line search. As advised in , 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 , 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.

Solve the nonlinear collocation system by a Newton method.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/integrate/_bvp.py#347
type: <class 'function'>
Commit: