Stan¶
Model export to Stan.
API¶
The standard exporting API is provided:
- myokit.formats.stan.exporters()¶
Returns a dict of all exporters available in this module.
- class myokit.formats.stan.StanExporter¶
This:class:Exporter <myokit.formats.Exporter> generates a Stan implementation of a Myokit model.
Only the model definition is exported. An interpolating pacing input method is added. No post-processing is included.
The following inputs are provided:
timeThe current simulation time
paceThe current value of the pacing system, implemented using a very simple pacing mechanism.
- runnable(path, model, protocol=None, parameters=None, output=None)¶
Exports a:class:myokit.Model to a Stan model with a parameter estimation file.
Arguments:
pathA string representing the directory to store the output in.
modelA Myokit model to export
protocolNot implemented!
parametersA list of variables or variable names, specifying the model variables to be estimated by stan.
outputA single variable to be used as the model output (for example an ion current).
- myokit.formats.stan.ewriters()¶
Returns a dict of all expression writers available in this module.
- class myokit.formats.stan.StanExpressionWriter¶
This:class:ExpressionWriter <myokit.formats.ExpressionWriter> translates Myokit:class:expressions <myokit.Expression> to a Stan syntax.
- eq(q)¶
Converts a
myokit.Equationto a string.
- ex(e)¶
Converts a
myokit.Expressionto a string.
- set_lhs_function(f)¶
- Sets a naming function, will be called to get the variable name from a
myokit.LhsExpressionobject.
The argument
fshould be a function that takes anLhsExpressionas input and returns a string.