linearize_discretize_sparse
LinearizeDiscretizeSparse
¶
Bases: LinearizeDiscretize
Sparse variant of linearize-then-discretize.
Uses graph-coloring-based sparse Jacobian computation and a compact
augmented state vector that only integrates the structurally nonzero
entries of Φ, B_d and C_d. This reduces the ODE system dimension
from n_x + n_x² + 2·n_x·n_u to n_x + nnz_Ad + nnz_Bd + nnz_Cd
per segment.
Requires A_c_sparsity and B_c_sparsity boolean arrays on the
:class:Dynamics object (set automatically when using the symbolic
problem interface). Falls back to the dense
:class:LinearizeDiscretize path when sparsity patterns are
unavailable or fully dense.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dis_type
|
Union[str, Sequence[str]]
|
Control hold type. |
'FOH'
|
ode_solver
|
str
|
Diffrax solver name. Defaults to |
'Tsit5'
|
diffrax_kwargs
|
Optional[dict[str, Any]]
|
Diffrax keyword overrides inherited from
:class: |
None
|
Source code in openscvx/discretization/linearize_discretize_sparse.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
get_solver(dynamics: Dynamics, settings: Config) -> callable
¶
Create a sparse multi-shoot discretization solver.
When dynamics.A_c_sparsity and dynamics.B_c_sparsity are
available and the pattern is not fully dense, builds a compact-V
integration path with graph-coloring Jacobians. Otherwise
delegates to the dense parent implementation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dynamics
|
Dynamics
|
System dynamics with optional sparsity annotations. |
required |
settings
|
Config
|
Problem configuration. |
required |
Returns:
| Type | Description |
|---|---|
callable
|
Callable |