# amici.ode_export.ODEExporter¶

class amici.ode_export.ODEExporter(ode_model, outdir=None, verbose=False, assume_pow_positivity=False, compiler=None, allow_reinit_fixpar_initcond=True, generate_sensitivity_code=True, model_name='model')[source]

The ODEExporter class generates AMICI C++ files for ODE model as defined in symbolic expressions.

Variables
• model – ODE definition

• verbose – more verbose output if True

• assume_pow_positivity

if set to true, a special pow function is used to avoid problems with state variables that may become negative due to numerical errors

compiler: distutils/setuptools compiler selection to build the python extension

• functions – carries C++ function signatures and other specifications

• model_name – name of the model that will be used for compilation

• model_path – path to the generated model specific files

• model_swig_path – path to the generated swig files

• allow_reinit_fixpar_initcond – indicates whether reinitialization of initial states depending on fixedParameters is allowed for this model

• _build_hints – If the given model uses special functions, this set contains hints for model building.

• generate_sensitivity_code – Specifies whether code for sensitivity computation is to be generated

__init__(ode_model, outdir=None, verbose=False, assume_pow_positivity=False, compiler=None, allow_reinit_fixpar_initcond=True, generate_sensitivity_code=True, model_name='model')[source]

Generate AMICI C++ files for the ODE provided to the constructor.

Parameters
:param generate_sensitivity_code specifies whether code required for

sensitivity computation will be generated

Parameters

model_name (typing.Optional[str]) – name of the model to be used during code generation

Methods Summary

 __init__(ode_model[, outdir, verbose, …]) Generate AMICI C++ files for the ODE provided to the constructor. Compiles the generated code it into a simulatable module Generates the native C++ code for the loaded model and a Matlab script that can be run to compile a mex file from the C++ code set_name(model_name) Sets the model name set_paths([output_dir]) Set output paths for the model and create if necessary

Methods

__init__(ode_model, outdir=None, verbose=False, assume_pow_positivity=False, compiler=None, allow_reinit_fixpar_initcond=True, generate_sensitivity_code=True, model_name='model')[source]

Generate AMICI C++ files for the ODE provided to the constructor.

Parameters
:param generate_sensitivity_code specifies whether code required for

sensitivity computation will be generated

Parameters

model_name (typing.Optional[str]) – name of the model to be used during code generation

compile_model()[source]

Compiles the generated code it into a simulatable module

Return type

None

generate_model_code()[source]

Generates the native C++ code for the loaded model and a Matlab script that can be run to compile a mex file from the C++ code

Return type

None

set_name(model_name)[source]

Sets the model name

Parameters

model_name (str) – name of the model (may only contain upper and lower case letters, digits and underscores, and must not start with a digit)

Return type

None

set_paths(output_dir=None)[source]

Set output paths for the model and create if necessary

Parameters

output_dir (typing.Optional[str]) – relative or absolute path where the generated model code is to be placed. If None, this will default to amici-{self.model_name} in the current working directory. will be created if does not exists.

Return type

None