amici.amiciο
Core C++ bindings
This module encompasses the complete public C++ API of AMICI, which was
exposed via swig. All functions listed here are directly accessible in the
main amici package, i.e., amici.amici.ExpData
is available as
amici.ExpData
.
Usage of functions and classes from the base amici
package is
generally recommended as they often include convenience wrappers that avoid
common pitfalls when accessing C++ types from python and implement some
nonstandard type conversions.
Module Attributes
Don't compute sensitivities. |
|
First-order sensitivities. |
|
Second-order sensitivities. |
|
Don't compute sensitivities. |
|
Forward sensitivity analysis. |
|
Adjoint sensitivity analysis. |
|
deprecated |
Functions
AMICI extension was compiled with OpenMP? |
|
|
|
|
Apply parameter scaling according to scaling |
|
Remove parameter scaling according to scaling |
|
Swig-Generated class, which, in contrast to other Vector classes, does not allow for simple interoperability with common Python types, but must be created using |
|
Core integration routine. |
|
Same as runAmiciSimulation, but for multiple ExpData instances. |
|
Get the string representation of the given simulation status code (see ReturnData::status). |
Classes
|
Swig-Generated class templating common python types including |
|
|
|
Tracks elapsed CPU time using std::clock. |
|
Swig-Generated class templating common python types including |
|
ExpData carries all information about experimental or condition-specific data. |
|
Swig-Generated class that implements smart pointers to ExpData as objects. |
|
Swig-Generated class templating common python types including |
|
|
|
Swig-Generated class templating common python types including |
|
|
|
|
|
|
|
|
|
A log item. |
|
|
|
The Model class represents an AMICI ODE/DAE model. |
|
Container for model dimensions. |
|
Swig-Generated class that implements smart pointers to Model as objects. |
|
|
|
|
|
|
|
|
|
|
|
|
|
Stores all data to be returned by |
|
Swig-Generated class that implements smart pointers to ReturnData as objects. |
|
|
|
|
|
|
|
Container for various simulation parameters. |
|
The Solver class provides a generic interface to CVODES and IDAS solvers, individual realizations are realized in the CVodeSolver and the IDASolver class. |
|
Swig-Generated class that implements smart pointers to Solver as objects. |
|
|
|
|
|
|
|
|
|
Swig-Generated class templating |
|
Swig-Generated class templating common python types including |
- class amici.amici.BoolVector(*args)[source]ο
Swig-Generated class templating common python types including
Iterable
[bool
] andnumpy.array
[bool
] to facilitate interfacing with C++ bindings.
- class amici.amici.Constraint(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)ο
- __init__(*args, **kwds)ο
- negative = -2ο
- non_negative = 1ο
- non_positive = -1ο
- none = 0ο
- positive = 2ο
- class amici.amici.CpuTimer[source]ο
Tracks elapsed CPU time using std::clock.
- elapsed_milliseconds() float [source]ο
Get elapsed CPU time in milliseconds since initialization or last reset
- Return type:
- Returns:
CPU time in milliseconds
- elapsed_seconds() float [source]ο
Get elapsed CPU time in seconds since initialization or last reset
- Return type:
- Returns:
CPU time in seconds
- uses_thread_clock = Falseο
Whether the timer uses a thread clock (i.e. provides proper, thread-specific CPU time).
- class amici.amici.DoubleVector(*args)[source]ο
Swig-Generated class templating common python types including
Iterable
[float
] andnumpy.array
[float
] to facilitate interfacing with C++ bindings.
- class amici.amici.ExpData(*args)[source]ο
ExpData carries all information about experimental or condition-specific data.
- __init__(*args)[source]ο
Overload 1:
Default constructor.
Overload 2:
Copy constructor.
Overload 3:
Constructor that only initializes dimensions.
- Parameters:
Overload 4:
constructor that initializes timepoints from vectors
- Parameters:
nytrue (int) β Number of observables
nztrue (int) β Number of event outputs
nmaxevent (int) β Maximal number of events to track
ts (DoubleVector) β Timepoints (dimension: nt)
Overload 5:
constructor that initializes timepoints and fixed parameters from vectors
- Parameters:
nytrue (int) β Number of observables
nztrue (int) β Number of event outputs
nmaxevent (int) β Maximal number of events to track
ts (DoubleVector) β Timepoints (dimension: nt)
fixedParameters (DoubleVector) β Model constants (dimension: nk)
Overload 6:
constructor that initializes timepoints and data from vectors
- Parameters:
nytrue (int) β Number of observables
nztrue (int) β Number of event outputs
nmaxevent (int) β Maximal number of events to track
ts (DoubleVector) β Timepoints (dimension: nt)
observedData (DoubleVector) β observed data (dimension: nt x nytrue, row-major)
observedDataStdDev (DoubleVector) β standard deviation of observed data (dimension: nt x nytrue, row-major)
observedEvents (DoubleVector) β observed events (dimension: nmaxevents x nztrue, row-major)
observedEventsStdDev (DoubleVector) β standard deviation of observed events/roots (dimension: nmaxevents x nztrue, row-major)
Overload 7:
constructor that initializes with Model
- Parameters:
model (
Model
) β pointer to model specification object
Overload 8:
constructor that initializes with returnData, adds noise according to specified sigmas
- Parameters:
rdata (
ReturnData
) β return data pointer with stored simulation resultssigma_y (float) β scalar standard deviations for all observables
sigma_z (float) β scalar standard deviations for all event observables
Overload 9:
constructor that initializes with returnData, adds noise according to specified sigmas
- Parameters:
rdata (
ReturnData
) β return data pointer with stored simulation resultssigma_y (DoubleVector) β vector of standard deviations for observables (dimension: nytrue or nt x nytrue, row-major)
sigma_z (DoubleVector) β vector of standard deviations for event observables (dimension: nztrue or nmaxevent x nztrue, row-major)
- clear_observations()[source]ο
Set all observations and their standard deviations to NaN.
Useful, e.g., after calling ExpData::setTimepoints.
- property fixedParametersο
Model constants
Vector of size Model::nk() or empty
- property fixedParametersPreequilibrationο
Model constants for pre-equilibration
Vector of size Model::nk() or empty.
- property fixedParametersPresimulationο
Model constants for pre-simulation
Vector of size Model::nk() or empty.
- getObservedData() Sequence[float] [source]ο
Get all measurements.
- Return type:
- Returns:
observed data (dimension: nt x nytrue, row-major)
- getObservedDataStdDev() Sequence[float] [source]ο
Get measurement standard deviations.
- Return type:
- Returns:
standard deviation of observed data
- getObservedEvents() Sequence[float] [source]ο
Get observed event data.
- Return type:
- Returns:
observed event data
- getObservedEventsStdDev() Sequence[float] [source]ο
Get standard deviation of observed event data.
- Return type:
- Returns:
standard deviation of observed event data
- getObservedEventsStdDevPtr(ie: int) float [source]ο
Get pointer to standard deviation of observed event data at ie-th occurrence.
- getTimepoints() Sequence[float] [source]ο
Get output timepoints.
- Return type:
- Returns:
ExpData::ts
- property idο
Arbitrary (not necessarily unique) identifier.
- isSetObservedData(it: int, iy: int) bool [source]ο
Whether there is a measurement for the given time- and observable- index.
- isSetObservedDataStdDev(it: int, iy: int) bool [source]ο
Whether standard deviation for a measurement at specified timepoint- and observable index has been set.
- isSetObservedEvents(ie: int, iz: int) bool [source]ο
Check whether event data at specified indices has been set.
- isSetObservedEventsStdDev(ie: int, iz: int) bool [source]ο
Check whether standard deviation of event data at specified indices has been set.
- nmaxevent() int [source]ο
maximal number of events to track
- Return type:
- Returns:
maximal number of events to track
- nytrue() int [source]ο
number of observables of the non-augmented model
- Return type:
- Returns:
number of observables of the non-augmented model
- nztrue() int [source]ο
number of event observables of the non-augmented model
- Return type:
- Returns:
number of event observables of the non-augmented model
- property parametersο
Model parameters
Vector of size Model::np() or empty with parameter scaled according to SimulationParameter::pscale.
- property plistο
Parameter indices w.r.t. which to compute sensitivities
- property pscaleο
Parameter scales
Vector of parameter scale of size Model::np(), indicating how/if each parameter is to be scaled.
- property reinitialization_state_idxs_presimο
Indices of states to be reinitialized based on provided presimulation constants / fixed parameters.
- property reinitialization_state_idxs_simο
Indices of states to be reinitialized based on provided constants / fixed parameters.
- reinitializeAllFixedParameterDependentInitialStates(nx_rdata: int)ο
Set reinitialization of all states based on model constants for all simulation phases.
Convenience function to populate reinitialization_state_idxs_presim and reinitialization_state_idxs_sim
- Parameters:
nx_rdata (
int
) β Number of states (Model::nx_rdata)
- reinitializeAllFixedParameterDependentInitialStatesForPresimulation(nx_rdata: int)ο
Set reinitialization of all states based on model constants for presimulation (only meaningful if preequilibration is performed).
Convenience function to populate reinitialization_state_idxs_presim and reinitialization_state_idxs_sim
- Parameters:
nx_rdata (
int
) β Number of states (Model::nx_rdata)
- reinitializeAllFixedParameterDependentInitialStatesForSimulation(nx_rdata: int)ο
Set reinitialization of all states based on model constants for the βmainβ simulation (only meaningful if presimulation or preequilibration is performed).
Convenience function to populate reinitialization_state_idxs_presim and reinitialization_state_idxs_sim
- Parameters:
nx_rdata (
int
) β Number of states (Model::nx_rdata)
- property reinitializeFixedParameterInitialStatesο
Flag indicating whether reinitialization of states depending on fixed parameters is activated
- setObservedData(*args)[source]ο
Overload 1:
Set all measurements.
- Parameters:
observedData (DoubleVector) β observed data (dimension: nt x nytrue, row-major)
Overload 2:
Set measurements for a given observable index
- Parameters:
observedData (DoubleVector) β observed data (dimension: nt)
iy (int) β observed data index
- setObservedDataStdDev(*args)[source]ο
Overload 1:
Set standard deviations for measurements.
- Parameters:
observedDataStdDev (DoubleVector) β standard deviation of observed data (dimension: nt x nytrue, row-major)
Overload 2:
Set identical standard deviation for all measurements.
- Parameters:
stdDev (float) β standard deviation (dimension: scalar)
Overload 3:
Set standard deviations of observed data for a specific observable index.
- Parameters:
observedDataStdDev (DoubleVector) β standard deviation of observed data (dimension: nt)
iy (int) β observed data index
Overload 4:
Set all standard deviation for a given observable index to the input value.
- setObservedEvents(*args)[source]ο
Overload 1:
Set observed event data.
- Parameters:
observedEvents (DoubleVector) β observed data (dimension: nmaxevent x nztrue, row-major)
Overload 2:
Set observed event data for specific event observable.
- Parameters:
observedEvents (DoubleVector) β observed data (dimension: nmaxevent)
iz (int) β observed event data index
- setObservedEventsStdDev(*args)[source]ο
Overload 1:
Set standard deviation of observed event data.
- Parameters:
observedEventsStdDev (DoubleVector) β standard deviation of observed event data
Overload 2:
Set standard deviation of observed event data.
- Parameters:
stdDev (float) β standard deviation (dimension: scalar)
Overload 3:
Set standard deviation of observed data for a specific observable.
- Parameters:
observedEventsStdDev (DoubleVector) β standard deviation of observed data (dimension: nmaxevent)
iz (int) β observed data index
Overload 4:
Set all standard deviations of a specific event-observable.
- setTimepoints(ts: Sequence[float])[source]ο
Set output timepoints.
If the number of timepoint increases, this will grow the observation/sigma matrices and fill new entries with NaN. If the number of timepoints decreases, this will shrink the observation/sigma matrices.
Note that the mapping from timepoints to measurements will not be preserved. E.g., say there are measurements at t = 2, and this function is called with [1, 2], then the old measurements will belong to t = 1.
- Parameters:
ts (
typing.Sequence
[float
]) β timepoints
- property sx0ο
Initial state sensitivities
Dimensions: Model::nx() * Model::nplist(), Model::nx() * ExpData::plist.size(), if ExpData::plist is not empty, or empty
- property t_presimο
Duration of pre-simulation.
If this is > 0, presimulation will be performed from (model->t0 - t_presim) to model->t0 using the fixedParameters in fixedParametersPresimulation
- property ts_ο
Timepoints for which model state/outputs/β¦ are requested
Vector of timepoints.
- property tstart_ο
Starting time of the simulation.
Output timepoints are absolute timepoints, independent of \(t_{start}\). For output timepoints \(t < t_{start}\), the initial state will be returned.
- property x0ο
Initial state
Vector of size Model::nx() or empty
- class amici.amici.ExpDataPtr(*args)[source]ο
Swig-Generated class that implements smart pointers to ExpData as objects.
- property fixedParametersο
Model constants
Vector of size Model::nk() or empty
- property fixedParametersPreequilibrationο
Model constants for pre-equilibration
Vector of size Model::nk() or empty.
- property fixedParametersPresimulationο
Model constants for pre-simulation
Vector of size Model::nk() or empty.
- property idο
Arbitrary (not necessarily unique) identifier.
- property parametersο
Model parameters
Vector of size Model::np() or empty with parameter scaled according to SimulationParameter::pscale.
- property plistο
Parameter indices w.r.t. which to compute sensitivities
- property pscaleο
Parameter scales
Vector of parameter scale of size Model::np(), indicating how/if each parameter is to be scaled.
- property reinitialization_state_idxs_presimο
Indices of states to be reinitialized based on provided presimulation constants / fixed parameters.
- property reinitialization_state_idxs_simο
Indices of states to be reinitialized based on provided constants / fixed parameters.
- property reinitializeFixedParameterInitialStatesο
Flag indicating whether reinitialization of states depending on fixed parameters is activated
- property sx0ο
Initial state sensitivities
Dimensions: Model::nx() * Model::nplist(), Model::nx() * ExpData::plist.size(), if ExpData::plist is not empty, or empty
- property t_presimο
Duration of pre-simulation.
If this is > 0, presimulation will be performed from (model->t0 - t_presim) to model->t0 using the fixedParameters in fixedParametersPresimulation
- property ts_ο
Timepoints for which model state/outputs/β¦ are requested
Vector of timepoints.
- property tstart_ο
Starting time of the simulation.
Output timepoints are absolute timepoints, independent of \(t_{start}\). For output timepoints \(t < t_{start}\), the initial state will be returned.
- property x0ο
Initial state
Vector of size Model::nx() or empty
- class amici.amici.ExpDataPtrVector(*args)[source]ο
Swig-Generated class templating common python types including
Iterable
[amici.amici.ExpData
] andnumpy.array
[amici.amici.ExpData
] to facilitate interfacing with C++ bindings.
- class amici.amici.FixedParameterContext(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)ο
- __init__(*args, **kwds)ο
- preequilibration = 1ο
- presimulation = 2ο
- simulation = 0ο
- class amici.amici.IntVector(*args)[source]ο
Swig-Generated class templating common python types including
Iterable
[int
] andnumpy.array
[int
] to facilitate interfacing with C++ bindings.
- class amici.amici.InternalSensitivityMethod(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)ο
- __init__(*args, **kwds)ο
- simultaneous = 1ο
- staggered = 2ο
- staggered1 = 3ο
- class amici.amici.InterpolationType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)ο
- __init__(*args, **kwds)ο
- hermite = 1ο
- polynomial = 2ο
- class amici.amici.LinearMultistepMethod(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)ο
- BDF = 2ο
- __init__(*args, **kwds)ο
- adams = 1ο
- class amici.amici.LinearSolver(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)ο
- KLU = 9ο
- LAPACKBand = 4ο
- LAPACKDense = 3ο
- SPBCG = 7ο
- SPGMR = 6ο
- SPTFQMR = 8ο
- SuperLUMT = 10ο
- __init__(*args, **kwds)ο
- band = 2ο
- dense = 1ο
- diag = 5ο
- class amici.amici.LogItem(*args)[source]ο
A log item.
- property identifierο
Short identifier for the logged event
- property messageο
A more detailed and readable message
- property severityο
Severity level
- class amici.amici.Model(*args, **kwargs)[source]ο
The Model class represents an AMICI ODE/DAE model.
The model can compute various model related quantities based on symbolically generated code.
- __init__(*args, **kwargs)[source]ο
- Overload 1:
Default ctor
Overload 2:
Constructor with model dimensions
- Parameters:
nx_rdata (int) β Number of state variables
nxtrue_rdata (int) β Number of state variables of the non-augmented model
nx_solver (int) β Number of state variables with conservation laws applied
nxtrue_solver (int) β Number of state variables of the non-augmented model with conservation laws applied
nx_solver_reinit (int) β Number of state variables with conservation laws subject to reinitialization
np (int) β Number of parameters
nk (int) β Number of constants
ny (int) β Number of observables
nytrue (int) β Number of observables of the non-augmented model
nz (int) β Number of event observables
nztrue (int) β Number of event observables of the non-augmented model
ne (int) β Number of events
ne_solver (int) β Number of events that require root-finding
nspl (int) β Number of splines
nJ (int) β Number of objective functions
nw (int) β Number of repeating elements
ndwdx (int) β Number of nonzero elements in the x derivative of the repeating elements
ndwdp (int) β Number of nonzero elements in the p derivative of the repeating elements
ndwdw (int) β Number of nonzero elements in the w derivative of the repeating elements
ndxdotdw (int) β Number of nonzero elements in the \(w\) derivative of \(xdot\)
ndJydy (IntVector) β Number of nonzero elements in the \(y\) derivative of \(dJy\) (shape nytrue)
ndxrdatadxsolver (int) β Number of nonzero elements in the \(x\) derivative of \(x_rdata\)
ndxrdatadtcl (int) β Number of nonzero elements in the \(tcl\) derivative of \(x_rdata\)
ndtotal_cldx_rdata (int) β Number of nonzero elements in the \(x_rdata\) derivative of \(total_cl\)
nnz (int) β Number of nonzero elements in Jacobian
ubw (int) β Upper matrix bandwidth in the Jacobian
lbw (int) β Lower matrix bandwidth in the Jacobian
- fdsigmaydy(dsigmaydy: float, t: float, p: float, k: float, y: float)ο
Model-specific implementation of fsigmay
- fdspline_slopesdp(dspline_slopesdp: float, p: float, k: float, ip: int)ο
Model-specific implementation the parametric derivatives of slopevalues at spline nodes
- fdspline_valuesdp(dspline_valuesdp: float, p: float, k: float, ip: int)ο
Model-specific implementation the parametric derivatives of spline node values
- fdtotal_cldp(dtotal_cldp: float, x_rdata: float, p: float, k: float, ip: int)ο
Compute dtotal_cl / dp
- fdtotal_cldx_rdata(dtotal_cldx_rdata: float, x_rdata: float, p: float, k: float, tcl: float)ο
Compute dtotal_cl / dx_rdata
- fdx_rdatadp(dx_rdatadp: float, x: float, tcl: float, p: float, k: float, ip: int)ο
Compute dx_rdata / dp
- fdx_rdatadtcl(dx_rdatadtcl: float, x: float, tcl: float, p: float, k: float)ο
Compute dx_rdata / dtcl
- fdx_rdatadx_solver(dx_rdatadx_solver: float, x: float, tcl: float, p: float, k: float)ο
Compute dx_rdata / dx_solver
- getAddSigmaResiduals() bool [source]ο
Checks whether residuals should be added to account for parameter dependent sigma.
- Return type:
- Returns:
sigma_res
- getAlwaysCheckFinite() bool [source]ο
Get setting of whether the result of every call to Model::f* should be checked for finiteness.
- Return type:
- Returns:
that
- getAmiciCommit() str ο
Returns the AMICI commit that was used to generate the model
- Return type:
- Returns:
AMICI commit string
- getAmiciVersion() str ο
Returns the AMICI version that was used to generate the model
- Return type:
- Returns:
AMICI version string
- getExpressionIds() Sequence[str] [source]ο
Get IDs of the expression.
- Return type:
- Returns:
Expression IDs
- getExpressionNames() Sequence[str] [source]ο
Get names of the expressions.
- Return type:
- Returns:
Expression names
- getFixedParameterById(par_id: str) float [source]ο
Get value of fixed parameter with the specified ID.
- getFixedParameterByName(par_name: str) float [source]ο
Get value of fixed parameter with the specified name.
If multiple parameters have the same name, the first parameter with matching name is returned.
- getFixedParameterIds() Sequence[str] [source]ο
Get IDs of the fixed model parameters.
- Return type:
- Returns:
Fixed parameter IDs
- getFixedParameterNames() Sequence[str] [source]ο
Get names of the fixed model parameters.
- Return type:
- Returns:
Fixed parameter names
- getFixedParameters() Sequence[float] [source]ο
Get values of fixed parameters.
- Return type:
- Returns:
Vector of fixed parameters with same ordering as in Model::getFixedParameterIds
- getInitialStateSensitivities() Sequence[float] [source]ο
Get the initial states sensitivities.
- Return type:
- Returns:
vector of initial state sensitivities
- getInitialStates() Sequence[float] [source]ο
Get the initial states.
- Return type:
- Returns:
Initial state vector
- getMinimumSigmaResiduals() float [source]ο
Gets the specified estimated lower boundary for sigma_y.
- Return type:
- Returns:
lower boundary
- getObservableIds() Sequence[str] [source]ο
Get IDs of the observables.
- Return type:
- Returns:
Observable IDs
- getObservableNames() Sequence[str] [source]ο
Get names of the observables.
- Return type:
- Returns:
Observable names
- getParameterById(par_id: str) float [source]ο
Get value of first model parameter with the specified ID.
- getParameterByName(par_name: str) float [source]ο
Get value of first model parameter with the specified name.
- getParameterIds() Sequence[str] [source]ο
Get IDs of the model parameters.
- Return type:
- Returns:
Parameter IDs
- getParameterList() Sequence[int] [source]ο
Get the list of parameters for which sensitivities are computed.
- Return type:
- Returns:
List of parameter indices
- getParameterNames() Sequence[str] [source]ο
Get names of the model parameters.
- Return type:
- Returns:
The parameter names
- getParameterScale() ParameterScalingVector [source]ο
Get parameter scale for each parameter.
- Return type:
- Returns:
Vector of parameter scales
- getParameters() Sequence[float] [source]ο
Get parameter vector.
- Return type:
- Returns:
The user-set parameters (see also Model::getUnscaledParameters)
- getReinitializationStateIdxs() Sequence[int] [source]ο
Return indices of states to be reinitialized based on provided constants / fixed parameters
- Return type:
- Returns:
Those indices.
- getReinitializeFixedParameterInitialStates() bool [source]ο
Get whether initial states depending on fixedParameters are to be reinitialized after preequilibration and presimulation.
- Return type:
- Returns:
flag true / false
- getStateIds() Sequence[str] [source]ο
Get IDs of the model states.
- Return type:
- Returns:
State IDs
- getStateIdsSolver() Sequence[str] [source]ο
Get IDs of the solver states.
- Return type:
- Returns:
State IDs
- getStateIsNonNegative() Sequence[bool] [source]ο
Get flags indicating whether states should be treated as non-negative.
- Return type:
- Returns:
Vector of flags
- getStateNames() Sequence[str] [source]ο
Get names of the model states.
- Return type:
- Returns:
State names
- getStateNamesSolver() Sequence[str] [source]ο
Get names of the solver states.
- Return type:
- Returns:
State names
- getSteadyStateComputationMode() int [source]ο
Gets the mode how steady state is computed in the steadystate simulation.
- Return type:
- Returns:
Mode
- getSteadyStateSensitivityMode() SteadyStateSensitivityMode [source]ο
Gets the mode how sensitivities are computed in the steadystate simulation.
- Return type:
- Returns:
Mode
- getTimepoints() Sequence[float] [source]ο
Get the timepoint vector.
- Return type:
- Returns:
Timepoint vector
- getUnscaledParameters() Sequence[float] [source]ο
Get parameters with transformation according to parameter scale applied.
- Return type:
- Returns:
Unscaled parameters
- get_trigger_timepoints() Sequence[float] [source]ο
Get trigger times for events that donβt require root-finding.
- Return type:
- Returns:
List of unique trigger points for events that donβt require root-finding (i.e. that trigger at predetermined timepoints), in ascending order.
- hasCustomInitialStateSensitivities() bool [source]ο
Return whether custom initial state sensitivities have been set.
- Return type:
- Returns:
true if has custom initial state sensitivities, otherwise false.
- hasCustomInitialStates() bool [source]ο
Return whether custom initial states have been set.
- Return type:
- Returns:
true if has custom initial states, otherwise false
- hasExpressionIds() bool [source]ο
Report whether the model has expression IDs set.
- Return type:
- Returns:
Boolean indicating whether expression ids were set. Also returns true if the number of corresponding variables is just zero.
- hasExpressionNames() bool [source]ο
Report whether the model has expression names set.
- Return type:
- Returns:
Boolean indicating whether expression names were set. Also returns true if the number of corresponding variables is just zero.
- hasFixedParameterIds() bool [source]ο
Report whether the model has fixed parameter IDs set.
- Return type:
- Returns:
Boolean indicating whether fixed parameter IDs were set. Also returns true if the number of corresponding variables is just zero.
- hasFixedParameterNames() bool [source]ο
Report whether the model has fixed parameter names set.
- Return type:
- Returns:
Boolean indicating whether fixed parameter names were set. Also returns true if the number of corresponding variables is just zero.
- hasObservableIds() bool [source]ο
Report whether the model has observable IDs set.
- Return type:
- Returns:
Boolean indicating whether observable ids were set. Also returns true if the number of corresponding variables is just zero.
- hasObservableNames() bool [source]ο
Report whether the model has observable names set.
- Return type:
- Returns:
Boolean indicating whether observable names were set. Also returns true if the number of corresponding variables is just zero.
- hasParameterIds() bool [source]ο
Report whether the model has parameter IDs set.
- Return type:
- Returns:
Boolean indicating whether parameter IDs were set. Also returns true if the number of corresponding variables is just zero.
- hasParameterNames() bool [source]ο
Report whether the model has parameter names set.
- Return type:
- Returns:
Boolean indicating whether parameter names were set. Also returns true if the number of corresponding variables is just zero.
- hasQuadraticLLH() bool [source]ο
Checks whether the defined noise model is gaussian, i.e., the nllh is quadratic
- Return type:
- Returns:
boolean flag
- hasStateIds() bool [source]ο
Report whether the model has state IDs set.
- Return type:
- Returns:
Boolean indicating whether state IDs were set. Also returns true if the number of corresponding variables is just zero.
- hasStateNames() bool [source]ο
Report whether the model has state names set.
- Return type:
- Returns:
Boolean indicating whether state names were set. Also returns true if the number of corresponding variables is just zero.
- property idlistο
Flag array for DAE equations
- isFixedParameterStateReinitializationAllowed() bool ο
Function indicating whether reinitialization of states depending on fixed parameters is permissible
- Return type:
- Returns:
flag indicating whether reinitialization of states depending on fixed parameters is permissible
- property lbwο
Lower bandwidth of the Jacobian
- property loggerο
Logger
- property nJο
Dimension of the augmented objective function for 2nd order ASA
- nMaxEvent() int [source]ο
Get maximum number of events that may occur for each type.
- Return type:
- Returns:
Maximum number of events that may occur for each type
- ncl() int [source]ο
Get number of conservation laws.
- Return type:
- Returns:
Number of conservation laws (i.e., difference between nx_rdata and nx_solver).
- property ndJydyο
Number of nonzero elements in the \(y\) derivative of \(dJy\) (dimension nytrue)
- property ndtotal_cldx_rdataο
Number of nonzero elements in the \(x_rdata\) derivative of \(total_cl\)
- property ndwdpο
Number of nonzero elements in the p derivative of the repeating elements
- property ndwdwο
Number of nonzero elements in the w derivative of the repeating elements
- property ndwdxο
Number of nonzero elements in the x derivative of the repeating elements
- property ndxdotdwο
Number of nonzero elements in the \(w\) derivative of \(xdot\)
- property ndxrdatadtclο
Number of nonzero elements in the \(tcl\) derivative of \(x_rdata\)
- property ndxrdatadxsolverο
Number of nonzero elements in the \(x\) derivative of \(x_rdata\)
- property neο
Number of events
- property ne_solverο
Number of events that require root-finding
- property nnzο
Number of nonzero entries in Jacobian
- np() int [source]ο
Get total number of model parameters.
- Return type:
- Returns:
Length of parameter vector
- nplist() int [source]ο
Get number of parameters wrt to which sensitivities are computed.
- Return type:
- Returns:
Length of sensitivity index vector
- property nsplο
Number of spline functions in the model
- property nwο
Number of common expressions
- property nx_rdataο
Number of states
- nx_reinit() int [source]ο
Get number of solver states subject to reinitialization.
- Return type:
- Returns:
Model member nx_solver_reinit
- property nx_solverο
Number of states with conservation laws applied
- property nx_solver_reinitο
Number of solver states subject to reinitialization
- property nxtrue_rdataο
Number of states in the unaugmented system
- property nxtrue_solverο
Number of states in the unaugmented system with conservation laws applied
- property nyο
Number of observables
- property nytrueο
Number of observables in the unaugmented system
- property nzο
Number of event outputs
- property nztrueο
Number of event outputs in the unaugmented system
- property o2modeο
Flag indicating whether for amici::Solver::sensi_ == amici::SensitivityOrder::second directional or full second order derivative will be computed
- property pythonGeneratedο
Flag indicating Matlab- or Python-based model generation
- requireSensitivitiesForAllParameters()[source]ο
Require computation of sensitivities for all parameters p [0..np[ in natural order.
NOTE: Resets initial state sensitivities.
- setAddSigmaResiduals(sigma_res: bool)[source]ο
Specifies whether residuals should be added to account for parameter dependent sigma.
If set to true, additional residuals of the form \(\sqrt{\log(\sigma) +C}\) will be added. This enables least-squares optimization for variables with Gaussian noise assumption and parameter dependent standard deviation sigma. The constant \(C\) can be set via
setMinimumSigmaResiduals()
.- Parameters:
sigma_res (
bool
) β if true, additional residuals are added
- setAllStatesNonNegative()[source]ο
Set flags indicating that all states should be treated as non-negative.
- setAlwaysCheckFinite(alwaysCheck: bool)[source]ο
Set whether the result of every call to Model::f* should be checked for finiteness.
- Parameters:
alwaysCheck (
bool
)
- setFixedParameterById(par_id: str, value: float)[source]ο
Set value of first fixed parameter with the specified ID.
- setFixedParameterByName(par_name: str, value: float)[source]ο
Set value of first fixed parameter with the specified name.
- setFixedParameters(k: Sequence[float])[source]ο
Set values for constants.
- Parameters:
k (
typing.Sequence
[float
]) β Vector of fixed parameters
- setFixedParametersByIdRegex(par_id_regex: str, value: float) int [source]ο
Set values of all fixed parameters with the ID matching the specified regex.
- setFixedParametersByNameRegex(par_name_regex: str, value: float) int [source]ο
Set value of all fixed parameters with name matching the specified regex.
- setInitialStateSensitivities(sx0: Sequence[float])[source]ο
Set the initial state sensitivities.
- Parameters:
sx0 (
typing.Sequence
[float
]) β vector of initial state sensitivities with chainrule applied. This could be a slice of ReturnData::sx or ReturnData::sx0
- setInitialStates(x0: Sequence[float])[source]ο
Set the initial states.
- Parameters:
x0 (
typing.Sequence
[float
]) β Initial state vector
- setMinimumSigmaResiduals(min_sigma: float)[source]ο
Sets the estimated lower boundary for sigma_y. When
setAddSigmaResiduals()
is activated, this lower boundary must ensure that log(sigma) + min_sigma > 0.- Parameters:
min_sigma (
float
) β lower boundary
- setNMaxEvent(nmaxevent: int)[source]ο
Set maximum number of events that may occur for each type.
- Parameters:
nmaxevent (
int
) β Maximum number of events that may occur for each type
- setParameterById(*args)[source]ο
Overload 1:
Set model parameters according to the parameter IDs and mapped values.
- Parameters:
p (StringDoubleMap) β Map of parameters IDs and values
ignoreErrors (boolean, optional) β Ignore errors such as parameter IDs in p which are not model parameters
Overload 2:
Set value of first model parameter with the specified ID.
- setParameterByName(*args)[source]ο
Overload 1:
Set value of first model parameter with the specified name.
Overload 2:
Set model parameters according to the parameter name and mapped values.
- Parameters:
p (StringDoubleMap) β Map of parameters names and values
ignoreErrors (boolean, optional) β Ignore errors such as parameter names in p which are not model parameters
Overload 3:
Set model parameters according to the parameter name and mapped values.
- Parameters:
p (StringDoubleMap) β Map of parameters names and values
ignoreErrors β Ignore errors such as parameter names in p which are not model parameters
- setParameterList(plist: Sequence[int])[source]ο
Set the list of parameters for which sensitivities are to be computed.
NOTE: Resets initial state sensitivities.
- Parameters:
plist (
typing.Sequence
[int
]) β List of parameter indices
- setParameters(p: Sequence[float])[source]ο
Set the parameter vector.
- Parameters:
p (
typing.Sequence
[float
]) β Vector of parameters
- setParametersByIdRegex(par_id_regex: str, value: float) int [source]ο
Set all values of model parameters with IDs matching the specified regular expression.
- setParametersByNameRegex(par_name_regex: str, value: float) int [source]ο
Set all values of all model parameters with names matching the specified regex.
- setReinitializationStateIdxs(idxs: Sequence[int])[source]ο
Set indices of states to be reinitialized based on provided constants / fixed parameters
- Parameters:
idxs (
typing.Sequence
[int
]) β Array of state indices
- setReinitializeFixedParameterInitialStates(flag: bool)[source]ο
Set whether initial states depending on fixed parameters are to be reinitialized after preequilibration and presimulation.
- Parameters:
flag (
bool
) β Fixed parameters reinitialized?
- setStateIsNonNegative(stateIsNonNegative: Sequence[bool])[source]ο
Set flags indicating whether states should be treated as non-negative.
- Parameters:
stateIsNonNegative (
typing.Sequence
[bool
]) β Vector of flags
- setSteadyStateComputationMode(mode: int)[source]ο
Set the mode how steady state is computed in the steadystate simulation.
- Parameters:
mode (
int
) β Steadystate computation mode
- setSteadyStateSensitivityMode(mode: SteadyStateSensitivityMode)[source]ο
Set the mode how sensitivities are computed in the steadystate simulation.
- Parameters:
mode (
amici.amici.SteadyStateSensitivityMode
) β Steadystate sensitivity mode
- setT0(t0: float)[source]ο
Set simulation start time.
Output timepoints are absolute timepoints, independent of \(t_{0}\). For output timepoints \(t < t_{0}\), the initial state will be returned.
- Parameters:
t0 (
float
) β Simulation start time
- setTimepoints(ts: Sequence[float])[source]ο
Set the timepoint vector.
- Parameters:
ts (
typing.Sequence
[float
]) β New timepoint vector
- setUnscaledInitialStateSensitivities(sx0: Sequence[float])[source]ο
Set the initial state sensitivities.
- Parameters:
sx0 (
typing.Sequence
[float
]) β Vector of initial state sensitivities without chainrule applied. This could be the readin from a model.sx0data saved to HDF5.
- property state_independent_events_ο
Map of trigger timepoints to event indices for events that donβt require root-finding.
- property ubwο
Upper bandwidth of the Jacobian
- class amici.amici.ModelDimensions(*args)[source]ο
Container for model dimensions.
Holds number of states, observables, etc.
- __init__(*args)[source]ο
- Overload 1:
Default ctor
Overload 2:
Constructor with model dimensions
- Parameters:
nx_rdata (int) β Number of state variables
nxtrue_rdata (int) β Number of state variables of the non-augmented model
nx_solver (int) β Number of state variables with conservation laws applied
nxtrue_solver (int) β Number of state variables of the non-augmented model with conservation laws applied
nx_solver_reinit (int) β Number of state variables with conservation laws subject to reinitialization
np (int) β Number of parameters
nk (int) β Number of constants
ny (int) β Number of observables
nytrue (int) β Number of observables of the non-augmented model
nz (int) β Number of event observables
nztrue (int) β Number of event observables of the non-augmented model
ne (int) β Number of events
ne_solver (int) β Number of events that require root-finding
nspl (int) β Number of splines
nJ (int) β Number of objective functions
nw (int) β Number of repeating elements
ndwdx (int) β Number of nonzero elements in the x derivative of the repeating elements
ndwdp (int) β Number of nonzero elements in the p derivative of the repeating elements
ndwdw (int) β Number of nonzero elements in the w derivative of the repeating elements
ndxdotdw (int) β Number of nonzero elements in the \(w\) derivative of \(xdot\)
ndJydy (IntVector) β Number of nonzero elements in the \(y\) derivative of \(dJy\) (shape nytrue)
ndxrdatadxsolver (int) β Number of nonzero elements in the \(x\) derivative of \(x_rdata\)
ndxrdatadtcl (int) β Number of nonzero elements in the \(tcl\) derivative of \(x_rdata\)
ndtotal_cldx_rdata (int) β Number of nonzero elements in the \(x_rdata\) derivative of \(total_cl\)
nnz (int) β Number of nonzero elements in Jacobian
ubw (int) β Upper matrix bandwidth in the Jacobian
lbw (int) β Lower matrix bandwidth in the Jacobian
- property lbwο
Lower bandwidth of the Jacobian
- property nJο
Dimension of the augmented objective function for 2nd order ASA
- property ndJydyο
Number of nonzero elements in the \(y\) derivative of \(dJy\) (dimension nytrue)
- property ndtotal_cldx_rdataο
Number of nonzero elements in the \(x_rdata\) derivative of \(total_cl\)
- property ndwdpο
Number of nonzero elements in the p derivative of the repeating elements
- property ndwdwο
Number of nonzero elements in the w derivative of the repeating elements
- property ndwdxο
Number of nonzero elements in the x derivative of the repeating elements
- property ndxdotdwο
Number of nonzero elements in the \(w\) derivative of \(xdot\)
- property ndxrdatadtclο
Number of nonzero elements in the \(tcl\) derivative of \(x_rdata\)
- property ndxrdatadxsolverο
Number of nonzero elements in the \(x\) derivative of \(x_rdata\)
- property neο
Number of events
- property ne_solverο
Number of events that require root-finding
- property nkο
Number of constants
- property nnzο
Number of nonzero entries in Jacobian
- property npο
Number of parameters
- property nsplο
Number of spline functions in the model
- property nwο
Number of common expressions
- property nx_rdataο
Number of states
- property nx_solverο
Number of states with conservation laws applied
- property nx_solver_reinitο
Number of solver states subject to reinitialization
- property nxtrue_rdataο
Number of states in the unaugmented system
- property nxtrue_solverο
Number of states in the unaugmented system with conservation laws applied
- property nyο
Number of observables
- property nytrueο
Number of observables in the unaugmented system
- property nzο
Number of event outputs
- property nztrueο
Number of event outputs in the unaugmented system
- property ubwο
Upper bandwidth of the Jacobian
- class amici.amici.ModelPtr(*args)[source]ο
Swig-Generated class that implements smart pointers to Model as objects.
- property idlistο
Flag array for DAE equations
- property lbwο
Lower bandwidth of the Jacobian
- property loggerο
Logger
- property nJο
Dimension of the augmented objective function for 2nd order ASA
- property ndJydyο
Number of nonzero elements in the \(y\) derivative of \(dJy\) (dimension nytrue)
- property ndtotal_cldx_rdataο
Number of nonzero elements in the \(x_rdata\) derivative of \(total_cl\)
- property ndwdpο
Number of nonzero elements in the p derivative of the repeating elements
- property ndwdwο
Number of nonzero elements in the w derivative of the repeating elements
- property ndwdxο
Number of nonzero elements in the x derivative of the repeating elements
- property ndxdotdwο
Number of nonzero elements in the \(w\) derivative of \(xdot\)
- property ndxrdatadtclο
Number of nonzero elements in the \(tcl\) derivative of \(x_rdata\)
- property ndxrdatadxsolverο
Number of nonzero elements in the \(x\) derivative of \(x_rdata\)
- property neο
Number of events
- property ne_solverο
Number of events that require root-finding
- property nnzο
Number of nonzero entries in Jacobian
- property nsplο
Number of spline functions in the model
- property nwο
Number of common expressions
- property nx_rdataο
Number of states
- property nx_solverο
Number of states with conservation laws applied
- property nx_solver_reinitο
Number of solver states subject to reinitialization
- property nxtrue_rdataο
Number of states in the unaugmented system
- property nxtrue_solverο
Number of states in the unaugmented system with conservation laws applied
- property nyο
Number of observables
- property nytrueο
Number of observables in the unaugmented system
- property nzο
Number of event outputs
- property nztrueο
Number of event outputs in the unaugmented system
- property o2modeο
Flag indicating whether for amici::Solver::sensi_ == amici::SensitivityOrder::second directional or full second order derivative will be computed
- property pythonGeneratedο
Flag indicating Matlab- or Python-based model generation
- property state_independent_events_ο
Map of trigger timepoints to event indices for events that donβt require root-finding.
- property ubwο
Upper bandwidth of the Jacobian
- class amici.amici.NewtonDampingFactorMode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)ο
- __init__(*args, **kwds)ο
- off = 0ο
- on = 1ο
- class amici.amici.NonlinearSolverIteration(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)ο
- __init__(*args, **kwds)ο
- fixedpoint = 1ο
- functional = 1ο
- newton = 2ο
- amici.amici.NonlinearSolverIteration_fixedpoint = 1ο
deprecated
- class amici.amici.ObservableScaling(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)ο
- __init__(*args, **kwds)ο
- lin = 0ο
- log = 1ο
- log10 = 2ο
- class amici.amici.ParameterScaling(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)ο
- __init__(*args, **kwds)ο
- ln = 1ο
- log10 = 2ο
- none = 0ο
- class amici.amici.RDataReporting(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)ο
- __init__(*args, **kwds)ο
- full = 0ο
- likelihood = 2ο
- residuals = 1ο
- class amici.amici.ReturnData(*args)[source]ο
Stores all data to be returned by
amici.amici.runAmiciSimulation()
.NOTE: multi-dimensional arrays are stored in row-major order (C-style)
- property FIMο
fisher information matrix (shape nplist x nplist, row-major)
- property Jο
Jacobian of differential equation right hand side (shape nx x nx, row-major) evaluated at t_last.
- __init__(*args)[source]ο
Overload 1:
Default constructor
Overload 2:
Constructor
- Parameters:
ts (DoubleVector) β see amici::SimulationParameters::ts
model_dimensions (
ModelDimensions
) β Model dimensionsnplist (int) β see amici::ModelDimensions::nplist
nmaxevent (int) β see amici::ModelDimensions::nmaxevent
nt (int) β see amici::ModelDimensions::nt
newton_maxsteps (int) β see amici::Solver::newton_maxsteps
pscale (ParameterScalingVector) β see amici::SimulationParameters::pscale
o2mode (int) β see amici::SimulationParameters::o2mode
sensi (SensitivityOrder) β see amici::Solver::sensi
sensi_meth (SensitivityMethod) β see amici::Solver::sensi_meth
rdrm (RDataReporting) β see amici::Solver::rdata_reporting
quadratic_llh (boolean) β whether model defines a quadratic nllh and computing res, sres and FIM makes sense
sigma_res (boolean) β indicates whether additional residuals are to be added for each sigma
sigma_offset (float) β offset to ensure real-valuedness of sigma residuals
Overload 3:
constructor that uses information from model and solver to appropriately initialize fields
- property chi2ο
\(\chi^2\) value
- property cpu_timeο
computation time of forward solve [ms]
Warning
If AMICI was built without boost, this tracks the CPU-time of the current process. Therefore, in a multi-threaded context, this value may be incorrect.
- property cpu_timeBο
computation time of backward solve [ms]
Warning
If AMICI was built without boost, this tracks the CPU-time of the current process. Therefore, in a multi-threaded context, this value may be incorrect.
- property cpu_time_totalο
total CPU time from entering runAmiciSimulation until exiting [ms]
Warning
If AMICI was built without boost, this tracks the CPU-time of the current process. Therefore, in a multi-threaded context, this value may be incorrect.
- property idο
Arbitrary (not necessarily unique) identifier.
- property lbwο
Lower bandwidth of the Jacobian
- property llhο
log-likelihood value
- property messagesο
log messages
- property nJο
Dimension of the augmented objective function for 2nd order ASA
- property ndJydyο
Number of nonzero elements in the \(y\) derivative of \(dJy\) (dimension nytrue)
- property ndtotal_cldx_rdataο
Number of nonzero elements in the \(x_rdata\) derivative of \(total_cl\)
- property ndwdpο
Number of nonzero elements in the p derivative of the repeating elements
- property ndwdwο
Number of nonzero elements in the w derivative of the repeating elements
- property ndwdxο
Number of nonzero elements in the x derivative of the repeating elements
- property ndxdotdwο
Number of nonzero elements in the \(w\) derivative of \(xdot\)
- property ndxrdatadtclο
Number of nonzero elements in the \(tcl\) derivative of \(x_rdata\)
- property ndxrdatadxsolverο
Number of nonzero elements in the \(x\) derivative of \(x_rdata\)
- property neο
Number of events
- property ne_solverο
Number of events that require root-finding
- property newton_maxstepsο
maximal number of newton iterations for steady state calculation
- property nkο
Number of constants
- property nmaxeventο
maximal number of occurring events (for every event type)
- property nnzο
Number of nonzero entries in Jacobian
- property npο
Number of parameters
- property nplistο
number of parameter for which sensitivities were requested
- property nsplο
Number of spline functions in the model
- property ntο
number of considered timepoints
- property numerrtestfailsο
number of error test failures forward problem (shape nt)
- property numerrtestfailsBο
number of error test failures backward problem (shape nt)
- property numnonlinsolvconvfailsο
number of linear solver convergence failures forward problem (shape nt)
- property numnonlinsolvconvfailsBο
number of linear solver convergence failures backward problem (shape nt)
- property numrhsevalsο
number of right hand side evaluations forward problem (shape nt)
- property numrhsevalsBο
number of right hand side evaluations backward problem (shape nt)
- property numstepsο
number of integration steps forward problem (shape nt)
- property numstepsBο
number of integration steps backward problem (shape nt)
- property nwο
Number of common expressions
- property nxο
number of states (alias nx_rdata, kept for backward compatibility)
- property nx_rdataο
Number of states
- property nx_solverο
Number of states with conservation laws applied
- property nx_solver_reinitο
Number of solver states subject to reinitialization
- property nxtrueο
number of states in the unaugmented system (alias nxtrue_rdata, kept for backward compatibility)
- property nxtrue_rdataο
Number of states in the unaugmented system
- property nxtrue_solverο
Number of states in the unaugmented system with conservation laws applied
- property nyο
Number of observables
- property nytrueο
Number of observables in the unaugmented system
- property nzο
Number of event outputs
- property nztrueο
Number of event outputs in the unaugmented system
- property o2modeο
flag indicating whether second-order sensitivities were requested
- property orderο
employed order forward problem (shape nt)
- property posteq_cpu_timeο
computation time of the steady state solver [ms] (postequilibration)
Warning
If AMICI was built without boost, this tracks the CPU-time of the current process. Therefore, in a multi-threaded context, this value may be incorrect.
- property posteq_cpu_timeBο
computation time of the steady state solver of the backward problem [ms] (postequilibration)
Warning
If AMICI was built without boost, this tracks the CPU-time of the current process. Therefore, in a multi-threaded context, this value may be incorrect.
- property posteq_numstepsο
number of Newton steps for steady state problem (preequilibration) [newton, simulation, newton] (shape 3) (postequilibration)
- property posteq_numstepsBο
number of simulation steps for adjoint steady state problem (postequilibration) [== 0 if analytical solution worked, > 0 otherwise]
- property posteq_statusο
flags indicating success of steady state solver (postequilibration)
- property posteq_tο
time when steadystate was reached via simulation (postequilibration)
- property posteq_wrmsο
weighted root-mean-square of the rhs when steadystate was reached (postequilibration)
- property preeq_cpu_timeο
computation time of the steady state solver [ms] (preequilibration)
Warning
If AMICI was built without boost, this tracks the CPU-time of the current process. Therefore, in a multi-threaded context, this value may be incorrect.
- property preeq_cpu_timeBο
computation time of the steady state solver of the backward problem [ms] (preequilibration)
Warning
If AMICI was built without boost, this tracks the CPU-time of the current process. Therefore, in a multi-threaded context, this value may be incorrect.
- property preeq_numstepsο
number of Newton steps for steady state problem (preequilibration) [newton, simulation, newton] (length = 3)
- property preeq_numstepsBο
number of simulation steps for adjoint steady state problem (preequilibration) [== 0 if analytical solution worked, > 0 otherwise]
- property preeq_statusο
flags indicating success of steady state solver (preequilibration)
- property preeq_tο
time when steadystate was reached via simulation (preequilibration)
- property preeq_wrmsο
weighted root-mean-square of the rhs when steadystate was reached (preequilibration)
- property pscaleο
scaling of parameterization
- property rdata_reportingο
reporting mode
- property resο
observable (shape nt*ny, row-major)
- property rzο
event trigger output (shape nmaxevent x nz, row-major)
- property s2llhο
second-order parameter derivative of log-likelihood (shape nJ-1 x nplist, row-major)
- property s2rzο
second-order parameter derivative of event trigger output (shape nmaxevent x nztrue x nplist x nplist, row-major)
- property sensiο
sensitivity order
- property sensi_methο
sensitivity method
- property sigma_resο
boolean indicating whether residuals for standard deviations have been added
- property sigmayο
observable standard deviation (shape nt x ny, row-major)
- property sigmazο
event output sigma standard deviation (shape nmaxevent x nz, row-major)
- property sllhο
parameter derivative of log-likelihood (shape nplist)
- property sresο
parameter derivative of residual (shape nt*ny x nplist, row-major)
- property srzο
parameter derivative of event trigger output (shape nmaxevent x nplist x nz, row-major)
- property ssigmayο
parameter derivative of observable standard deviation (shape nt x nplist x ny, row-major)
- property ssigmazο
parameter derivative of event output standard deviation (shape nmaxevent x nplist x nz, row-major)
- property statusο
Simulation status code.
One of:
AMICI_SUCCESS, indicating successful simulation
AMICI_MAX_TIME_EXCEEDED, indicating that the simulation did not finish within the allowed time (see Solver.{set,get}MaxTime)
AMICI_ERROR, indicating that some error occurred during simulation (a more detailed error message will have been printed).
AMICI_NOT_RUN, if no simulation was started
- property sxο
parameter derivative of state (shape nt x nplist x nx, row-major)
- property sx0ο
initial sensitivities (shape nplist x nx, row-major)
- property sx_ssο
preequilibration sensitivities (shape nplist x nx, row-major)
- property syο
parameter derivative of observable (shape nt x nplist x ny, row-major)
- property szο
parameter derivative of event output (shape nmaxevent x nplist x nz, row-major)
- property t_lastο
The final internal time of the solver.
- property tsο
timepoints (shape nt)
- property ubwο
Upper bandwidth of the Jacobian
- property wο
w data from the model (recurring terms in xdot, for imported SBML models from python, this contains the flux vector) (shape nt x nw, row major)
- property xο
state (shape nt x nx, row-major)
- property x0ο
initial state (shape nx)
- property x_ssο
preequilibration steady state (shape nx)
- property xdotο
time derivative (shape nx) evaluated at t_last.
- property yο
observable (shape nt x ny, row-major)
- property zο
event output (shape nmaxevent x nz, row-major)
- class amici.amici.ReturnDataPtr(*args)[source]ο
Swig-Generated class that implements smart pointers to ReturnData as objects.
- property FIMο
fisher information matrix (shape nplist x nplist, row-major)
- property Jο
Jacobian of differential equation right hand side (shape nx x nx, row-major) evaluated at t_last.
- property chi2ο
\(\chi^2\) value
- property cpu_timeο
computation time of forward solve [ms]
Warning
If AMICI was built without boost, this tracks the CPU-time of the current process. Therefore, in a multi-threaded context, this value may be incorrect.
- property cpu_timeBο
computation time of backward solve [ms]
Warning
If AMICI was built without boost, this tracks the CPU-time of the current process. Therefore, in a multi-threaded context, this value may be incorrect.
- property cpu_time_totalο
total CPU time from entering runAmiciSimulation until exiting [ms]
Warning
If AMICI was built without boost, this tracks the CPU-time of the current process. Therefore, in a multi-threaded context, this value may be incorrect.
- property idο
Arbitrary (not necessarily unique) identifier.
- property lbwο
Lower bandwidth of the Jacobian
- property llhο
log-likelihood value
- property messagesο
log messages
- property nJο
Dimension of the augmented objective function for 2nd order ASA
- property ndJydyο
Number of nonzero elements in the \(y\) derivative of \(dJy\) (dimension nytrue)
- property ndtotal_cldx_rdataο
Number of nonzero elements in the \(x_rdata\) derivative of \(total_cl\)
- property ndwdpο
Number of nonzero elements in the p derivative of the repeating elements
- property ndwdwο
Number of nonzero elements in the w derivative of the repeating elements
- property ndwdxο
Number of nonzero elements in the x derivative of the repeating elements
- property ndxdotdwο
Number of nonzero elements in the \(w\) derivative of \(xdot\)
- property ndxrdatadtclο
Number of nonzero elements in the \(tcl\) derivative of \(x_rdata\)
- property ndxrdatadxsolverο
Number of nonzero elements in the \(x\) derivative of \(x_rdata\)
- property neο
Number of events
- property ne_solverο
Number of events that require root-finding
- property newton_maxstepsο
maximal number of newton iterations for steady state calculation
- property nkο
Number of constants
- property nmaxeventο
maximal number of occurring events (for every event type)
- property nnzο
Number of nonzero entries in Jacobian
- property npο
Number of parameters
- property nplistο
number of parameter for which sensitivities were requested
- property nsplο
Number of spline functions in the model
- property ntο
number of considered timepoints
- property numerrtestfailsο
number of error test failures forward problem (shape nt)
- property numerrtestfailsBο
number of error test failures backward problem (shape nt)
- property numnonlinsolvconvfailsο
number of linear solver convergence failures forward problem (shape nt)
- property numnonlinsolvconvfailsBο
number of linear solver convergence failures backward problem (shape nt)
- property numrhsevalsο
number of right hand side evaluations forward problem (shape nt)
- property numrhsevalsBο
number of right hand side evaluations backward problem (shape nt)
- property numstepsο
number of integration steps forward problem (shape nt)
- property numstepsBο
number of integration steps backward problem (shape nt)
- property nwο
Number of common expressions
- property nxο
number of states (alias nx_rdata, kept for backward compatibility)
- property nx_rdataο
Number of states
- property nx_solverο
Number of states with conservation laws applied
- property nx_solver_reinitο
Number of solver states subject to reinitialization
- property nxtrueο
number of states in the unaugmented system (alias nxtrue_rdata, kept for backward compatibility)
- property nxtrue_rdataο
Number of states in the unaugmented system
- property nxtrue_solverο
Number of states in the unaugmented system with conservation laws applied
- property nyο
Number of observables
- property nytrueο
Number of observables in the unaugmented system
- property nzο
Number of event outputs
- property nztrueο
Number of event outputs in the unaugmented system
- property o2modeο
flag indicating whether second-order sensitivities were requested
- property orderο
employed order forward problem (shape nt)
- property posteq_cpu_timeο
computation time of the steady state solver [ms] (postequilibration)
Warning
If AMICI was built without boost, this tracks the CPU-time of the current process. Therefore, in a multi-threaded context, this value may be incorrect.
- property posteq_cpu_timeBο
computation time of the steady state solver of the backward problem [ms] (postequilibration)
Warning
If AMICI was built without boost, this tracks the CPU-time of the current process. Therefore, in a multi-threaded context, this value may be incorrect.
- property posteq_numstepsο
number of Newton steps for steady state problem (preequilibration) [newton, simulation, newton] (shape 3) (postequilibration)
- property posteq_numstepsBο
number of simulation steps for adjoint steady state problem (postequilibration) [== 0 if analytical solution worked, > 0 otherwise]
- property posteq_statusο
flags indicating success of steady state solver (postequilibration)
- property posteq_tο
time when steadystate was reached via simulation (postequilibration)
- property posteq_wrmsο
weighted root-mean-square of the rhs when steadystate was reached (postequilibration)
- property preeq_cpu_timeο
computation time of the steady state solver [ms] (preequilibration)
Warning
If AMICI was built without boost, this tracks the CPU-time of the current process. Therefore, in a multi-threaded context, this value may be incorrect.
- property preeq_cpu_timeBο
computation time of the steady state solver of the backward problem [ms] (preequilibration)
Warning
If AMICI was built without boost, this tracks the CPU-time of the current process. Therefore, in a multi-threaded context, this value may be incorrect.
- property preeq_numstepsο
number of Newton steps for steady state problem (preequilibration) [newton, simulation, newton] (length = 3)
- property preeq_numstepsBο
number of simulation steps for adjoint steady state problem (preequilibration) [== 0 if analytical solution worked, > 0 otherwise]
- property preeq_statusο
flags indicating success of steady state solver (preequilibration)
- property preeq_tο
time when steadystate was reached via simulation (preequilibration)
- property preeq_wrmsο
weighted root-mean-square of the rhs when steadystate was reached (preequilibration)
- property pscaleο
scaling of parameterization
- property rdata_reportingο
reporting mode
- property resο
observable (shape nt*ny, row-major)
- property rzο
event trigger output (shape nmaxevent x nz, row-major)
- property s2llhο
second-order parameter derivative of log-likelihood (shape nJ-1 x nplist, row-major)
- property s2rzο
second-order parameter derivative of event trigger output (shape nmaxevent x nztrue x nplist x nplist, row-major)
- property sensiο
sensitivity order
- property sensi_methο
sensitivity method
- property sigma_resο
boolean indicating whether residuals for standard deviations have been added
- property sigmayο
observable standard deviation (shape nt x ny, row-major)
- property sigmazο
event output sigma standard deviation (shape nmaxevent x nz, row-major)
- property sllhο
parameter derivative of log-likelihood (shape nplist)
- property sresο
parameter derivative of residual (shape nt*ny x nplist, row-major)
- property srzο
parameter derivative of event trigger output (shape nmaxevent x nplist x nz, row-major)
- property ssigmayο
parameter derivative of observable standard deviation (shape nt x nplist x ny, row-major)
- property ssigmazο
parameter derivative of event output standard deviation (shape nmaxevent x nplist x nz, row-major)
- property statusο
Simulation status code.
One of:
AMICI_SUCCESS, indicating successful simulation
AMICI_MAX_TIME_EXCEEDED, indicating that the simulation did not finish within the allowed time (see Solver.{set,get}MaxTime)
AMICI_ERROR, indicating that some error occurred during simulation (a more detailed error message will have been printed).
AMICI_NOT_RUN, if no simulation was started
- property sxο
parameter derivative of state (shape nt x nplist x nx, row-major)
- property sx0ο
initial sensitivities (shape nplist x nx, row-major)
- property sx_ssο
preequilibration sensitivities (shape nplist x nx, row-major)
- property syο
parameter derivative of observable (shape nt x nplist x ny, row-major)
- property szο
parameter derivative of event output (shape nmaxevent x nplist x nz, row-major)
- property t_lastο
The final internal time of the solver.
- property tsο
timepoints (shape nt)
- property ubwο
Upper bandwidth of the Jacobian
- property wο
w data from the model (recurring terms in xdot, for imported SBML models from python, this contains the flux vector) (shape nt x nw, row major)
- property xο
state (shape nt x nx, row-major)
- property x0ο
initial state (shape nx)
- property x_ssο
preequilibration steady state (shape nx)
- property xdotο
time derivative (shape nx) evaluated at t_last.
- property yο
observable (shape nt x ny, row-major)
- property zο
event output (shape nmaxevent x nz, row-major)
- class amici.amici.SecondOrderMode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)ο
- __init__(*args, **kwds)ο
- directional = 2ο
- full = 1ο
- none = 0ο
- class amici.amici.SensitivityMethod(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)ο
- __init__(*args, **kwds)ο
- adjoint = 2ο
- forward = 1ο
- none = 0ο
- amici.amici.SensitivityMethod_adjoint = 2ο
Adjoint sensitivity analysis.
- amici.amici.SensitivityMethod_forward = 1ο
Forward sensitivity analysis.
- amici.amici.SensitivityMethod_none = 0ο
Donβt compute sensitivities.
- class amici.amici.SensitivityOrder(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)ο
- __init__(*args, **kwds)ο
- first = 1ο
- none = 0ο
- second = 2ο
- amici.amici.SensitivityOrder_first = 1ο
First-order sensitivities.
- amici.amici.SensitivityOrder_none = 0ο
Donβt compute sensitivities.
- amici.amici.SensitivityOrder_second = 2ο
Second-order sensitivities.
- class amici.amici.SimulationParameters(*args)[source]ο
Container for various simulation parameters.
- __init__(*args)[source]ο
Overload 1:
Constructor
- Parameters:
timepoints (DoubleVector) β Timepoints for which simulation results are requested
Overload 2:
Constructor
- Parameters:
fixedParameters (DoubleVector) β Model constants
parameters (DoubleVector) β Model parameters
- property fixedParametersο
Model constants
Vector of size Model::nk() or empty
- property fixedParametersPreequilibrationο
Model constants for pre-equilibration
Vector of size Model::nk() or empty.
- property fixedParametersPresimulationο
Model constants for pre-simulation
Vector of size Model::nk() or empty.
- property parametersο
Model parameters
Vector of size Model::np() or empty with parameter scaled according to SimulationParameter::pscale.
- property plistο
Parameter indices w.r.t. which to compute sensitivities
- property pscaleο
Parameter scales
Vector of parameter scale of size Model::np(), indicating how/if each parameter is to be scaled.
- property reinitialization_state_idxs_presimο
Indices of states to be reinitialized based on provided presimulation constants / fixed parameters.
- property reinitialization_state_idxs_simο
Indices of states to be reinitialized based on provided constants / fixed parameters.
- reinitializeAllFixedParameterDependentInitialStates(nx_rdata: int)[source]ο
Set reinitialization of all states based on model constants for all simulation phases.
Convenience function to populate reinitialization_state_idxs_presim and reinitialization_state_idxs_sim
- Parameters:
nx_rdata (
int
) β Number of states (Model::nx_rdata)
- reinitializeAllFixedParameterDependentInitialStatesForPresimulation(nx_rdata: int)[source]ο
Set reinitialization of all states based on model constants for presimulation (only meaningful if preequilibration is performed).
Convenience function to populate reinitialization_state_idxs_presim and reinitialization_state_idxs_sim
- Parameters:
nx_rdata (
int
) β Number of states (Model::nx_rdata)
- reinitializeAllFixedParameterDependentInitialStatesForSimulation(nx_rdata: int)[source]ο
Set reinitialization of all states based on model constants for the βmainβ simulation (only meaningful if presimulation or preequilibration is performed).
Convenience function to populate reinitialization_state_idxs_presim and reinitialization_state_idxs_sim
- Parameters:
nx_rdata (
int
) β Number of states (Model::nx_rdata)
- property reinitializeFixedParameterInitialStatesο
Flag indicating whether reinitialization of states depending on fixed parameters is activated
- property sx0ο
Initial state sensitivities
Dimensions: Model::nx() * Model::nplist(), Model::nx() * ExpData::plist.size(), if ExpData::plist is not empty, or empty
- property t_presimο
Duration of pre-simulation.
If this is > 0, presimulation will be performed from (model->t0 - t_presim) to model->t0 using the fixedParameters in fixedParametersPresimulation
- property ts_ο
Timepoints for which model state/outputs/β¦ are requested
Vector of timepoints.
- property tstart_ο
Starting time of the simulation.
Output timepoints are absolute timepoints, independent of \(t_{start}\). For output timepoints \(t < t_{start}\), the initial state will be returned.
- property x0ο
Initial state
Vector of size Model::nx() or empty
- class amici.amici.Solver(*args, **kwargs)[source]ο
The Solver class provides a generic interface to CVODES and IDAS solvers, individual realizations are realized in the CVodeSolver and the IDASolver class. All transient private/protected members (CVODES/IDAS memory, interface variables and status flags) are specified as mutable and not included in serialization or equality checks. No solver setting parameter should be marked mutable.
NOTE: Any changes in data members here must be propagated to copy ctor, equality operator, serialization functions in serialization.h, and amici::hdf5::(read/write)SolverSettings(From/To)HDF5 in hdf5.cpp.
- getAbsoluteTolerance() float [source]ο
Get the absolute tolerances for the forward problem
Same tolerance is used for the backward problem if not specified differently via setAbsoluteToleranceASA.
- Return type:
- Returns:
absolute tolerances
- getAbsoluteToleranceB() float [source]ο
Returns the absolute tolerances for the backward problem for adjoint sensitivity analysis
- Return type:
- Returns:
absolute tolerances
- getAbsoluteToleranceFSA() float [source]ο
Returns the absolute tolerances for the forward sensitivity problem
- Return type:
- Returns:
absolute tolerances
- getAbsoluteToleranceQuadratures() float [source]ο
returns the absolute tolerance for the quadrature problem
- Return type:
- Returns:
absolute tolerance
- getAbsoluteToleranceSteadyState() float [source]ο
returns the absolute tolerance for the steady state problem
- Return type:
- Returns:
absolute tolerance
- getAbsoluteToleranceSteadyStateSensi() float [source]ο
returns the absolute tolerance for the sensitivities of the steady state problem
- Return type:
- Returns:
absolute tolerance
- getConstraints() Sequence[float] [source]ο
Get constraints on the model state.
- Return type:
- Returns:
constraints
- getInternalSensitivityMethod() InternalSensitivityMethod [source]ο
returns the internal sensitivity method
- Return type:
- Returns:
internal sensitivity method
- getInterpolationType() InterpolationType [source]ο
- Return type:
- Returns:
- getLinearMultistepMethod() LinearMultistepMethod [source]ο
returns the linear system multistep method
- Return type:
- Returns:
linear system multistep method
- getLinearSolver() LinearSolver [source]ο
- Return type:
- Returns:
- getMaxConvFails() int [source]ο
Get the maximum number of nonlinear solver convergence failures permitted per step.
- Return type:
- Returns:
maximum number of nonlinear solver convergence
- getMaxNonlinIters() int [source]ο
Get the maximum number of nonlinear solver iterations permitted per step.
- Return type:
- Returns:
maximum number of nonlinear solver iterations
- getMaxStepSize() float [source]ο
Get the maximum step size
- Return type:
- Returns:
maximum step size
- getMaxSteps() int [source]ο
returns the maximum number of solver steps for the forward problem
- Return type:
- Returns:
maximum number of solver steps
- getMaxStepsBackwardProblem() int [source]ο
returns the maximum number of solver steps for the backward problem
- Return type:
- Returns:
maximum number of solver steps
- getMaxTime() float [source]ο
Returns the maximum time allowed for integration
- Return type:
- Returns:
Time in seconds
- getNewtonDampingFactorLowerBound() float [source]ο
Get a lower bound of the damping factor used in the Newton solver
- Return type:
- Returns:
- getNewtonDampingFactorMode() NewtonDampingFactorMode [source]ο
Get a state of the damping factor used in the Newton solver
- Return type:
- Returns:
- getNewtonMaxSteps() int [source]ο
Get maximum number of allowed Newton steps for steady state computation
- Return type:
- Returns:
- getNewtonStepSteadyStateCheck() bool [source]ο
Returns how convergence checks for steadystate computation are performed. If activated, convergence checks are limited to every 25 steps in the simulation solver to limit performance impact.
- Return type:
- Returns:
boolean flag indicating newton step (true) or the right hand side (false)
- getNonlinearSolverIteration() NonlinearSolverIteration [source]ο
returns the nonlinear system solution method
- Return type:
- Returns:
- getRelativeTolerance() float [source]ο
Get the relative tolerances for the forward problem
Same tolerance is used for the backward problem if not specified differently via setRelativeToleranceASA.
- Return type:
- Returns:
relative tolerances
- getRelativeToleranceB() float [source]ο
Returns the relative tolerances for the adjoint sensitivity problem
- Return type:
- Returns:
relative tolerances
- getRelativeToleranceFSA() float [source]ο
Returns the relative tolerances for the forward sensitivity problem
- Return type:
- Returns:
relative tolerances
- getRelativeToleranceQuadratures() float [source]ο
Returns the relative tolerance for the quadrature problem
- Return type:
- Returns:
relative tolerance
- getRelativeToleranceSteadyState() float [source]ο
returns the relative tolerance for the steady state problem
- Return type:
- Returns:
relative tolerance
- getRelativeToleranceSteadyStateSensi() float [source]ο
returns the relative tolerance for the sensitivities of the steady state problem
- Return type:
- Returns:
relative tolerance
- getReturnDataReportingMode() RDataReporting [source]ο
returns the ReturnData reporting mode
- Return type:
- Returns:
ReturnData reporting mode
- getSensiSteadyStateCheck() bool [source]ο
Returns how convergence checks for steadystate computation are performed.
- Return type:
- Returns:
boolean flag indicating state and sensitivity equations (true) or only state variables (false).
- getSensitivityMethod() SensitivityMethod [source]ο
Return current sensitivity method
- Return type:
- Returns:
method enum
- getSensitivityMethodPreequilibration() SensitivityMethod [source]ο
Return current sensitivity method during preequilibration
- Return type:
- Returns:
method enum
- getSensitivityOrder() SensitivityOrder [source]ο
Get sensitivity order
- Return type:
- Returns:
sensitivity order
- getStabilityLimitFlag() bool [source]ο
returns stability limit detection mode
- Return type:
- Returns:
stldet can be false (deactivated) or true (activated)
- getStateOrdering() int [source]ο
Gets KLU / SuperLUMT state ordering mode
- Return type:
- Returns:
State-ordering as integer according to SUNLinSolKLU::StateOrdering or SUNLinSolSuperLUMT::StateOrdering (which differ).
- getSteadyStateSensiToleranceFactor() float [source]ο
returns the steady state sensitivity simulation tolerance factor.
Steady state sensitivity simulation tolerances are the product of the sensitivity simulation tolerances and this factor, unless manually set with set(Absolute/Relative)ToleranceSteadyStateSensi().
- Return type:
- Returns:
steady state simulation tolerance factor
- getSteadyStateToleranceFactor() float [source]ο
returns the steady state simulation tolerance factor.
Steady state simulation tolerances are the product of the simulation tolerances and this factor, unless manually set with set(Absolute/Relative)ToleranceSteadyState().
- Return type:
- Returns:
steady state simulation tolerance factor
- property loggerο
- nplist() int [source]ο
number of parameters with which the solver was initialized
- Return type:
- Returns:
sx.getLength()
- nquad() int [source]ο
number of quadratures with which the solver was initialized
- Return type:
- Returns:
xQB.getLength()
- nx() int [source]ο
number of states with which the solver was initialized
- Return type:
- Returns:
x.getLength()
- setAbsoluteTolerance(atol: float)[source]ο
Sets the absolute tolerances for the forward problem
Same tolerance is used for the backward problem if not specified differently via setAbsoluteToleranceASA.
- Parameters:
atol (
float
) β absolute tolerance (non-negative number)
- setAbsoluteToleranceB(atol: float)[source]ο
Sets the absolute tolerances for the backward problem for adjoint sensitivity analysis
- Parameters:
atol (
float
) β absolute tolerance (non-negative number)
- setAbsoluteToleranceFSA(atol: float)[source]ο
Sets the absolute tolerances for the forward sensitivity problem
- Parameters:
atol (
float
) β absolute tolerance (non-negative number)
- setAbsoluteToleranceQuadratures(atol: float)[source]ο
sets the absolute tolerance for the quadrature problem
- Parameters:
atol (
float
) β absolute tolerance (non-negative number)
- setAbsoluteToleranceSteadyState(atol: float)[source]ο
sets the absolute tolerance for the steady state problem
- Parameters:
atol (
float
) β absolute tolerance (non-negative number)
- setAbsoluteToleranceSteadyStateSensi(atol: float)[source]ο
sets the absolute tolerance for the sensitivities of the steady state problem
- Parameters:
atol (
float
) β absolute tolerance (non-negative number)
- setConstraints(constraints: Sequence[float])[source]ο
Set constraints on the model state.
See https://sundials.readthedocs.io/en/latest/cvode/Usage/index.html#c.CVodeSetConstraints.
- Parameters:
constraints (
typing.Sequence
[float
])
- setInternalSensitivityMethod(ism: InternalSensitivityMethod)[source]ο
sets the internal sensitivity method
- Parameters:
ism (
amici.amici.InternalSensitivityMethod
) β internal sensitivity method
- setInterpolationType(interpType: InterpolationType)[source]ο
sets the interpolation of the forward solution that is used for the backwards problem
- Parameters:
interpType (
amici.amici.InterpolationType
) β interpolation type
- setLinearMultistepMethod(lmm: LinearMultistepMethod)[source]ο
sets the linear system multistep method
- Parameters:
lmm (
amici.amici.LinearMultistepMethod
) β linear system multistep method
- setLinearSolver(linsol: LinearSolver)[source]ο
- Parameters:
linsol (
amici.amici.LinearSolver
)
- setMaxConvFails(max_conv_fails: int)[source]ο
Set the maximum number of nonlinear solver convergence failures permitted per step.
- Parameters:
max_conv_fails (
int
) β maximum number of nonlinear solver convergence
- setMaxNonlinIters(max_nonlin_iters: int)[source]ο
Set the maximum number of nonlinear solver iterations permitted per step.
- Parameters:
max_nonlin_iters (
int
) β maximum number of nonlinear solver iterations
- setMaxStepSize(max_step_size: float)[source]ο
Set the maximum step size
- Parameters:
max_step_size (
float
) β maximum step size. 0.0 means no limit.
- setMaxSteps(maxsteps: int)[source]ο
sets the maximum number of solver steps for the forward problem
- Parameters:
maxsteps (
int
) β maximum number of solver steps (positive number)
- setMaxStepsBackwardProblem(maxsteps: int)[source]ο
sets the maximum number of solver steps for the backward problem
- Parameters:
maxsteps (
int
) β maximum number of solver steps (non-negative number)
Notes: default behaviour (100 times the value for the forward problem) can be restored by passing maxsteps=0
- setMaxTime(maxtime: float)[source]ο
Set the maximum CPU time allowed for integration
- Parameters:
maxtime (
float
) β Time in seconds. Zero means infinite time.
- setNewtonDampingFactorLowerBound(dampingFactorLowerBound: float)[source]ο
Set a lower bound of the damping factor in the Newton solver
- Parameters:
dampingFactorLowerBound (
float
)
- setNewtonDampingFactorMode(dampingFactorMode: NewtonDampingFactorMode)[source]ο
Turn on/off a damping factor in the Newton method
- Parameters:
dampingFactorMode (
amici.amici.NewtonDampingFactorMode
)
- setNewtonMaxSteps(newton_maxsteps: int)[source]ο
Set maximum number of allowed Newton steps for steady state computation
- Parameters:
newton_maxsteps (
int
)
- setNewtonStepSteadyStateCheck(flag: bool)[source]ο
Sets how convergence checks for steadystate computation are performed.
- Parameters:
flag (
bool
) β boolean flag to pick newton step (true) or the right hand side (false, default)
- setNonlinearSolverIteration(iter: NonlinearSolverIteration)[source]ο
sets the nonlinear system solution method
- Parameters:
iter (
amici.amici.NonlinearSolverIteration
) β nonlinear system solution method
- setRelativeTolerance(rtol: float)[source]ο
Sets the relative tolerances for the forward problem
Same tolerance is used for the backward problem if not specified differently via setRelativeToleranceASA.
- Parameters:
rtol (
float
) β relative tolerance (non-negative number)
- setRelativeToleranceB(rtol: float)[source]ο
Sets the relative tolerances for the adjoint sensitivity problem
- Parameters:
rtol (
float
) β relative tolerance (non-negative number)
- setRelativeToleranceFSA(rtol: float)[source]ο
Sets the relative tolerances for the forward sensitivity problem
- Parameters:
rtol (
float
) β relative tolerance (non-negative number)
- setRelativeToleranceQuadratures(rtol: float)[source]ο
sets the relative tolerance for the quadrature problem
- Parameters:
rtol (
float
) β relative tolerance (non-negative number)
- setRelativeToleranceSteadyState(rtol: float)[source]ο
sets the relative tolerance for the steady state problem
- Parameters:
rtol (
float
) β relative tolerance (non-negative number)
- setRelativeToleranceSteadyStateSensi(rtol: float)[source]ο
sets the relative tolerance for the sensitivities of the steady state problem
- Parameters:
rtol (
float
) β relative tolerance (non-negative number)
- setReturnDataReportingMode(rdrm: RDataReporting)[source]ο
sets the ReturnData reporting mode
- Parameters:
rdrm (
amici.amici.RDataReporting
) β ReturnData reporting mode
- setSensiSteadyStateCheck(flag: bool)[source]ο
Sets for which variables convergence checks for steadystate computation are performed.
- Parameters:
flag (
bool
) β boolean flag to pick state and sensitivity equations (true, default) or only state variables (false).
- setSensitivityMethod(sensi_meth: SensitivityMethod)[source]ο
Set sensitivity method
- Parameters:
sensi_meth (
amici.amici.SensitivityMethod
)
- setSensitivityMethodPreequilibration(sensi_meth_preeq: SensitivityMethod)[source]ο
Set sensitivity method for preequilibration
- Parameters:
sensi_meth_preeq (
amici.amici.SensitivityMethod
)
- setSensitivityOrder(sensi: SensitivityOrder)[source]ο
Set the sensitivity order
- Parameters:
sensi (
amici.amici.SensitivityOrder
) β sensitivity order
- setStabilityLimitFlag(stldet: bool)[source]ο
set stability limit detection mode
- Parameters:
stldet (
bool
) β can be false (deactivated) or true (activated)
- setStateOrdering(ordering: int)[source]ο
Sets KLU / SuperLUMT state ordering mode
This only applies when linsol is set to LinearSolver::KLU or LinearSolver::SuperLUMT. Mind the difference between SUNLinSolKLU::StateOrdering and SUNLinSolSuperLUMT::StateOrdering.
- Parameters:
ordering (
int
) β state ordering
- setSteadyStateSensiToleranceFactor(factor: float)[source]ο
set the steady state sensitivity simulation tolerance factor.
Steady state sensitivity simulation tolerances are the product of the sensitivity simulation tolerances and this factor, unless manually set with set(Absolute/Relative)ToleranceSteadyStateSensi().
- Parameters:
factor (
float
) β tolerance factor (non-negative number)
- setSteadyStateToleranceFactor(factor: float)[source]ο
set the steady state simulation tolerance factor.
Steady state simulation tolerances are the product of the simulation tolerances and this factor, unless manually set with set(Absolute/Relative)ToleranceSteadyState().
- Parameters:
factor (
float
) β tolerance factor (non-negative number)
- class amici.amici.SolverPtr(*args)[source]ο
Swig-Generated class that implements smart pointers to Solver as objects.
- property loggerο
- class amici.amici.SteadyStateComputationMode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)ο
- __init__(*args, **kwds)ο
- integrateIfNewtonFails = 2ο
- integrationOnly = 1ο
- newtonOnly = 0ο
- class amici.amici.SteadyStateSensitivityMode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)ο
- __init__(*args, **kwds)ο
- integrateIfNewtonFails = 2ο
- integrationOnly = 1ο
- newtonOnly = 0ο
- class amici.amici.SteadyStateStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)ο
- __init__(*args, **kwds)ο
- failed = -1ο
- failed_convergence = -2ο
- failed_damping = -4ο
- failed_factorization = -3ο
- failed_too_long_simulation = -5ο
- not_run = 0ο
- success = 1ο
- class amici.amici.StringDoubleMap(*args)[source]ο
Swig-Generated class templating
Dict
[str
,float
] to facilitate interfacing with C++ bindings.
- class amici.amici.StringVector(*args)[source]ο
Swig-Generated class templating common python types including
Iterable
[str
] andnumpy.array
[str
] to facilitate interfacing with C++ bindings.
- amici.amici.compiledWithOpenMP() bool [source]ο
AMICI extension was compiled with OpenMP?
- Return type:
- amici.amici.getScaledParameter(unscaledParameter: float, scaling: int) float [source]ο
Apply parameter scaling according to scaling
- amici.amici.getUnscaledParameter(scaledParameter: float, scaling: int) float [source]ο
Remove parameter scaling according to scaling
- amici.amici.parameterScalingFromIntVector(intVec: Sequence[int]) tuple[ParameterScaling] [source]ο
Swig-Generated class, which, in contrast to other Vector classes, does not allow for simple interoperability with common Python types, but must be created using
amici.amici.parameterScalingFromIntVector()
- Return type:
- amici.amici.runAmiciSimulation(solver: Solver, edata: ExpData, model: Model, rethrow: bool = False) ReturnData [source]ο
Core integration routine. Initializes the solver and runs the forward and backward problem.
- Parameters:
solver (
amici.amici.Solver
) β Solver instanceedata (
amici.amici.ExpData
) β pointer to experimental data objectmodel (
amici.amici.Model
) β model specification objectrethrow (
bool
) β rethrow integration exceptions?
- Return type:
- Returns:
rdata pointer to return data object
- amici.amici.runAmiciSimulations(solver: Solver, edatas: ExpDataPtrVector, model: Model, failfast: bool, num_threads: int) Iterable[ReturnData] [source]ο
Same as runAmiciSimulation, but for multiple ExpData instances. When compiled with OpenMP support, this function runs multi-threaded.
- Parameters:
solver (
amici.amici.Solver
) β Solver instanceedatas (
amici.amici.ExpDataPtrVector
) β experimental data objectsmodel (
amici.amici.Model
) β model specification objectfailfast (
bool
) β flag to allow early terminationnum_threads (
int
) β number of threads for parallel execution
- Return type:
- Returns:
vector of pointers to return data objects