Finds the directions in parameters and initial values along which
the observations of a model do not change: the nullspace of the observability
matrix over finite fields, with exact closed forms and a level that says whether
each one is proven. The model f, the observables g and an optional trafo are
equations in any form as.eqnvec() accepts. The computation runs in the Python
package symident through reticulate, installed from PyPI on first use.
Right-hand sides, observables and initial values may contain exp(),
exp10(), b^x, hyperbolic and trigonometric functions, free exponents x^n,
and log(), fractional powers and abs() of positive coordinates. time is
the model time.
Usage
symmetryDetection(
f,
g,
trafo = NULL,
parameters = NULL,
fixed = NULL,
gaugePreference = FALSE,
forcings = NULL,
unknownInputs = NULL,
knownInputs = NULL,
events = NULL,
conditions = NULL,
regimes = NULL,
equilibrate = FALSE,
reduceCQ = FALSE,
freeInitial = NULL,
reconstruct = FALSE,
positive = TRUE,
verify = TRUE,
cores = 1,
control = reconstControl(),
scalingsOnly = FALSE,
symEngine = c("modular", "symbolic"),
mode = c("local", "global"),
globalOptions = NULL,
discrete = FALSE,
verbose = FALSE
)Arguments
- f
Right-hand sides: an eqnlist, an eqnvec or a named character vector.
reduceCQandequilibrateuse the reactions of an eqnlist.- g
Observables: one eqnvec or named character vector for all conditions, or a list with one per row of
conditions. An observablea*log(h) + cwith a numberais analyzed throughh.- trafo
Parameter transformation: one eqnvec for all conditions or a list with one per condition. An entry named like a parameter is substituted into
f,g, event values and event times; an entry named like a state sets the initial value of the state. On the right-hand side a state name is the initial value of that state. A parameter that enters only throughk = "exp(lk)","exp10(lk)"or"10^lk"is analyzed inb^lkand reported inlk.- parameters
Character vector of additional symbols treated as parameters.
- fixed
Character vector of known symbols: a fixed parameter is a known constant, a fixed state has no unknown initial value.
- gaugePreference
FALSE(default) reconstructs every direction. Otherwise one coordinate per scaling is fixed first and only the general directions are reconstructed in that gauge.NULLchooses the gauge that leaves the general directions on the fewest coordinates; a character vector ranks the coordinates to fix (*as wildcard). The gauge is returned as$gauge.- forcings
Character vector of input states, 0 at the start and at rest.
- unknownInputs
Character vector of unknown functions of time of no assumed form: symbols in
fandgwithout an equation. A direction may change them along with the parameters; an exact one lists that change asinputChange. A character cell ofconditionsrenames an unknown input in that condition.- knownInputs
Character vector of known functions of time of no assumed form: symbols in
fandgwithout an equation whose values and time derivatives are known.- events
An eventlist with event times as numbers or expressions in the parameters, in chronological order. Root events are not supported. An event value named like a column of
conditionsis read from it.- conditions
Data frame with one row per condition and columns named by model symbols or event values. A numeric cell fixes the symbol, a character cell renames it. A column named like a dynamic state sets the initial value of the state. A direction is reported only if it is non-identifiable in every condition.
- regimes
For a model with switches, the regimes an experiment visits: a character vector of comparisons such as
"x > c", each selecting the regimes on that side of a switch, or a list of such vectors whose comparisons hold together; the first entry is the regime at the start. A list named by the rows ofconditionsgives them per condition. Without it every regime counts; a switch on parameters alone needs the side of the switch named here.- equilibrate
Logical. Start at a steady state of
fwith the inputs at 0; the earliest events apply on top. Coupled steady states may need msolve; when it is missing, an interactive session asks whether to build it into the symident cache (on Windows with Rtools). Defaults toFALSE.- reduceCQ
Logical, eqnlist only. Report the freedom of a conserved moiety on the total of the moiety (
TRUE) or on the initial value of one species (FALSE, default).- freeInitial
States, at most one per conserved quantity, holding the free resting value of their moiety under
equilibrate = TRUE, reduceCQ = FALSE.- reconstruct
Logical. Return general directions as exact rational functions instead of their support. Defaults to
FALSE.- positive
Coordinates known to be positive:
TRUE(default, all),FALSE(none) or a character vector.- verify
Logical. Check that the rank has saturated where the Lie order is not proven sufficient; the result is in
$info$verification. Defaults toTRUE.- cores
Number of threads and worker processes. Defaults to 1.
- control
A
reconstControl()list.- scalingsOnly
Logical. Only the scaling symmetries, from an exact integer kernel;
identifiable,rankanddimareNA. Defaults toFALSE.- symEngine
"modular"(default, finite fields) or"symbolic"(sympy, small models withoutequilibrateand later events).- mode
"local"(default) analyzes local identifiability only."global"analyzes it first, reduces the directions found and then counts the values of the coordinates with the output of a generic one and reconstructs the maps between them, asdiscreteSymmetries()(needs msolve, impliesreconstruct = TRUE). A model the global analysis does not handle gets the reason ininfo$discrete$unsupportedand a warning.- globalOptions
A list of arguments of the global analysis:
order,points,timeoutandbudgetas indiscreteSymmetries().- discrete
FALSE(default),TRUEor a list of arguments ofdiscreteSymmetries(): also search the discrete symmetries;mode = "global"does the same through the detection.- verbose
Logical. Print the result. Defaults to
FALSE.
Value
An object of class symmetrydetection:
identifiableTRUEorFALSE,NAwithscalingsOnly;FALSEholds as far asinfo$rankStatussays.rank,dimrank of the observability matrix and number of coordinates.
symmetriesthe directions, each a generator \(X = \sum_i \xi_i \partial_{\theta_i}\):
generator(\(\xi\) by coordinate),weights(a scaling's integer weights),type("scaling"or"general"),kind(the orbit geometry:"scaling", \(\xi_i = w_i \theta_i\), a line in logarithmic coordinates;"translation", constant \(\xi\), a line in linear coordinates;"curved", all others;NULLwithout closed form),degree,support,explicit,level,stateComponents,reason,route,display,completeGeneratorandfactor.levelis"exact"for a direction proven over the rationals,"verified"for one checked at random points modulo a large prime with an error bound,"checked"for one checked without an error bound (an unproven Lie or gap order, or a model outside the scope of the bound) and"open"without closed form;stateComponentsholds, for an exact direction, the components on the states of the field that proves it.infoengine, the Lie order and whether it is proven sufficient (lieOrderUsed,lieOrderDriver,liePlateau,lieCertified), the gap order of the events after the start and whether it is proven sufficient (gapOrderUsed,gapCertified,NULLwithout such events, andgapCertificate, why not),rankProven,rankProof,rankFields(a rank the invariant fields establish, checked at random points modulo a prime),rankFieldsBound(the probability that a wrong field passes),rankStatus(status"proven","verified"or"lower bound",whyandprobability),proof(why each"verified"or"checked"direction is not proven),assumptions(domain, the declared positive coordinates,starts, the sides of switches declared at the start, anderrorBound, the probability that a verified closed form or rank is wrong),bound(the probability that a wrong closed form passes the check, only where both orders are proven sufficient or the rank is settled),limits(what stopped part of the analysis),errors(exceptions turned into failed routes),branches(resting states with several roots modulo a prime, of which the first is taken),conditions,segments,coordinates,settings,elapsedandverification.gaugethe coordinates fixed under
gaugePreference.discreteSymmetrieswith
discrete, seediscreteSymmetries().callthe matched call.
print() shows the verdict and the generators, summary() also the
computation. Both take verbose and width.
Details
The analysis starts at the earliest event; later events split the time line into segments. Directions are reported in the original coordinates.
Every environment variable SYMIDENT_<NAME> set in R, also with
Sys.setenv() during the session, is passed to symident for the call.
The environment variables a user may need
are SYMIDENT_MSOLVE, the path of the msolve executable (unset by
default, msolve is then searched in the symident cache and on the
PATH), and SYMIDENT_CACHE, the directory of that cache (by default
~/.cache/symident on Linux). The other switches are diagnostic, see the
symident documentation at https://dmodverse.github.io/symident/.
See also
symmetryReduction(), reconstControl(); the guide chapter
Symmetries.
Examples
f <- eqnvec(m = "ktx - dm*m", p = "ktl*m - dp*p")
g <- eqnvec(y = "p")
res <- symmetryDetection(f, g, reconstruct = TRUE)
res
#> Result: rank 5 / 6 | 1 non-identifiable direction
#>
#> Generators X = Σᵢ ξ(i) ∂ᵢ
#>
#> Scalings:
#> X₁ (exact)
#> ξ(ktl) : + ktl
#> ξ(ktx) : - ktx
#> ξ(m) : - m
#>
#> exact = proven over Q.
#>
#>
#> Discrete symmetries: 0
summary(res)
#> ------------------------------------------------------------
#> detect | observability engine: modular (GF(p) + CRT)
#> ------------------------------------------------------------
#> Computation:
#> Lie order 4 (gap order 0), set by condition 1
#> rank: proven (1 directions, proven symmetries)
#> settings: reduce_cq=False, equilibrate=False, reconstruct=True
#>
#> Result: rank 5 / 6 | 1 non-identifiable direction
#>
#> Generators X = Σᵢ ξ(i) ∂ᵢ
#>
#> Scalings:
#> X₁ (exact)
#> ξ(ktl) : + ktl
#> ξ(ktx) : - ktx
#> ξ(m) : - m
#>
#> exact = proven over Q.
#>
#> Reduction:
#> X₁ is a scaling: gauge it by holding any one of the coordinates fixed, at
#> any value.
res$identifiable
#> [1] FALSE