amici.amici.Model¶
-
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] Initialize self. See help(type(self)) for accurate signature.
Methods Summary
__init__
(*args, **kwargs)Initialize self.
checkFinite
(array, fun)Check if the given array has only finite elements.
clone
()Clone this instance.
fJrz
(nllh, iz, p, k, z, sigmaz)Model specific implementation of fJrz
fJy
(nllh, iy, p, k, y, sigmay, my)Model specific implementation of fJy
fJz
(nllh, iz, p, k, z, sigmaz, mz)Model specific implementation of fJz
fdJrzdsigma
(dJrzdsigma, iz, p, k, rz, sigmaz)Model specific implementation of fdJrzdsigma
fdJrzdz
(dJrzdz, iz, p, k, rz, sigmaz)Model specific implementation of fdJrzdz
fdJydsigma
(dJydsigma, iy, p, k, y, sigmay, my)Model specific implementation of fdJydsigma
fdJzdsigma
(dJzdsigma, iz, p, k, z, sigmaz, mz)Model specific implementation of fdJzdsigma
fdJzdz
(dJzdz, iz, p, k, z, sigmaz, mz)Model specific implementation of fdJzdz
fdeltaqB
(deltaqB, t, x, p, k, h, ip, ie, …)Model specific implementation of fdeltaqB
fdeltasx
(deltasx, t, x, p, k, h, w, ip, ie, …)Model specific implementation of fdeltasx
fdeltax
(deltax, t, x, p, k, h, ie, xdot, …)Model specific implementation of fdeltax
fdeltaxB
(deltaxB, t, x, p, k, h, ie, xdot, …)Model specific implementation of fdeltaxB
fdrzdp
(drzdp, ie, t, x, p, k, h, ip)Model specific implementation of fdrzdp
fdrzdx
(drzdx, ie, t, x, p, k, h)Model specific implementation of fdrzdx
fdsigmaydp
(dsigmaydp, t, p, k, ip)Model specific implementation of fsigmay
fdsigmazdp
(dsigmazdp, t, p, k, ip)Model specific implementation of fsigmaz
fdydp
(dydp, t, x, p, k, h, ip, w, dwdp)Model specific implementation of fdydp
fdydx
(dydx, t, x, p, k, h, w, dwdx)Model specific implementation of fdydx
fdzdp
(dzdp, ie, t, x, p, k, h, ip)Model specific implementation of fdzdp
fdzdx
(dzdx, ie, t, x, p, k, h)Model specific implementation of fdzdx
frz
(rz, ie, t, x, p, k, h)Model specific implementation of frz
fsdx0
()Compute sensitivity of derivative initial states sensitivities sdx0.
fsigmay
(sigmay, t, p, k)Model specific implementation of fsigmay
fsigmaz
(sigmaz, t, p, k)Model specific implementation of fsigmaz
fsrz
(srz, ie, t, x, p, k, h, sx, ip)Model specific implementation of fsrz
fstau
(stau, t, x, p, k, h, sx, ip, ie)Model specific implementation of fstau
fsx0
(sx0, t, x0, p, k, ip)Model specific implementation of fsx0
fsx0_fixedParameters
(sx0, t, x0, p, k, ip)Model specific implementation of fsx0_fixedParameters
fsz
(sz, ie, t, x, p, k, h, sx, ip)Model specific implementation of fsz
fw
(w, t, x, p, k, h, tcl)Model specific implementation of fw
fx0
(x0, t, p, k)Model specific implementation of fx0
fx0_fixedParameters
(x0, t, p, k)Model specific implementation of fx0_fixedParameters
fy
(y, t, x, p, k, h, w)Model specific implementation of fy
fz
(z, ie, t, x, p, k, h)Model specific implementation of fz
Get setting of whether the result of every call to Model::f* should be checked for finiteness.
Returns the amici commit that was used to generate the model
Returns the amici version that was used to generate the model
getEventSigma
(sigmaz, ie, nroots, t, edata)Get event-resolved observable standard deviations.
getEventSigmaSensitivity
(ssigmaz, ie, …)Get sensitivities of event-resolved observable standard deviations.
Get IDs of the expression.
Get names of the expressions.
getFixedParameterById
(par_id)Get value of fixed parameter with the specified ID.
getFixedParameterByName
(par_name)Get value of fixed parameter with the specified name.
Get IDs of the fixed model parameters.
Get names of the fixed model parameters.
Get values of fixed parameters.
Get the initial states sensitivities.
Get the initial states.
getName
()Get the model name.
Get IDs of the observables.
Get names of the observables.
getObservableSigma
(sigmay, it, edata)Get time-resolved observable standard deviations
getObservableSigmaSensitivity
(ssigmay, it, edata)Sensitivity of time-resolved observable standard deviation.
getParameterById
(par_id)Get value of first model parameter with the specified ID.
getParameterByName
(par_name)Get value of first model parameter with the specified name.
Get IDs of the model parameters.
Get the list of parameters for which sensitivities are computed.
Get names of the model parameters.
Get parameter scale for each parameter.
Get parameter vector.
Get whether initial states depending on fixedParameters are to be reinitialized after preequilibration and presimulation.
Retrieves the solver object
Get IDs of the model states.
Get flags indicating whether states should be treated as non-negative.
Get names of the model states.
Gets the mode how sensitivities are computed in the steadystate simulation.
getTimepoint
(it)Get simulation timepoint for time index it.
Get the timepoint vector.
getUnobservedEventSensitivity
(sz, ie)Get sensitivity of z at final timepoint.
Get parameters with transformation according to parameter scale applied.
Return whether custom initial state sensitivities have been set.
Return whether custom initial states have been set.
Report whether the model has expression IDs set.
Report whether the model has expression names set.
Report whether the model has fixed parameter IDs set.
Report whether the model has fixed parameter names set.
Report whether the model has observable IDs set.
Report whether the model has observable names set.
Report whether the model has parameter IDs set.
Report whether the model has parameter names set.
Checks whether the defined noise model is gaussian, i.e., the nllh is quadratic
Report whether the model has state IDs set.
Report whether the model has state names set.
Function indicating whether reinitialization of states depending on fixed parameters is permissible
k
()Get fixed parameters.
Get maximum number of events that may occur for each type.
ncl
()Get number of conservation laws.
nk
()Get number of constants
np
()Get total number of model parameters.
nplist
()Get number of parameters wrt to which sensitivities are computed.
nt
()Get number of timepoints.
Get number of solver states subject to reinitialization.
plist
(pos)Get entry in parameter list by index.
Require computation of sensitivities for all parameters p [0..np[ in natural order.
Set flags indicating that all states should be treated as non-negative.
setAlwaysCheckFinite
(alwaysCheck)Set whether the result of every call to Model::f* should be checked for finiteness.
setFixedParameterById
(par_id, value)Set value of first fixed parameter with the specified ID.
setFixedParameterByName
(par_name, value)Set value of first fixed parameter with the specified name.
Set values for constants.
setFixedParametersByIdRegex
(par_id_regex, value)Set values of all fixed parameters with the ID matching the specified regex.
Set value of all fixed parameters with name matching the specified regex.
Set the initial state sensitivities.
setInitialStates
(x0)Set the initial states.
setNMaxEvent
(nmaxevent)Set maximum number of events that may occur for each type.
setParameterById
(*args)Overload 1:
setParameterByName
(*args)Overload 1:
setParameterList
(plist)Set the list of parameters for which sensitivities are to be computed.
setParameterScale
(*args)Overload 1:
Set the parameter vector.
setParametersByIdRegex
(par_id_regex, value)Set all values of model parameters with IDs matching the specified regular expression.
setParametersByNameRegex
(par_name_regex, value)Set all values of all model parameters with names matching the specified regex.
Set whether initial states depending on fixed parameters are to be reinitialized after preequilibration and presimulation.
setStateIsNonNegative
(stateIsNonNegative)Set flags indicating whether states should be treated as non-negative.
Set the mode how sensitivities are computed in the steadystate simulation.
setT0
(t0)Set simulation start time.
setTimepoints
(ts)Set the timepoint vector.
Set the initial state sensitivities.
t0
()Get simulation start time.
updateHeaviside
(rootsfound)Update the Heaviside variables h on event occurrences.
updateHeavisideB
(rootsfound)Updates the Heaviside variables h on event occurrences in the backward problem.
Attributes
app
AMICI application context
idlist
Flag array for DAE equations
lbw
Lower bandwidth of the Jacobian
nJ
Dimension of the augmented objective function for 2nd order ASA
ne
Number of events
nnz
Number of nonzero entries in Jacobian
nw
Number of common expressions
nx_rdata
Number of states
nx_solver
Number of states with conservation laws applied
nx_solver_reinit
Number of solver states subject to reinitialization
nxtrue_rdata
Number of states in the unaugmented system
nxtrue_solver
Number of states in the unaugmented system with conservation laws applied
ny
Number of observables
nytrue
Number of observables in the unaugmented system
nz
Number of event outputs
nztrue
Number of event outputs in the unaugmented system
o2mode
Flag indicating whether for amici::Solver::sensi_ == amici::SensitivityOrder::second directional or full second order derivative will be computed
pythonGenerated
Flag indicating Matlab- or Python-based model generation
ubw
Upper bandwidth of the Jacobian
Methods
-
checkFinite
(array: Iterable[float], fun: str) → int[source]¶ Check if the given array has only finite elements.
If not, try to give hints by which other fields this could be caused.
- Parameters
array (
typing.Iterable
[float
]) – Array to checkfun (
str
) – Name of the function that generated the values (for more informative messages).
- Return type
- Returns
amici::AMICI_RECOVERABLE_ERROR if a NaN/Inf value was found, amici::AMICI_SUCCESS otherwise
-
clone
() → Iterable[amici.amici.Model][source]¶ Clone this instance.
- Return type
- Returns
The clone
-
fJrz
(nllh: Iterable[float], iz: int, p: Iterable[float], k: Iterable[float], z: Iterable[float], sigmaz: Iterable[float]) → None[source]¶ Model specific implementation of fJrz
- Parameters
nllh (
typing.Iterable
[float
]) – regularization for event measurements ziz (
int
) – event output indexp (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorz (
typing.Iterable
[float
]) – model event output at timepointsigmaz (
typing.Iterable
[float
]) – event measurement standard deviation at timepoint
- Return type
-
fJy
(nllh: Iterable[float], iy: int, p: Iterable[float], k: Iterable[float], y: Iterable[float], sigmay: Iterable[float], my: Iterable[float]) → None[source]¶ Model specific implementation of fJy
- Parameters
nllh (
typing.Iterable
[float
]) – negative log-likelihood for measurements yiy (
int
) – output indexp (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectory (
typing.Iterable
[float
]) – model output at timepointsigmay (
typing.Iterable
[float
]) – measurement standard deviation at timepointmy (
typing.Iterable
[float
]) – measurements at timepoint
- Return type
-
fJz
(nllh: Iterable[float], iz: int, p: Iterable[float], k: Iterable[float], z: Iterable[float], sigmaz: Iterable[float], mz: Iterable[float]) → None[source]¶ Model specific implementation of fJz
- Parameters
nllh (
typing.Iterable
[float
]) – negative log-likelihood for event measurements ziz (
int
) – event output indexp (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorz (
typing.Iterable
[float
]) – model event output at timepointsigmaz (
typing.Iterable
[float
]) – event measurement standard deviation at timepointmz (
typing.Iterable
[float
]) – event measurements at timepoint
- Return type
-
fdJrzdsigma
(dJrzdsigma: Iterable[float], iz: int, p: Iterable[float], k: Iterable[float], rz: Iterable[float], sigmaz: Iterable[float]) → None[source]¶ Model specific implementation of fdJrzdsigma
- Parameters
dJrzdsigma (
typing.Iterable
[float
]) – Sensitivity of event penalization Jrz w.r.t. standard deviation sigmaziz (
int
) – event output indexp (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorrz (
typing.Iterable
[float
]) – model root output at timepointsigmaz (
typing.Iterable
[float
]) – event measurement standard deviation at timepoint
- Return type
-
fdJrzdz
(dJrzdz: Iterable[float], iz: int, p: Iterable[float], k: Iterable[float], rz: Iterable[float], sigmaz: Iterable[float]) → None[source]¶ Model specific implementation of fdJrzdz
- Parameters
dJrzdz (
typing.Iterable
[float
]) – partial derivative of event penalization Jrziz (
int
) – event output indexp (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorrz (
typing.Iterable
[float
]) – model root output at timepointsigmaz (
typing.Iterable
[float
]) – event measurement standard deviation at timepoint
- Return type
-
fdJydsigma
(dJydsigma: Iterable[float], iy: int, p: Iterable[float], k: Iterable[float], y: Iterable[float], sigmay: Iterable[float], my: Iterable[float]) → None[source]¶ Model specific implementation of fdJydsigma
- Parameters
dJydsigma (
typing.Iterable
[float
]) – Sensitivity of time-resolved measurement negative log-likelihood Jy w.r.t. standard deviation sigmayiy (
int
) – output indexp (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectory (
typing.Iterable
[float
]) – model output at timepointsigmay (
typing.Iterable
[float
]) – measurement standard deviation at timepointmy (
typing.Iterable
[float
]) – measurement at timepoint
- Return type
-
fdJzdsigma
(dJzdsigma: Iterable[float], iz: int, p: Iterable[float], k: Iterable[float], z: Iterable[float], sigmaz: Iterable[float], mz: Iterable[float]) → None[source]¶ Model specific implementation of fdJzdsigma
- Parameters
dJzdsigma (
typing.Iterable
[float
]) – Sensitivity of event measurement negative log-likelihood Jz w.r.t. standard deviation sigmaziz (
int
) – event output indexp (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorz (
typing.Iterable
[float
]) – model event output at timepointsigmaz (
typing.Iterable
[float
]) – event measurement standard deviation at timepointmz (
typing.Iterable
[float
]) – event measurement at timepoint
- Return type
-
fdJzdz
(dJzdz: Iterable[float], iz: int, p: Iterable[float], k: Iterable[float], z: Iterable[float], sigmaz: Iterable[float], mz: Iterable[float]) → None[source]¶ Model specific implementation of fdJzdz
- Parameters
dJzdz (
typing.Iterable
[float
]) – partial derivative of event measurement negative log-likelihood Jziz (
int
) – event output indexp (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorz (
typing.Iterable
[float
]) – model event output at timepointsigmaz (
typing.Iterable
[float
]) – event measurement standard deviation at timepointmz (
typing.Iterable
[float
]) – event measurement at timepoint
- Return type
-
fdeltaqB
(deltaqB: Iterable[float], t: float, x: Iterable[float], p: Iterable[float], k: Iterable[float], h: Iterable[float], ip: int, ie: int, xdot: Iterable[float], xdot_old: Iterable[float], xB: Iterable[float]) → None[source]¶ Model specific implementation of fdeltaqB
- Parameters
deltaqB (
typing.Iterable
[float
]) – sensitivity updatet (
float
) – current timex (
typing.Iterable
[float
]) – current statep (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorh (
typing.Iterable
[float
]) – Heaviside vectorip (
int
) – sensitivity indexie (
int
) – event indexxdot (
typing.Iterable
[float
]) – new model right hand sidexdot_old (
typing.Iterable
[float
]) – previous model right hand sidexB (
typing.Iterable
[float
]) – adjoint state
- Return type
-
fdeltasx
(deltasx: Iterable[float], t: float, x: Iterable[float], p: Iterable[float], k: Iterable[float], h: Iterable[float], w: Iterable[float], ip: int, ie: int, xdot: Iterable[float], xdot_old: Iterable[float], sx: Iterable[float], stau: Iterable[float]) → None[source]¶ Model specific implementation of fdeltasx
- Parameters
deltasx (
typing.Iterable
[float
]) – sensitivity updatet (
float
) – current timex (
typing.Iterable
[float
]) – current statep (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorh (
typing.Iterable
[float
]) – Heaviside vectorw (
typing.Iterable
[float
]) – repeating elements vectorip (
int
) – sensitivity indexie (
int
) – event indexxdot (
typing.Iterable
[float
]) – new model right hand sidexdot_old (
typing.Iterable
[float
]) – previous model right hand sidesx (
typing.Iterable
[float
]) – state sensitivitystau (
typing.Iterable
[float
]) – event-time sensitivity
- Return type
-
fdeltax
(deltax: Iterable[float], t: float, x: Iterable[float], p: Iterable[float], k: Iterable[float], h: Iterable[float], ie: int, xdot: Iterable[float], xdot_old: Iterable[float]) → None[source]¶ Model specific implementation of fdeltax
- Parameters
deltax (
typing.Iterable
[float
]) – state updatet (
float
) – current timex (
typing.Iterable
[float
]) – current statep (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorh (
typing.Iterable
[float
]) – Heaviside vectorie (
int
) – event indexxdot (
typing.Iterable
[float
]) – new model right hand sidexdot_old (
typing.Iterable
[float
]) – previous model right hand side
- Return type
-
fdeltaxB
(deltaxB: Iterable[float], t: float, x: Iterable[float], p: Iterable[float], k: Iterable[float], h: Iterable[float], ie: int, xdot: Iterable[float], xdot_old: Iterable[float], xB: Iterable[float]) → None[source]¶ Model specific implementation of fdeltaxB
- Parameters
deltaxB (
typing.Iterable
[float
]) – adjoint state updatet (
float
) – current timex (
typing.Iterable
[float
]) – current statep (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorh (
typing.Iterable
[float
]) – Heaviside vectorie (
int
) – event indexxdot (
typing.Iterable
[float
]) – new model right hand sidexdot_old (
typing.Iterable
[float
]) – previous model right hand sidexB (
typing.Iterable
[float
]) – current adjoint state
- Return type
-
fdrzdp
(drzdp: Iterable[float], ie: int, t: float, x: Iterable[float], p: Iterable[float], k: Iterable[float], h: Iterable[float], ip: int) → None[source]¶ Model specific implementation of fdrzdp
- Parameters
drzdp (
typing.Iterable
[float
]) – partial derivative of root output rz w.r.t. model parameters pie (
int
) – event indext (
float
) – current timex (
typing.Iterable
[float
]) – current statep (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorh (
typing.Iterable
[float
]) – Heaviside vectorip (
int
) – parameter index w.r.t. which the derivative is requested
- Return type
-
fdrzdx
(drzdx: Iterable[float], ie: int, t: float, x: Iterable[float], p: Iterable[float], k: Iterable[float], h: Iterable[float]) → None[source]¶ Model specific implementation of fdrzdx
- Parameters
drzdx (
typing.Iterable
[float
]) – partial derivative of root output rz w.r.t. model states xie (
int
) – event indext (
float
) – current timex (
typing.Iterable
[float
]) – current statep (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorh (
typing.Iterable
[float
]) – Heaviside vector
- Return type
-
fdsigmaydp
(dsigmaydp: Iterable[float], t: float, p: Iterable[float], k: Iterable[float], ip: int) → None[source]¶ Model specific implementation of fsigmay
- Parameters
dsigmaydp (
typing.Iterable
[float
]) – partial derivative of standard deviation of measurementst (
float
) – current timep (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorip (
int
) – sensitivity index
- Return type
-
fdsigmazdp
(dsigmazdp: Iterable[float], t: float, p: Iterable[float], k: Iterable[float], ip: int) → None[source]¶ Model specific implementation of fsigmaz
- Parameters
dsigmazdp (
typing.Iterable
[float
]) – partial derivative of standard deviation of event measurementst (
float
) – current timep (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorip (
int
) – sensitivity index
- Return type
-
fdydp
(dydp: Iterable[float], t: float, x: Iterable[float], p: Iterable[float], k: Iterable[float], h: Iterable[float], ip: int, w: Iterable[float], dwdp: Iterable[float]) → None[source]¶ Model specific implementation of fdydp
- Parameters
dydp (
typing.Iterable
[float
]) – partial derivative of observables y w.r.t. model parameters pt (
float
) – current timex (
typing.Iterable
[float
]) – current statep (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorh (
typing.Iterable
[float
]) – Heaviside vectorip (
int
) – parameter index w.r.t. which the derivative is requestedw (
typing.Iterable
[float
]) – repeating elements vectordwdp (
typing.Iterable
[float
]) – Recurring terms in xdot, parameter derivative
- Return type
-
fdydx
(dydx: Iterable[float], t: float, x: Iterable[float], p: Iterable[float], k: Iterable[float], h: Iterable[float], w: Iterable[float], dwdx: Iterable[float]) → None[source]¶ Model specific implementation of fdydx
- Parameters
dydx (
typing.Iterable
[float
]) – partial derivative of observables y w.r.t. model states xt (
float
) – current timex (
typing.Iterable
[float
]) – current statep (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorh (
typing.Iterable
[float
]) – Heaviside vectorw (
typing.Iterable
[float
]) – repeating elements vectordwdx (
typing.Iterable
[float
]) – Recurring terms in xdot, state derivative
- Return type
-
fdzdp
(dzdp: Iterable[float], ie: int, t: float, x: Iterable[float], p: Iterable[float], k: Iterable[float], h: Iterable[float], ip: int) → None[source]¶ Model specific implementation of fdzdp
- Parameters
dzdp (
typing.Iterable
[float
]) – partial derivative of event-resolved output z w.r.t. model parameters pie (
int
) – event indext (
float
) – current timex (
typing.Iterable
[float
]) – current statep (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorh (
typing.Iterable
[float
]) – Heaviside vectorip (
int
) – parameter index w.r.t. which the derivative is requested
- Return type
-
fdzdx
(dzdx: Iterable[float], ie: int, t: float, x: Iterable[float], p: Iterable[float], k: Iterable[float], h: Iterable[float]) → None[source]¶ Model specific implementation of fdzdx
- Parameters
dzdx (
typing.Iterable
[float
]) – partial derivative of event-resolved output z w.r.t. model states xie (
int
) – event indext (
float
) – current timex (
typing.Iterable
[float
]) – current statep (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorh (
typing.Iterable
[float
]) – Heaviside vector
- Return type
-
frz
(rz: Iterable[float], ie: int, t: float, x: Iterable[float], p: Iterable[float], k: Iterable[float], h: Iterable[float]) → None[source]¶ Model specific implementation of frz
- Parameters
rz (
typing.Iterable
[float
]) – value of root function at current timepoint (non-output events not included)ie (
int
) – event indext (
float
) – current timex (
typing.Iterable
[float
]) – current statep (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorh (
typing.Iterable
[float
]) – Heaviside vector
- Return type
-
fsdx0
() → None[source]¶ Compute sensitivity of derivative initial states sensitivities sdx0.
Only necessary for DAEs.
- Return type
-
fsigmay
(sigmay: Iterable[float], t: float, p: Iterable[float], k: Iterable[float]) → None[source]¶ Model specific implementation of fsigmay
- Parameters
sigmay (
typing.Iterable
[float
]) – standard deviation of measurementst (
float
) – current timep (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vector
- Return type
-
fsigmaz
(sigmaz: Iterable[float], t: float, p: Iterable[float], k: Iterable[float]) → None[source]¶ Model specific implementation of fsigmaz
- Parameters
sigmaz (
typing.Iterable
[float
]) – standard deviation of event measurementst (
float
) – current timep (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vector
- Return type
-
fsrz
(srz: Iterable[float], ie: int, t: float, x: Iterable[float], p: Iterable[float], k: Iterable[float], h: Iterable[float], sx: Iterable[float], ip: int) → None[source]¶ Model specific implementation of fsrz
- Parameters
srz (
typing.Iterable
[float
]) – Sensitivity of rz, total derivativeie (
int
) – event indext (
float
) – current timex (
typing.Iterable
[float
]) – current statep (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorsx (
typing.Iterable
[float
]) – current state sensitivityh (
typing.Iterable
[float
]) – Heaviside vectorip (
int
) – sensitivity index
- Return type
-
fstau
(stau: Iterable[float], t: float, x: Iterable[float], p: Iterable[float], k: Iterable[float], h: Iterable[float], sx: Iterable[float], ip: int, ie: int) → None[source]¶ Model specific implementation of fstau
- Parameters
stau (
typing.Iterable
[float
]) – total derivative of event timepointt (
float
) – current timex (
typing.Iterable
[float
]) – current statep (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorh (
typing.Iterable
[float
]) – Heaviside vectorsx (
typing.Iterable
[float
]) – current state sensitivityip (
int
) – sensitivity indexie (
int
) – event index
- Return type
-
fsx0
(sx0: Iterable[float], t: float, x0: Iterable[float], p: Iterable[float], k: Iterable[float], ip: int) → None¶ Model specific implementation of fsx0
- Parameters
sx0 (
typing.Iterable
[float
]) – initial state sensitivitiest (
float
) – initial timex0 (
typing.Iterable
[float
]) – initial statep (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorip (
int
) – sensitivity index
- Return type
-
fsx0_fixedParameters
(sx0: Iterable[float], t: float, x0: Iterable[float], p: Iterable[float], k: Iterable[float], ip: int) → None¶ Model specific implementation of fsx0_fixedParameters
- Parameters
sx0 (
typing.Iterable
[float
]) – initial state sensitivitiest (
float
) – initial timex0 (
typing.Iterable
[float
]) – initial statep (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorip (
int
) – sensitivity index
- Return type
-
fsz
(sz: Iterable[float], ie: int, t: float, x: Iterable[float], p: Iterable[float], k: Iterable[float], h: Iterable[float], sx: Iterable[float], ip: int) → None[source]¶ Model specific implementation of fsz
- Parameters
sz (
typing.Iterable
[float
]) – Sensitivity of rz, total derivativeie (
int
) – event indext (
float
) – current timex (
typing.Iterable
[float
]) – current statep (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorh (
typing.Iterable
[float
]) – Heaviside vectorsx (
typing.Iterable
[float
]) – current state sensitivityip (
int
) – sensitivity index
- Return type
-
fw
(w: Iterable[float], t: float, x: Iterable[float], p: Iterable[float], k: Iterable[float], h: Iterable[float], tcl: Iterable[float]) → None[source]¶ Model specific implementation of fw
- Parameters
w (
typing.Iterable
[float
]) – Recurring terms in xdott (
float
) – timepointx (
typing.Iterable
[float
]) – vector with the statesp (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constants vectorh (
typing.Iterable
[float
]) – Heaviside vectortcl (
typing.Iterable
[float
]) – total abundances for conservation laws
- Return type
-
fx0
(x0: Iterable[float], t: float, p: Iterable[float], k: Iterable[float]) → None¶ Model specific implementation of fx0
- Parameters
x0 (
typing.Iterable
[float
]) – initial statet (
float
) – initial timep (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vector
- Return type
-
fx0_fixedParameters
(x0: Iterable[float], t: float, p: Iterable[float], k: Iterable[float]) → None¶ Model specific implementation of fx0_fixedParameters
- Parameters
x0 (
typing.Iterable
[float
]) – initial statet (
float
) – initial timep (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vector
- Return type
-
fy
(y: Iterable[float], t: float, x: Iterable[float], p: Iterable[float], k: Iterable[float], h: Iterable[float], w: Iterable[float]) → None[source]¶ Model specific implementation of fy
- Parameters
y (
typing.Iterable
[float
]) – model output at current timepointt (
float
) – current timex (
typing.Iterable
[float
]) – current statep (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorh (
typing.Iterable
[float
]) – Heaviside vectorw (
typing.Iterable
[float
]) – repeating elements vector
- Return type
-
fz
(z: Iterable[float], ie: int, t: float, x: Iterable[float], p: Iterable[float], k: Iterable[float], h: Iterable[float]) → None[source]¶ Model specific implementation of fz
- Parameters
z (
typing.Iterable
[float
]) – value of event outputie (
int
) – event indext (
float
) – current timex (
typing.Iterable
[float
]) – current statep (
typing.Iterable
[float
]) – parameter vectork (
typing.Iterable
[float
]) – constant vectorh (
typing.Iterable
[float
]) – Heaviside vector
- Return type
-
getAlwaysCheckFinite
() → bool[source]¶ Get setting of whether the result of every call to Model::f* should be checked for finiteness.
- Return type
boolean
- Returns
that
-
getAmiciCommit
() → str¶ Returns the amici commit that was used to generate the model
- Return type
string
- Returns
ver amici commit string
-
getAmiciVersion
() → str¶ Returns the amici version that was used to generate the model
- Return type
string
- Returns
ver amici version string
-
getEventSigma
(sigmaz: Iterable[float], ie: int, nroots: int, t: float, edata: amici.amici.ExpData) → None[source]¶ Get event-resolved observable standard deviations.
- Parameters
sigmaz (
typing.Iterable
[float
]) – Output buffer (dimension: nz)ie (
int
) – Event indexnroots (
int
) – Event occurrencet (
float
) – Timepointedata (
amici.amici.ExpData
) – Pointer to experimental data (optional, pass nullptr to ignore)
- Return type
-
getEventSigmaSensitivity
(ssigmaz: Iterable[float], ie: int, nroots: int, t: float, edata: amici.amici.ExpData) → None[source]¶ Get sensitivities of event-resolved observable standard deviations.
Total derivative (only forward sensitivities).
- Parameters
ssigmaz (
typing.Iterable
[float
]) – Output buffer (dimension: nz x nplist, row-major)ie (
int
) – Event indexnroots (
int
) – Event occurrencet (
float
) – Timepointedata (
amici.amici.ExpData
) – Pointer to experimental data (optional, pass nullptr to ignore)
- Return type
-
getExpressionIds
() → amici.amici.StringVector[source]¶ Get IDs of the expression.
- Return type
- Returns
Expression IDs
-
getExpressionNames
() → amici.amici.StringVector[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
() → amici.amici.StringVector[source]¶ Get IDs of the fixed model parameters.
- Return type
- Returns
Fixed parameter IDs
-
getFixedParameterNames
() → amici.amici.StringVector[source]¶ Get names of the fixed model parameters.
- Return type
- Returns
Fixed parameter names
-
getFixedParameters
() → amici.amici.DoubleVector[source]¶ Get values of fixed parameters.
- Return type
- Returns
Vector of fixed parameters with same ordering as in Model::getFixedParameterIds
-
getInitialStateSensitivities
() → amici.amici.DoubleVector[source]¶ Get the initial states sensitivities.
- Return type
- Returns
vector of initial state sensitivities
-
getInitialStates
() → amici.amici.DoubleVector[source]¶ Get the initial states.
- Return type
- Returns
Initial state vector
-
getObservableIds
() → amici.amici.StringVector[source]¶ Get IDs of the observables.
- Return type
- Returns
Observable IDs
-
getObservableNames
() → amici.amici.StringVector[source]¶ Get names of the observables.
- Return type
- Returns
Observable names
-
getObservableSigma
(sigmay: Iterable[float], it: int, edata: amici.amici.ExpData) → None[source]¶ Get time-resolved observable standard deviations
- Parameters
sigmay (
typing.Iterable
[float
]) – Buffer (dimension: ny)it (
int
) – Timepoint indexedata (
amici.amici.ExpData
) – Pointer to experimental data instance (optional, pass nullptr to ignore)
- Return type
-
getObservableSigmaSensitivity
(ssigmay: Iterable[float], it: int, edata: amici.amici.ExpData) → None[source]¶ Sensitivity of time-resolved observable standard deviation.
Total derivative (can be used with both adjoint and forward sensitivity).
- Parameters
ssigmay (
typing.Iterable
[float
]) – Buffer (dimension: ny x nplist, row-major)it (
int
) – Timepoint indexedata (
amici.amici.ExpData
) – Pointer to experimental data instance (optional, pass nullptr to ignore)
- Return type
-
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
() → amici.amici.StringVector[source]¶ Get IDs of the model parameters.
- Return type
- Returns
Parameter IDs
-
getParameterList
() → amici.amici.IntVector[source]¶ Get the list of parameters for which sensitivities are computed.
- Return type
- Returns
List of parameter indices
-
getParameterNames
() → amici.amici.StringVector[source]¶ Get names of the model parameters.
- Return type
- Returns
The parameter names
-
getParameterScale
() → amici.amici.ParameterScalingVector[source]¶ Get parameter scale for each parameter.
- Return type
ParameterScalingVector >
- Returns
Vector of parameter scales
-
getParameters
() → amici.amici.DoubleVector[source]¶ Get parameter vector.
- Return type
- Returns
The user-set parameters (see also Model::getUnscaledParameters)
-
getReinitializeFixedParameterInitialStates
() → bool[source]¶ Get whether initial states depending on fixedParameters are to be reinitialized after preequilibration and presimulation.
- Return type
boolean
- Returns
flag true / false
-
getSolver
() → amici.amici.Solver¶ Retrieves the solver object
- Return type
- Returns
The Solver instance
-
getStateIds
() → amici.amici.StringVector[source]¶ Get IDs of the model states.
- Return type
- Returns
Sate IDs
-
getStateIsNonNegative
() → amici.amici.BoolVector[source]¶ Get flags indicating whether states should be treated as non-negative.
- Return type
- Returns
Vector of flags
-
getStateNames
() → amici.amici.StringVector[source]¶ Get names of the model states.
- Return type
- Returns
State names
-
getSteadyStateSensitivityMode
() → amici.amici.SteadyStateSensitivityMode[source]¶ Gets the mode how sensitivities are computed in the steadystate simulation.
- Return type
- Returns
Mode
-
getTimepoints
() → amici.amici.DoubleVector[source]¶ Get the timepoint vector.
- Return type
- Returns
Timepoint vector
-
getUnobservedEventSensitivity
(sz: Iterable[float], ie: int) → None[source]¶ Get sensitivity of z at final timepoint.
Ignores sensitivity of timepoint. Total derivative.
- Parameters
sz (
typing.Iterable
[float
]) – Output buffer (dimension: nz x nplist, row-major)ie (
int
) – Event index
- Return type
-
getUnscaledParameters
() → amici.amici.DoubleVector[source]¶ Get parameters with transformation according to parameter scale applied.
- Return type
- Returns
Unscaled parameters
-
hasCustomInitialStateSensitivities
() → bool[source]¶ Return whether custom initial state sensitivities have been set.
- Return type
boolean
- Returns
true if has custom initial state sensitivities, otherwise false.
-
hasCustomInitialStates
() → bool[source]¶ Return whether custom initial states have been set.
- Return type
boolean
- Returns
true if has custom initial states, otherwise false
-
hasExpressionIds
() → bool[source]¶ Report whether the model has expression IDs set.
- Return type
boolean
- 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
boolean
- 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
boolean
- 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
boolean
- 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
boolean
- 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
boolean
- 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
boolean
- 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
boolean
- 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
boolean
- Returns
boolean flag
-
hasStateIds
() → bool[source]¶ Report whether the model has state IDs set.
- Return type
boolean
- 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
boolean
- Returns
Boolean indicating whether state names were set. Also returns true if the number of corresponding variables is just zero.
-
isFixedParameterStateReinitializationAllowed
() → bool¶ Function indicating whether reinitialization of states depending on fixed parameters is permissible
- Return type
boolean
- Returns
flag indicating whether reinitialization of states depending on fixed parameters is permissible
-
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).
-
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
-
nx_reinit
() → int[source]¶ Get number of solver states subject to reinitialization.
- Return type
- Returns
Model member nx_solver_reinit
-
requireSensitivitiesForAllParameters
() → None[source]¶ Require computation of sensitivities for all parameters p [0..np[ in natural order.
NOTE: Resets initial state sensitivities.
- Return type
-
setAllStatesNonNegative
() → None[source]¶ Set flags indicating that all states should be treated as non-negative.
- Return type
-
setAlwaysCheckFinite
(alwaysCheck: bool) → None[source]¶ Set whether the result of every call to Model::f* should be checked for finiteness.
-
setFixedParameterById
(par_id: str, value: float) → None[source]¶ Set value of first fixed parameter with the specified ID.
-
setFixedParameterByName
(par_name: str, value: float) → None[source]¶ Set value of first fixed parameter with the specified name.
-
setFixedParameters
(k: amici.amici.DoubleVector) → None[source]¶ Set values for constants.
- Parameters
k (
amici.amici.DoubleVector
) – Vector of fixed parameters- Return type
-
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: amici.amici.DoubleVector) → None[source]¶ Set the initial state sensitivities.
- Parameters
sx0 (
amici.amici.DoubleVector
) – vector of initial state sensitivities with chainrule applied. This could be a slice of ReturnData::sx or ReturnData::sx0- Return type
-
setInitialStates
(x0: amici.amici.DoubleVector) → None[source]¶ Set the initial states.
- Parameters
x0 (
amici.amici.DoubleVector
) – Initial state vector- Return type
-
setNMaxEvent
(nmaxevent: int) → None[source]¶ Set maximum number of events that may occur for each type.
-
setParameterById
(*args) → None[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) – 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) → None[source]¶ Overload 1:
Set value of first model parameter with the specified name.
- Parameters
par_name (string) – Parameter name
value (float) – Parameter value
Overload 2:
Set model parameters according to the parameter name and mapped values.
- Parameters
p (StringDoubleMap) – Map of parameters names and values
ignoreErrors (boolean) – 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
- Return type
-
setParameterList
(plist: amici.amici.IntVector) → None[source]¶ Set the list of parameters for which sensitivities are to be computed.
NOTE: Resets initial state sensitivities.
- Parameters
plist (
amici.amici.IntVector
) – List of parameter indices- Return type
-
setParameterScale
(*args) → None[source]¶ Overload 1:
Set parameter scale for each parameter.
NOTE: Resets initial state sensitivities.
- Parameters
pscale (int) – Scalar parameter scale to be set for all parameters
Overload 2:
Set parameter scale for each parameter.
NOTE: Resets initial state sensitivities.
- Parameters
pscaleVec (ParameterScalingVector >) – Vector of parameter scales
- Return type
-
setParameters
(p: amici.amici.DoubleVector) → None[source]¶ Set the parameter vector.
- Parameters
p (
amici.amici.DoubleVector
) – Vector of parameters- Return type
-
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.
-
setReinitializeFixedParameterInitialStates
(flag: bool) → None[source]¶ Set whether initial states depending on fixed parameters are to be reinitialized after preequilibration and presimulation.
-
setStateIsNonNegative
(stateIsNonNegative: amici.amici.BoolVector) → None[source]¶ Set flags indicating whether states should be treated as non-negative.
- Parameters
stateIsNonNegative (
amici.amici.BoolVector
) – Vector of flags- Return type
-
setSteadyStateSensitivityMode
(mode: amici.amici.SteadyStateSensitivityMode) → None[source]¶ Set the mode how sensitivities are computed in the steadystate simulation.
- Parameters
mode (
amici.amici.SteadyStateSensitivityMode
) – Steadystate sensitivity mode- Return type
-
setTimepoints
(ts: amici.amici.DoubleVector) → None[source]¶ Set the timepoint vector.
- Parameters
ts (
amici.amici.DoubleVector
) – New timepoint vector- Return type
-
setUnscaledInitialStateSensitivities
(sx0: amici.amici.DoubleVector) → None[source]¶ Set the initial state sensitivities.
- Parameters
sx0 (
amici.amici.DoubleVector
) – Vector of initial state sensitivities without chainrule applied. This could be the readin from a model.sx0data saved to HDF5.- Return type
-
updateHeaviside
(rootsfound: amici.amici.IntVector) → None[source]¶ Update the Heaviside variables h on event occurrences.
- Parameters
rootsfound (
amici.amici.IntVector
) – Provides the direction of the zero-crossing, so adding it will give the right update to the Heaviside variables (zero if no root was found)- Return type
-
updateHeavisideB
(rootsfound: Iterable[int]) → None[source]¶ Updates the Heaviside variables h on event occurrences in the backward problem.
- Parameters
rootsfound (
typing.Iterable
[int
]) – Provides the direction of the zero-crossing, so adding it will give the right update to the Heaviside variables (zero if no root was found)- Return type
-