Skip to contents

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. reduceCQ and equilibrate use 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 observable a*log(h) + c with a number a is analyzed through h.

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 through k = "exp(lk)", "exp10(lk)" or "10^lk" is analyzed in b^lk and reported in lk.

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. NULL chooses 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 f and g without an equation. A direction may change them along with the parameters; an exact one lists that change as inputChange. A character cell of conditions renames an unknown input in that condition.

knownInputs

Character vector of known functions of time of no assumed form: symbols in f and g without 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 conditions is 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 of conditions gives 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 f with 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 to FALSE.

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 to TRUE.

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, rank and dim are NA. Defaults to FALSE.

symEngine

"modular" (default, finite fields) or "symbolic" (sympy, small models without equilibrate and 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, as discreteSymmetries() (needs msolve, implies reconstruct = TRUE). A model the global analysis does not handle gets the reason in info$discrete$unsupported and a warning.

globalOptions

A list of arguments of the global analysis: order, points, timeout and budget as in discreteSymmetries().

discrete

FALSE (default), TRUE or a list of arguments of discreteSymmetries(): 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:

identifiable

TRUE or FALSE, NA with scalingsOnly; FALSE holds as far as info$rankStatus says.

rank, dim

rank of the observability matrix and number of coordinates.

symmetries

the 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; NULL without closed form), degree, support, explicit, level, stateComponents, reason, route, display, completeGenerator and factor. level is "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; stateComponents holds, for an exact direction, the components on the states of the field that proves it.

info

engine, 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, NULL without such events, and gapCertificate, 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", why and probability), 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, and errorBound, 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, elapsed and verification.

gauge

the coordinates fixed under gaugePreference.

discreteSymmetries

with discrete, see discreteSymmetries().

call

the 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

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