Rank analysis of the initialization Jacobian
Source:R/initialization-problem.R
analyze_initialization_jacobian.Rdanalyze_initialization_jacobian(prob) diagnoses rank deficiency of the
initialization problem of prob from the singular value decomposition of
its residual Jacobian at the initial guess. It reports the unknowns that
span the null space (underdetermined directions, which the guesses decide)
and the equations that are locally redundant. The Jacobian is formed by
central finite differences.
Usage
analyze_initialization_jacobian(
prob,
rtol = 1e-08,
atol = 0,
threshold = 0.001,
verbose = TRUE
)Arguments
- prob
A problem built from a system (such as an
ODEProblem), or an initialization problem fromInitializationProblem().- rtol, atol
A singular value
scounts as zero whens <= max(atol, rtol * smax).- threshold
Only unknowns and equations whose participation exceeds this value are reported.
- verbose
Print the report.
Value
A list with jacobian, singular_values, rank, nullity,
redundancy, underdetermined_unknowns and redundant_equations; the
last two are data frames with a weight in [0, 1], the diagonal of
the projector onto the corresponding null space.
Examples
t <- t_nounits; D <- D_nounits
x <- Variable("x", t); y <- Variable("y", t)
sys <- mtkcompile(System(list(D(x) ~ -x + y, 0 ~ x^2 + y^2 - 1), t, name = "dae"))
iprob <- InitializationProblem(sys, 0, list(x ~ 0.6), guesses = list(y ~ 1))
res <- analyze_initialization_jacobian(iprob, verbose = FALSE)
res$rank; res$nullity
#> [1] 1
#> [1] 0