construct_global_jac(n, m, k, i_jac, j_jac, h, df_dy, df_dy_middle, df_dp, df_dp_middle, dbc_dya, dbc_dyb, dbc_dp)
There are n * m + k functions: m - 1 collocations residuals, each containing n components, followed by n + k boundary condition residuals.
There are n * m + k variables: m vectors of y, each containing n components, followed by k values of vector p.
For example, let m = 4, n = 2 and k = 1, then the Jacobian will have the following sparsity structure:
1 1 2 2 0 0 0 0 5 1 1 2 2 0 0 0 0 5 0 0 1 1 2 2 0 0 5 0 0 1 1 2 2 0 0 5 0 0 0 0 1 1 2 2 5 0 0 0 0 1 1 2 2 5
3 3 0 0 0 0 4 4 6 3 3 0 0 0 0 4 4 6 3 3 0 0 0 0 4 4 6
Zeros denote identically zero values, other values denote different kinds of blocks in the matrix (see below). The blank row indicates the separation of collocation residuals from boundary conditions. And the blank column indicates the separation of y values from p values.
Refer to (p. 306) for the formula of n x n blocks for derivatives of collocation residuals with respect to y.
Number of equations in the ODE system.
Number of nodes in the mesh.
Number of the unknown parameters.
Row and column indices returned by compute_jac_indices
. They represent different blocks in the Jacobian matrix in the following order (see the scheme above):
Jacobian of f with respect to y computed at the mesh nodes.
Jacobian of f with respect to y computed at the middle between the mesh nodes.
Jacobian of f with respect to p computed at the mesh nodes.
Jacobian of f with respect to p computed at the middle between the mesh nodes.
Jacobian of bc with respect to ya and yb.
Jacobian of bc with respect to p.
Jacobian of the collocation system in a sparse form.
Construct the Jacobian of the collocation system.
The following pages refer to to this document either explicitly or contain code examples using this.
scipy.integrate._bvp.compute_jac_indices
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