Interactive kinetic modelling

In this notebook we will look at how we can explore a simple kinetic system using only a handful of lines of Python code and the ChemPy library. First we import the functions & classes that we will be using:

In [1]:
from collections import defaultdict
from ipywidgets import interact, FloatSlider
from chempy import ReactionSystem, Substance
from chempy.kinetics.ode import get_odesys
from chempy.kinetics._native import get_native
from chempy.units import SI_base_registry, default_units as u
import matplotlib.pyplot as plt
%matplotlib inline
DEBUG:matplotlib:$HOME=/root
DEBUG:matplotlib:CONFIGDIR=/root/.config/matplotlib
DEBUG:matplotlib:matplotlib data path: /usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data
DEBUG:matplotlib:loaded rc file /root/.config/matplotlib/matplotlibrc
DEBUG:matplotlib:matplotlib version 3.0.3
DEBUG:matplotlib:interactive is False
DEBUG:matplotlib:platform is linux
DEBUG:matplotlib:loaded modules: ['builtins', 'sys', '_frozen_importlib', '_imp', '_warnings', '_thread', '_weakref', '_frozen_importlib_external', '_io', 'marshal', 'posix', 'zipimport', 'encodings', 'codecs', '_codecs', 'encodings.aliases', 'encodings.utf_8', '_signal', '__main__', 'encodings.latin_1', 'io', 'abc', '_weakrefset', '_bootlocale', '_locale', 'site', 'os', 'errno', 'stat', '_stat', 'posixpath', 'genericpath', 'os.path', '_collections_abc', '_sitebuiltins', 'sysconfig', '_sysconfigdata_m_linux_x86_64-linux-gnu', 'types', 'functools', '_functools', 'collections', 'operator', '_operator', 'keyword', 'heapq', '_heapq', 'itertools', 'reprlib', '_collections', 'weakref', 'collections.abc', 'importlib', 'importlib._bootstrap', 'importlib._bootstrap_external', 'warnings', 'importlib.util', 'importlib.abc', 'importlib.machinery', 'contextlib', 'mpl_toolkits', 'ruamel', 'sphinxcontrib', 'zc', 'sitecustomize', 'runpy', 'pkgutil', 'ipykernel', 'ipykernel._version', 'ipykernel.connect', '__future__', 'json', 'json.decoder', 're', 'enum', 'sre_compile', '_sre', 'sre_parse', 'sre_constants', 'copyreg', 'json.scanner', '_json', 'json.encoder', 'subprocess', 'time', 'signal', '_posixsubprocess', 'select', 'selectors', 'math', 'threading', 'traceback', 'linecache', 'tokenize', 'token', 'IPython', 'IPython.core', 'IPython.core.getipython', 'IPython.core.release', 'IPython.core.application', 'atexit', 'copy', 'glob', 'fnmatch', 'logging', 'string', '_string', 'shutil', 'zlib', 'bz2', '_compression', '_bz2', 'lzma', '_lzma', 'pwd', 'grp', 'traitlets', 'traitlets.traitlets', 'inspect', 'ast', '_ast', 'dis', 'opcode', '_opcode', 'six', 'struct', '_struct', 'traitlets.utils', 'traitlets.utils.getargspec', 'traitlets.utils.importstring', 'ipython_genutils', 'ipython_genutils._version', 'ipython_genutils.py3compat', 'ipython_genutils.encoding', 'locale', 'platform', 'traitlets.utils.sentinel', 'traitlets.utils.bunch', 'traitlets._version', 'traitlets.config', 'traitlets.config.application', 'decorator', 'traitlets.config.configurable', 'traitlets.config.loader', 'argparse', 'textwrap', 'gettext', 'ipython_genutils.path', 'random', 'hashlib', '_hashlib', '_blake2', '_sha3', 'bisect', '_bisect', '_random', 'ipython_genutils.text', 'ipython_genutils.importstring', 'IPython.core.crashhandler', 'pprint', 'IPython.core.ultratb', 'pydoc', 'urllib', 'urllib.parse', 'IPython.core.debugger', 'bdb', 'IPython.utils', 'IPython.utils.PyColorize', 'IPython.utils.coloransi', 'IPython.utils.ipstruct', 'IPython.utils.colorable', 'pygments', 'pygments.util', 'IPython.utils.py3compat', 'IPython.utils.encoding', 'IPython.core.excolors', 'IPython.testing', 'IPython.testing.skipdoctest', 'pdb', 'cmd', 'code', 'codeop', 'IPython.core.display_trap', 'IPython.utils.path', 'IPython.utils.process', 'IPython.utils._process_posix', 'pexpect', 'pexpect.exceptions', 'pexpect.utils', 'pexpect.expect', 'pexpect.pty_spawn', 'pty', 'tty', 'termios', 'ptyprocess', 'ptyprocess.ptyprocess', 'fcntl', 'resource', 'ptyprocess.util', 'pexpect.spawnbase', 'pexpect.run', 'IPython.utils._process_common', 'shlex', 'IPython.utils.decorators', 'IPython.utils.data', 'IPython.utils.terminal', 'IPython.utils.sysinfo', 'IPython.utils._sysinfo', 'IPython.core.profiledir', 'IPython.paths', 'tempfile', 'IPython.utils.importstring', 'IPython.terminal', 'IPython.terminal.embed', 'IPython.core.compilerop', 'IPython.core.magic_arguments', 'IPython.core.error', 'IPython.utils.text', 'pathlib', 'ntpath', 'IPython.core.magic', 'getopt', 'IPython.core.oinspect', 'IPython.core.page', 'IPython.core.display', 'binascii', 'mimetypes', 'IPython.lib', 'IPython.lib.security', 'getpass', 'IPython.lib.pretty', 'datetime', '_datetime', 'IPython.utils.openpy', 'IPython.utils.dir2', 'IPython.utils.wildcard', 'pygments.lexers', 'pygments.lexers._mapping', 'pygments.modeline', 'pygments.plugin', 'pygments.lexers.python', 'pygments.lexer', 'pygments.filter', 'pygments.filters', 'pygments.token', 'pygments.regexopt', 'pygments.unistring', 'pygments.formatters', 'pygments.formatters._mapping', 'pygments.formatters.html', 'pygments.formatter', 'pygments.styles', 'IPython.core.inputtransformer2', 'typing', 'typing.io', 'typing.re', 'IPython.core.interactiveshell', 'asyncio', 'asyncio.base_events', 'concurrent', 'concurrent.futures', 'concurrent.futures._base', 'concurrent.futures.process', 'queue', 'multiprocessing', 'multiprocessing.context', 'multiprocessing.process', 'multiprocessing.reduction', 'pickle', '_compat_pickle', '_pickle', 'socket', '_socket', 'array', '__mp_main__', 'multiprocessing.connection', '_multiprocessing', 'multiprocessing.util', 'concurrent.futures.thread', 'asyncio.compat', 'asyncio.coroutines', 'asyncio.constants', 'asyncio.events', 'asyncio.base_futures', 'asyncio.log', 'asyncio.futures', 'asyncio.base_tasks', '_asyncio', 'asyncio.tasks', 'asyncio.locks', 'asyncio.protocols', 'asyncio.queues', 'asyncio.streams', 'asyncio.subprocess', 'asyncio.transports', 'asyncio.unix_events', 'asyncio.base_subprocess', 'asyncio.selector_events', 'ssl', 'ipaddress', '_ssl', 'base64', 'asyncio.sslproto', 'pickleshare', 'IPython.core.prefilter', 'IPython.core.autocall', 'IPython.core.macro', 'IPython.core.splitinput', 'IPython.core.alias', 'IPython.core.builtin_trap', 'IPython.core.events', 'backcall', 'backcall.backcall', 'IPython.core.displayhook', 'IPython.core.displaypub', 'IPython.core.extensions', 'IPython.core.formatters', 'IPython.utils.sentinel', 'IPython.core.history', 'sqlite3', 'sqlite3.dbapi2', '_sqlite3', 'IPython.core.logger', 'IPython.core.payload', 'IPython.core.usage', 'IPython.display', 'IPython.lib.display', 'html', 'html.entities', 'IPython.utils.io', 'IPython.utils.capture', 'IPython.utils.strdispatch', 'IPython.core.hooks', 'IPython.utils.syspathcontext', 'IPython.utils.tempdir', 'IPython.utils.contexts', 'IPython.core.async_helpers', 'IPython.terminal.interactiveshell', 'prompt_toolkit', 'prompt_toolkit.application', 'prompt_toolkit.application.application', 'prompt_toolkit.buffer', 'prompt_toolkit.application.current', 'prompt_toolkit.eventloop', 'prompt_toolkit.eventloop.base', 'prompt_toolkit.log', 'prompt_toolkit.eventloop.coroutine', 'prompt_toolkit.eventloop.defaults', 'prompt_toolkit.utils', 'six.moves', 'wcwidth', 'wcwidth.wcwidth', 'wcwidth.table_wide', 'wcwidth.table_zero', 'prompt_toolkit.cache', 'prompt_toolkit.eventloop.future', 'prompt_toolkit.eventloop.context', 'prompt_toolkit.eventloop.async_generator', 'six.moves.queue', 'prompt_toolkit.eventloop.event', 'prompt_toolkit.application.run_in_terminal', 'prompt_toolkit.auto_suggest', 'prompt_toolkit.filters', 'prompt_toolkit.filters.base', 'prompt_toolkit.filters.app', 'prompt_toolkit.enums', 'prompt_toolkit.filters.utils', 'prompt_toolkit.filters.cli', 'prompt_toolkit.clipboard', 'prompt_toolkit.clipboard.base', 'prompt_toolkit.selection', 'prompt_toolkit.clipboard.in_memory', 'prompt_toolkit.completion', 'prompt_toolkit.completion.base', 'prompt_toolkit.completion.filesystem', 'prompt_toolkit.completion.word_completer', 'prompt_toolkit.completion.fuzzy_completer', 'prompt_toolkit.document', 'prompt_toolkit.history', 'prompt_toolkit.search', 'prompt_toolkit.key_binding', 'prompt_toolkit.key_binding.key_bindings', 'prompt_toolkit.keys', 'prompt_toolkit.key_binding.vi_state', 'prompt_toolkit.validation', 'prompt_toolkit.input', 'prompt_toolkit.input.base', 'prompt_toolkit.input.defaults', 'prompt_toolkit.input.typeahead', 'prompt_toolkit.key_binding.bindings', 'prompt_toolkit.key_binding.bindings.page_navigation', 'prompt_toolkit.key_binding.bindings.scroll', 'prompt_toolkit.key_binding.defaults', 'prompt_toolkit.key_binding.bindings.basic', 'prompt_toolkit.key_binding.key_processor', 'prompt_toolkit.key_binding.bindings.named_commands', 'prompt_toolkit.key_binding.bindings.completion', 'prompt_toolkit.key_binding.bindings.emacs', 'prompt_toolkit.key_binding.bindings.vi', 'prompt_toolkit.input.vt100_parser', 'prompt_toolkit.input.ansi_escape_sequences', 'prompt_toolkit.key_binding.digraphs', 'prompt_toolkit.key_binding.bindings.mouse', 'prompt_toolkit.layout', 'prompt_toolkit.layout.containers', 'prompt_toolkit.layout.controls', 'prompt_toolkit.formatted_text', 'prompt_toolkit.formatted_text.base', 'prompt_toolkit.formatted_text.html', 'xml', 'xml.dom', 'xml.dom.domreg', 'xml.dom.minidom', 'xml.dom.minicompat', 'xml.dom.xmlbuilder', 'xml.dom.NodeFilter', 'prompt_toolkit.formatted_text.ansi', 'prompt_toolkit.output', 'prompt_toolkit.output.base', 'prompt_toolkit.layout.screen', 'prompt_toolkit.output.defaults', 'prompt_toolkit.output.color_depth', 'prompt_toolkit.output.vt100', 'prompt_toolkit.styles', 'prompt_toolkit.styles.base', 'prompt_toolkit.styles.defaults', 'prompt_toolkit.styles.style', 'prompt_toolkit.styles.named_colors', 'prompt_toolkit.styles.pygments', 'prompt_toolkit.styles.style_transformation', 'colorsys', 'prompt_toolkit.formatted_text.pygments', 'prompt_toolkit.formatted_text.utils', 'prompt_toolkit.lexers', 'prompt_toolkit.lexers.base', 'prompt_toolkit.lexers.pygments', 'prompt_toolkit.mouse_events', 'prompt_toolkit.layout.processors', 'prompt_toolkit.layout.utils', 'prompt_toolkit.layout.dimension', 'prompt_toolkit.layout.margins', 'prompt_toolkit.layout.layout', 'prompt_toolkit.layout.menus', 'prompt_toolkit.renderer', 'prompt_toolkit.layout.mouse_handlers', 'prompt_toolkit.key_binding.bindings.cpr', 'prompt_toolkit.key_binding.emacs_state', 'prompt_toolkit.layout.dummy', 'prompt_toolkit.application.dummy', 'prompt_toolkit.shortcuts', 'prompt_toolkit.shortcuts.dialogs', 'prompt_toolkit.key_binding.bindings.focus', 'prompt_toolkit.widgets', 'prompt_toolkit.widgets.base', 'prompt_toolkit.widgets.toolbars', 'prompt_toolkit.widgets.dialogs', 'prompt_toolkit.widgets.menus', 'prompt_toolkit.shortcuts.prompt', 'prompt_toolkit.key_binding.bindings.auto_suggest', 'prompt_toolkit.key_binding.bindings.open_in_editor', 'prompt_toolkit.shortcuts.utils', 'prompt_toolkit.shortcuts.progress_bar', 'prompt_toolkit.shortcuts.progress_bar.base', 'prompt_toolkit.shortcuts.progress_bar.formatters', 'prompt_toolkit.patch_stdout', 'pygments.style', 'IPython.terminal.debugger', 'IPython.core.completer', 'unicodedata', 'IPython.core.latex_symbols', 'IPython.utils.generics', 'jedi', 'jedi.api', 'parso', 'parso.parser', 'parso.tree', 'parso._compatibility', 'parso.utils', 'parso.pgen2', 'parso.pgen2.generator', 'parso.pgen2.grammar_parser', 'parso.python', 'parso.python.tokenize', 'parso.python.token', 'parso.grammar', 'parso.python.diff', 'difflib', 'parso.python.parser', 'parso.python.tree', 'parso.python.prefix', 'parso.cache', 'gc', 'parso.python.errors', 'parso.normalizer', 'parso.python.pep8', 'parso.file_io', 'jedi._compatibility', 'jedi.parser_utils', 'jedi.debug', 'jedi.settings', 'jedi.cache', 'jedi.api.classes', 'jedi.evaluate', 'jedi.evaluate.utils', 'jedi.evaluate.imports', 'jedi.evaluate.sys_path', 'jedi.evaluate.cache', 'jedi.evaluate.base_context', 'jedi.common', 'jedi.common.context', 'jedi.evaluate.helpers', 'jedi.common.utils', 'jedi.evaluate.compiled', 'jedi.evaluate.compiled.context', 'jedi.evaluate.filters', 'jedi.evaluate.flow_analysis', 'jedi.evaluate.recursion', 'jedi.evaluate.lazy_context', 'jedi.evaluate.compiled.access', 'jedi.evaluate.compiled.getattr_static', 'jedi.evaluate.compiled.fake', 'jedi.evaluate.analysis', 'jedi.evaluate.context', 'jedi.evaluate.context.module', 'jedi.evaluate.context.klass', 'jedi.evaluate.context.function', 'jedi.evaluate.docstrings', 'jedi.evaluate.pep0484', 'jedi.evaluate.arguments', 'jedi.evaluate.context.iterable', 'jedi.evaluate.param', 'jedi.evaluate.context.asynchronous', 'jedi.evaluate.parser_cache', 'jedi.evaluate.context.instance', 'jedi.evaluate.syntax_tree', 'jedi.evaluate.finder', 'jedi.api.keywords', 'pydoc_data', 'pydoc_data.topics', 'jedi.api.interpreter', 'jedi.evaluate.compiled.mixed', 'jedi.api.helpers', 'jedi.api.completion', 'jedi.api.environment', 'filecmp', 'jedi.evaluate.compiled.subprocess', 'jedi.evaluate.compiled.subprocess.functions', 'jedi.api.exceptions', 'jedi.api.project', 'jedi.evaluate.usages', 'IPython.terminal.ptutils', 'IPython.terminal.shortcuts', 'IPython.terminal.magics', 'IPython.lib.clipboard', 'IPython.terminal.pt_inputhooks', 'IPython.terminal.prompts', 'IPython.terminal.ipapp', 'IPython.core.magics', 'IPython.core.magics.auto', 'IPython.core.magics.basic', 'IPython.core.magics.code', 'urllib.request', 'email', 'http', 'http.client', 'email.parser', 'email.feedparser', 'email.errors', 'email._policybase', 'email.header', 'email.quoprimime', 'email.base64mime', 'email.charset', 'email.encoders', 'quopri', 'email.utils', 'email._parseaddr', 'calendar', 'email.message', 'uu', 'email._encoded_words', 'email.iterators', 'urllib.error', 'urllib.response', 'IPython.core.magics.config', 'IPython.core.magics.display', 'IPython.core.magics.execution', 'timeit', 'cProfile', '_lsprof', 'profile', 'optparse', 'pstats', 'IPython.utils.module_paths', 'IPython.utils.timing', 'IPython.core.magics.extension', 'IPython.core.magics.history', 'IPython.core.magics.logging', 'IPython.core.magics.namespace', 'IPython.core.magics.osm', 'IPython.core.magics.packaging', 'IPython.core.magics.pylab', 'IPython.core.pylabtools', 'IPython.core.magics.script', 'IPython.lib.backgroundjobs', 'IPython.core.shellapp', 'IPython.extensions', 'IPython.extensions.storemagic', 'IPython.utils.frame', 'jupyter_client', 'jupyter_client._version', 'jupyter_client.connect', 'zmq', 'ctypes', '_ctypes', 'ctypes._endian', 'zmq.backend', 'zmq.backend.select', 'zmq.backend.cython', 'zmq.backend.cython.constants', 'cython_runtime', 'zmq.backend.cython.error', '_cython_0_29_6', 'zmq.backend.cython.message', 'zmq.error', 'zmq.backend.cython.context', 'zmq.backend.cython.socket', 'zmq.backend.cython.utils', 'zmq.backend.cython._poll', 'zmq.backend.cython._version', 'zmq.backend.cython._device', 'zmq.backend.cython._proxy_steerable', 'zmq.sugar', 'zmq.sugar.constants', 'zmq.utils', 'zmq.utils.constant_names', 'zmq.sugar.context', 'zmq.sugar.attrsettr', 'zmq.sugar.socket', 'zmq.sugar.poll', 'zmq.utils.jsonapi', 'zmq.utils.strtypes', 'zmq.sugar.frame', 'zmq.sugar.tracker', 'zmq.sugar.version', 'zmq.sugar.stopwatch', 'jupyter_client.localinterfaces', 'jupyter_core', 'jupyter_core.version', 'jupyter_core.paths', 'jupyter_client.launcher', 'traitlets.log', 'jupyter_client.client', 'jupyter_client.channels', 'jupyter_client.channelsabc', 'jupyter_client.clientabc', 'jupyter_client.manager', 'jupyter_client.kernelspec', 'jupyter_client.managerabc', 'jupyter_client.blocking', 'jupyter_client.blocking.client', 'jupyter_client.blocking.channels', 'jupyter_client.multikernelmanager', 'uuid', 'ctypes.util', 'ipykernel.kernelapp', 'tornado', 'tornado.ioloop', 'numbers', 'tornado.concurrent', 'tornado.log', 'logging.handlers', 'tornado.escape', 'tornado.util', 'tornado.speedups', 'curses', '_curses', 'zmq.eventloop', 'zmq.eventloop.ioloop', 'tornado.platform', 'tornado.platform.asyncio', 'tornado.gen', 'zmq.eventloop.zmqstream', 'ipykernel.iostream', 'imp', 'jupyter_client.session', 'hmac', 'jupyter_client.jsonutil', 'dateutil', 'dateutil._version', 'dateutil.parser', 'dateutil.parser._parser', 'decimal', '_decimal', 'dateutil.relativedelta', 'dateutil._common', 'dateutil.tz', 'dateutil.tz.tz', 'dateutil.tz._common', 'dateutil.tz._factories', 'dateutil.parser.isoparser', '_strptime', 'jupyter_client.adapter', 'ipykernel.heartbeat', 'ipykernel.ipkernel', 'IPython.utils.tokenutil', 'ipykernel.comm', 'ipykernel.comm.manager', 'ipykernel.comm.comm', 'ipykernel.kernelbase', 'tornado.queues', 'tornado.locks', 'ipykernel.jsonutil', 'ipykernel.zmqshell', 'IPython.core.payloadpage', 'ipykernel.displayhook', 'ipykernel.parentpoller', 'encodings.idna', 'stringprep', 'faulthandler', 'ipykernel.datapub', 'ipykernel.serialize', 'ipykernel.pickleutil', 'ipykernel.codeutil', 'IPython.core.completerlib', 'storemagic', 'ipywidgets', 'ipywidgets._version', 'ipywidgets.widgets', 'ipywidgets.widgets.widget', 'ipywidgets.widgets.domwidget', 'ipywidgets.widgets.trait_types', 'ipywidgets.widgets.widget_layout', 'ipywidgets.widgets.widget_style', 'ipywidgets.widgets.valuewidget', 'ipywidgets.widgets.widget_core', 'ipywidgets.widgets.widget_bool', 'ipywidgets.widgets.widget_description', 'ipywidgets.widgets.widget_button', 'ipywidgets.widgets.widget_box', 'ipywidgets.widgets.docutils', 'ipywidgets.widgets.widget_float', 'ipywidgets.widgets.widget_int', 'ipywidgets.widgets.widget_color', 'ipywidgets.widgets.widget_date', 'ipywidgets.widgets.widget_output', 'ipywidgets.widgets.widget_selection', 'ipywidgets.widgets.widget_selectioncontainer', 'ipywidgets.widgets.widget_string', 'ipywidgets.widgets.widget_controller', 'ipywidgets.widgets.interaction', 'ipywidgets.widgets.widget_link', 'ipywidgets.widgets.widget_media', 'chempy', 'chempy._url', 'chempy._release', 'chempy.chemistry', 'chempy.util', 'chempy.util.pyutil', 'chempy.util.deprecation', 'chempy.util.arithmeticdict', 'chempy.util._expr', 'sympy', 'mpmath', 'mpmath.usertools', 'mpmath.ctx_fp', 'mpmath.ctx_base', 'mpmath.libmp', 'mpmath.libmp.libmpf', 'mpmath.libmp.backend', 'mpmath.libmp.six', 'mpmath.libmp.six.moves', 'mpmath.libmp.libintmath', 'mpmath.libmp.libmpc', 'mpmath.libmp.libelefun', 'mpmath.libmp.libhyper', 'mpmath.libmp.gammazeta', 'mpmath.libmp.libmpi', 'mpmath.functions', 'mpmath.functions.functions', 'cmath', 'mpmath.functions.factorials', 'mpmath.functions.hypergeometric', 'mpmath.functions.expintegrals', 'mpmath.functions.bessel', 'mpmath.functions.orthogonal', 'mpmath.functions.theta', 'mpmath.functions.elliptic', 'mpmath.functions.zeta', 'mpmath.functions.rszeta', 'mpmath.functions.zetazeros', 'mpmath.functions.qfunctions', 'mpmath.calculus', 'mpmath.calculus.calculus', 'mpmath.calculus.approximation', 'mpmath.calculus.differentiation', 'mpmath.calculus.extrapolation', 'mpmath.calculus.polynomials', 'mpmath.calculus.quadrature', 'mpmath.calculus.inverselaplace', 'mpmath.calculus.optimization', 'mpmath.calculus.odes', 'mpmath.matrices', 'mpmath.matrices.eigen', 'mpmath.matrices.eigen_symmetric', 'mpmath.matrices.matrices', 'mpmath.matrices.calculus', 'mpmath.matrices.linalg', 'mpmath.identification', 'mpmath.visualization', 'mpmath.math2', 'mpmath.function_docs', 'mpmath.ctx_mp', 'mpmath.rational', 'mpmath.ctx_mp_python', 'mpmath.ctx_iv', 'sympy.release', 'sympy.core', 'sympy.core.sympify', 'sympy.core.core', 'sympy.core.compatibility', 'sympy.external', 'sympy.external.importtools', 'distutils', 'distutils.version', 'sympy.core.evaluate', 'sympy.core.cache', 'sympy.core.basic', 'sympy.core.assumptions', 'sympy.core.facts', 'sympy.core.logic', 'sympy.core.singleton', 'sympy.core.expr', 'sympy.core.evalf', 'sympy.utilities', 'sympy.utilities.iterables', 'sympy.utilities.enumerative', 'sympy.utilities.misc', 'sympy.utilities.lambdify', 'sympy.utilities.decorator', 'sympy.core.decorators', 'sympy.utilities.runtests', 'doctest', 'unittest', 'unittest.result', 'unittest.util', 'unittest.case', 'unittest.suite', 'unittest.loader', 'unittest.main', 'unittest.runner', 'unittest.signals', 'sympy.utilities.exceptions', 'sympy.utilities.source', 'sympy.utilities.timeutils', 'sympy.core.mul', 'sympy.core.operations', 'sympy.core.numbers', 'fractions', 'sympy.core.containers', 'sympy.core.power', 'sympy.core.function', 'sympy.core.add', 'sympy.core.rules', 'sympy.core.symbol', 'sympy.logic', 'sympy.logic.boolalg', 'sympy.logic.inference', 'sympy.core.mod', 'sympy.core.exprtools', 'sympy.core.coreerrors', 'sympy.core.relational', 'sympy.core.multidimensional', 'sympy.assumptions', 'sympy.assumptions.assume', 'sympy.assumptions.ask', 'sympy.assumptions.ask_generated', 'sympy.assumptions.refine', 'sympy.polys', 'sympy.polys.polytools', 'sympy.polys.polyoptions', 'sympy.polys.polyerrors', 'sympy.polys.constructor', 'sympy.polys.domains', 'sympy.polys.domains.domain', 'sympy.polys.domains.domainelement', 'sympy.polys.orderings', 'sympy.polys.polyutils', 'sympy.polys.domains.finitefield', 'sympy.polys.domains.field', 'sympy.polys.domains.ring', 'sympy.polys.domains.groundtypes', 'sympy.polys.domains.pythonrational', 'sympy.printing', 'sympy.printing.pretty', 'sympy.printing.pretty.pretty', 'sympy.printing.conventions', 'sympy.printing.precedence', 'sympy.printing.printer', 'sympy.printing.str', 'sympy.printing.pretty.stringpict', 'sympy.printing.pretty.pretty_symbology', 'sympy.core.alphabets', 'sympy.printing.latex', 'sympy.printing.mathml', 'sympy.printing.python', 'sympy.printing.repr', 'sympy.printing.pycode', 'sympy.printing.codeprinter', 'sympy.codegen', 'sympy.codegen.ast', 'sympy.printing.ccode', 'sympy.sets', 'sympy.sets.sets', 'sympy.sets.contains', 'sympy.sets.fancysets', 'sympy.sets.conditionset', 'sympy.sets.ordinals', 'sympy.printing.glsl', 'sympy.printing.cxxcode', 'sympy.printing.fcode', 'sympy.codegen.fnodes', 'sympy.printing.rcode', 'sympy.printing.jscode', 'sympy.printing.julia', 'sympy.printing.mathematica', 'sympy.printing.octave', 'sympy.printing.rust', 'sympy.printing.gtk', 'sympy.printing.preview', 'sympy.printing.tree', 'sympy.printing.tableform', 'sympy.printing.dot', 'sympy.printing.defaults', 'sympy.polys.domains.modularinteger', 'sympy.polys.domains.simpledomain', 'sympy.polys.domains.integerring', 'sympy.polys.domains.characteristiczero', 'sympy.polys.domains.rationalfield', 'sympy.polys.domains.realfield', 'sympy.polys.domains.mpelements', 'sympy.polys.domains.complexfield', 'sympy.polys.domains.pythonfinitefield', 'sympy.polys.domains.pythonintegerring', 'sympy.polys.domains.gmpyfinitefield', 'sympy.polys.domains.gmpyintegerring', 'sympy.polys.domains.pythonrationalfield', 'sympy.polys.domains.gmpyrationalfield', 'sympy.polys.domains.algebraicfield', 'sympy.polys.polyclasses', 'sympy.polys.densebasic', 'sympy.polys.monomials', 'sympy.polys.densearith', 'sympy.polys.densetools', 'sympy.polys.euclidtools', 'sympy.ntheory', 'sympy.ntheory.generate', 'sympy.ntheory.primetest', 'sympy.ntheory.factor_', 'sympy.ntheory.partitions_', 'sympy.ntheory.residue_ntheory', 'sympy.ntheory.multinomial', 'sympy.ntheory.continued_fraction', 'sympy.ntheory.egyptian_fraction', 'sympy.polys.galoistools', 'sympy.polys.polyconfig', 'sympy.polys.sqfreetools', 'sympy.polys.factortools', 'sympy.polys.rootisolation', 'sympy.polys.domains.polynomialring', 'sympy.polys.domains.compositedomain', 'sympy.polys.domains.fractionfield', 'sympy.polys.domains.expressiondomain', 'sympy.polys.fglmtools', 'sympy.polys.groebnertools', 'sympy.polys.rationaltools', 'sympy.polys.polyfuncs', 'sympy.functions', 'sympy.functions.combinatorial', 'sympy.functions.combinatorial.factorials', 'sympy.functions.combinatorial.numbers', 'sympy.functions.elementary', 'sympy.functions.elementary.complexes', 'sympy.functions.elementary.exponential', 'sympy.functions.elementary.integers', 'sympy.functions.elementary.miscellaneous', 'sympy.functions.elementary.piecewise', 'sympy.functions.elementary.trigonometric', 'sympy.functions.elementary.hyperbolic', 'sympy.utilities.memoization', 'sympy.functions.special', 'sympy.functions.special.gamma_functions', 'sympy.functions.special.zeta_functions', 'sympy.functions.special.error_functions', 'sympy.functions.special.hyper', 'sympy.functions.special.tensor_functions', 'sympy.functions.special.delta_functions', 'sympy.functions.special.elliptic_integrals', 'sympy.functions.special.beta_functions', 'sympy.functions.special.mathieu_functions', 'sympy.functions.special.singularity_functions', 'sympy.functions.special.polynomials', 'sympy.polys.orthopolys', 'sympy.functions.special.bsplines', 'sympy.functions.special.bessel', 'sympy.functions.special.spherical_harmonics', 'sympy.polys.specialpolys', 'sympy.polys.rings', 'sympy.polys.compatibility', 'sympy.polys.heuristicgcd', 'sympy.utilities.magic', 'sympy.polys.numberfields', 'sympy.polys.ring_series', 'sympy.polys.rootoftools', 'sympy.polys.polyroots', 'sympy.polys.polyquinticconst', 'sympy.simplify', 'sympy.simplify.simplify', 'sympy.simplify.combsimp', 'sympy.simplify.gammasimp', 'sympy.simplify.cse_opts', 'sympy.simplify.powsimp', 'sympy.simplify.radsimp', 'sympy.simplify.sqrtdenest', 'sympy.simplify.trigsimp', 'sympy.simplify.cse_main', 'sympy.strategies', 'sympy.strategies.rl', 'sympy.strategies.util', 'sympy.strategies.traverse', 'sympy.strategies.core', 'sympy.strategies.tools', 'sympy.strategies.branch', 'sympy.strategies.branch.traverse', 'sympy.strategies.branch.core', 'sympy.strategies.branch.tools', 'sympy.strategies.tree', 'sympy.simplify.fu', 'sympy.simplify.traversaltools', 'sympy.simplify.epathtools', 'sympy.simplify.hyperexpand', 'sympy.series', 'sympy.series.order', 'sympy.series.limits', 'sympy.simplify.ratsimp', 'sympy.series.gruntz', 'sympy.series.series', 'sympy.series.approximants', 'sympy.series.residues', 'sympy.series.sequences', 'sympy.tensor', 'sympy.tensor.indexed', 'sympy.tensor.index_methods', 'sympy.tensor.array', 'sympy.tensor.array.dense_ndim_array', 'sympy.tensor.array.mutable_ndim_array', 'sympy.tensor.array.ndim_array', 'sympy.tensor.array.sparse_ndim_array', 'sympy.tensor.array.arrayop', 'sympy.series.fourier', 'sympy.series.series_class', 'sympy.series.formal', 'sympy.series.limitseq', 'sympy.printing.lambdarepr', 'sympy.polys.partfrac', 'sympy.matrices', 'sympy.matrices.common', 'sympy.matrices.dense', 'sympy.matrices.matrices', 'sympy.matrices.sparse', 'sympy.matrices.immutable', 'sympy.matrices.expressions', 'sympy.matrices.expressions.slice', 'sympy.matrices.expressions.matexpr', 'sympy.matrices.expressions.matmul', 'sympy.matrices.expressions.transpose', 'sympy.matrices.expressions.matpow', 'sympy.matrices.expressions.matadd', 'sympy.matrices.expressions.inverse', 'sympy.matrices.expressions.blockmatrix', 'sympy.matrices.expressions.trace', 'sympy.matrices.expressions.determinant', 'sympy.matrices.expressions.funcmatrix', 'sympy.matrices.expressions.adjoint', 'sympy.matrices.expressions.hadamard', 'sympy.matrices.expressions.diagonal', 'sympy.matrices.expressions.dotproduct', 'sympy.matrices.expressions.kronecker', 'sympy.polys.fields', 'sympy.concrete', 'sympy.concrete.products', 'sympy.concrete.expr_with_intlimits', 'sympy.concrete.expr_with_limits', 'sympy.concrete.summations', 'sympy.calculus', 'sympy.calculus.euler', 'sympy.calculus.singularities', 'sympy.solvers', 'sympy.solvers.solvers', 'sympy.integrals', 'sympy.integrals.integrals', 'sympy.integrals.manualintegrate', 'sympy.integrals.trigonometry', 'sympy.integrals.meijerint', 'sympy.integrals.transforms', 'sympy.solvers.inequalities', 'sympy.integrals.singularityfunctions', 'sympy.solvers.polysys', 'sympy.solvers.bivariate', 'sympy.solvers.diophantine', 'sympy.solvers.solveset', 'sympy.calculus.util', 'sympy.tensor.tensor', 'sympy.combinatorics', 'sympy.combinatorics.permutations', 'sympy.combinatorics.prufer', 'sympy.combinatorics.generators', 'sympy.combinatorics.subsets', 'sympy.combinatorics.graycode', 'sympy.combinatorics.partitions', 'sympy.combinatorics.polyhedron', 'sympy.combinatorics.perm_groups', 'sympy.combinatorics.util', 'sympy.utilities.randtest', 'sympy.combinatorics.group_constructs', 'sympy.combinatorics.named_groups', 'sympy.combinatorics.tensor_can', 'sympy.solvers.recurr', 'sympy.solvers.ode', 'sympy.solvers.pde', 'sympy.solvers.deutils', 'sympy.solvers.decompogen', 'sympy.calculus.finite_diff', 'sympy.concrete.gosper', 'sympy.discrete', 'sympy.discrete.transforms', 'sympy.discrete.convolutions', 'sympy.geometry', 'sympy.geometry.point', 'sympy.geometry.exceptions', 'sympy.geometry.entity', 'sympy.multipledispatch', 'sympy.multipledispatch.core', 'sympy.multipledispatch.dispatcher', 'sympy.multipledispatch.conflict', 'sympy.multipledispatch.utils', 'sympy.sets.handlers', 'sympy.sets.handlers.union', 'sympy.sets.handlers.intersection', 'sympy.geometry.line', 'sympy.geometry.plane', 'sympy.geometry.ellipse', 'sympy.geometry.util', 'sympy.geometry.polygon', 'sympy.geometry.curve', 'sympy.geometry.parabola', 'sympy.parsing', 'sympy.algebras', 'sympy.algebras.quaternion', 'sympy.plotting', 'sympy.plotting.plot', 'sympy.plotting.experimental_lambdify', 'sympy.plotting.textplot', 'sympy.plotting.plot_implicit', 'sympy.plotting.intervalmath', 'sympy.plotting.intervalmath.interval_arithmetic', 'sympy.plotting.intervalmath.lib_interval', 'sympy.plotting.pygletplot', 'sympy.interactive', 'sympy.interactive.printing', 'sympy.interactive.session', 'sympy.deprecated', 'sympy.deprecated.class_registry', 'chempy.util._expr_deprecated', 'chempy.util.periodic', 'chempy.util.parsing', 'chempy.units', 'quantities', 'quantities._version', 'quantities.registry', 'quantities.quantity', 'numpy', 'numpy._globals', 'numpy.__config__', 'numpy.version', 'numpy._distributor_init', 'numpy.core', 'numpy.core.info', 'numpy.core.multiarray', 'numpy.core.overrides', 'numpy.core._multiarray_umath', 'numpy.compat', 'numpy.compat._inspect', 'numpy.compat.py3k', 'numpy.core.umath', 'numpy.core.numerictypes', 'numpy.core._string_helpers', 'numpy.core._type_aliases', 'numpy.core._dtype', 'numpy.core.numeric', 'numpy.core._internal', 'numpy.core.fromnumeric', 'numpy.core._methods', 'numpy.core.arrayprint', 'numpy.core.defchararray', 'numpy.core.records', 'numpy.core.memmap', 'numpy.core.function_base', 'numpy.core.machar', 'numpy.core.getlimits', 'numpy.core.shape_base', 'numpy.core.einsumfunc', 'numpy.core._add_newdocs', 'numpy.core._multiarray_tests', 'numpy.core._dtype_ctypes', 'numpy._pytesttester', 'numpy.lib', 'numpy.lib.info', 'numpy.lib.type_check', 'numpy.lib.ufunclike', 'numpy.lib.index_tricks', 'numpy.matrixlib', 'numpy.matrixlib.defmatrix', 'numpy.linalg', 'numpy.linalg.info', 'numpy.linalg.linalg', 'numpy.lib.twodim_base', 'numpy.linalg.lapack_lite', 'numpy.linalg._umath_linalg', 'numpy.lib.function_base', 'numpy.lib.utils', 'numpy.lib.histograms', 'numpy.lib.stride_tricks', 'numpy.lib.mixins', 'numpy.lib.nanfunctions', 'numpy.lib.shape_base', 'numpy.lib.scimath', 'numpy.lib.polynomial', 'numpy.lib.arraysetops', 'numpy.lib.npyio', 'numpy.lib.format', 'numpy.lib._datasource', 'numpy.lib._iotools', 'numpy.lib.financial', 'numpy.lib.arrayterator', 'numpy.lib.arraypad', 'numpy.lib._version', 'numpy.fft', 'numpy.fft.info', 'numpy.fft.fftpack', 'numpy.fft.fftpack_lite', 'numpy.fft.helper', 'numpy.polynomial', 'numpy.polynomial.polynomial', 'numpy.polynomial.polyutils', 'numpy.polynomial._polybase', 'numpy.polynomial.chebyshev', 'numpy.polynomial.legendre', 'numpy.polynomial.hermite', 'numpy.polynomial.hermite_e', 'numpy.polynomial.laguerre', 'numpy.random', 'numpy.random.mtrand', 'mtrand', 'numpy.ctypeslib', 'numpy.ma', 'numpy.ma.core', 'numpy.ma.extras', 'numpy.testing', 'numpy.testing._private', 'numpy.testing._private.utils', 'numpy.testing._private.decorators', 'numpy.testing._private.nosetester', 'quantities.markup', 'quantities.dimensionality', 'quantities.decorators', 'quantities.uncertainquantity', 'quantities.unitquantity', 'quantities.units', 'quantities.units.prefixes', 'quantities.units.acceleration', 'quantities.units.time', 'quantities.units.length', 'quantities.units.angle', 'quantities.units.area', 'quantities.units.compound', 'quantities.units.concentration', 'quantities.units.substance', 'quantities.units.volume', 'quantities.units.dimensionless', 'quantities.units.electromagnetism', 'quantities.units.energy', 'quantities.units.force', 'quantities.units.mass', 'quantities.units.velocity', 'quantities.units.frequency', 'quantities.units.heat', 'quantities.units.temperature', 'quantities.units.power', 'quantities.units.information', 'quantities.units.pressure', 'quantities.units.radiation', 'quantities.units.viscosity', 'quantities.constants', 'quantities.constants.alpha', 'quantities.constants._utils', 'quantities.constants._codata', 'quantities.constants.astronomy', 'quantities.constants.atomicunits', 'quantities.constants.deuteron', 'quantities.constants.electromagnetism', 'quantities.constants.electron', 'quantities.constants.helion', 'quantities.constants.mathematical', 'quantities.constants.muon', 'quantities.constants.naturalunits', 'quantities.constants.neutron', 'quantities.constants.proton', 'quantities.constants.quantum', 'quantities.constants.relationships', 'quantities.constants.statisticalmechanics', 'quantities.constants.tau', 'quantities.constants.triton', 'quantities.constants.weak', 'quantities.constants.xray', 'quantities.umath', 'chempy.util._quantities', 'chempy._util', 'chempy.reactionsystem', 'chempy.henry', 'chempy.kinetics', 'chempy.kinetics.rates', 'chempy.util._dimensionality', 'chempy.kinetics.eyring', 'chempy.util.regression', 'chempy.printing', 'chempy.printing.numbers', 'chempy.printing.table', 'chempy.printing.js', 'chempy.printing.web', 'chempy.printing.string', 'chempy.printing.printer', 'chempy.printing.pretty', 'chempy.printing.tex', 'chempy.kinetics.arrhenius', 'chempy.kinetics.ode', 'chempy.kinetics._native', 'pyodesys', 'pyodesys._release', 'pyodesys.core', 'pyodesys.plotting', 'pyodesys.results', 'pyodesys.util', 'pkg_resources', 'zipfile', 'plistlib', 'xml.parsers', 'xml.parsers.expat', 'pyexpat.errors', 'pyexpat.model', 'pyexpat', 'xml.parsers.expat.model', 'xml.parsers.expat.errors', 'pkg_resources.extern', 'pkg_resources._vendor', 'pkg_resources.extern.six', 'pkg_resources._vendor.six', 'pkg_resources.extern.six.moves', 'pkg_resources._vendor.six.moves', 'pkg_resources.py31compat', 'pkg_resources.extern.appdirs', 'pkg_resources._vendor.packaging.__about__', 'pkg_resources.extern.packaging', 'pkg_resources.extern.packaging.version', 'pkg_resources.extern.packaging._structures', 'pkg_resources.extern.packaging.specifiers', 'pkg_resources.extern.packaging._compat', 'pkg_resources.extern.packaging.requirements', 'pkg_resources.extern.pyparsing', 'pkg_resources.extern.six.moves.urllib', 'pkg_resources.extern.packaging.markers', 'pytest', '_pytest', '_pytest._version', '_pytest.assertion', '_pytest.assertion.rewrite', 'atomicwrites', 'py', 'py._error', 'py.error', 'py._vendored_packages', 'py._vendored_packages.apipkg', 'py._version', 'py.test', 'py.process', 'py.apipkg', 'py.iniconfig', 'py.path', 'py.code', 'py.builtin', 'py.io', 'py.xml', 'py.log', '_pytest._io', '_pytest._io.saferepr', '_pytest.assertion.util', '_pytest._code', '_pytest._code.code', 'attr', 'attr.converters', 'attr._make', 'attr._config', 'attr._compat', 'attr.exceptions', 'attr.filters', 'attr.validators', 'attr._funcs', 'pluggy', 'pluggy._version', 'pluggy.manager', 'pluggy._tracing', 'pluggy.callers', 'pluggy.hooks', '_pytest.compat', '_pytest.outcomes', 'py._path', 'py._path.local', 'py._path.common', '_pytest._code.source', '_pytest.pathlib', '_pytest.assertion.truncate', '_pytest.config', '_pytest.hookspec', '_pytest.deprecated', '_pytest.warning_types', '_pytest.config.exceptions', '_pytest.config.findpaths', '_pytest.debugging', '_pytest.fixtures', '_pytest.nodes', '_pytest.mark', '_pytest.mark.legacy', '_pytest.mark.structures', '_pytest.freeze_support', '_pytest.main', '_pytest.runner', '_pytest.reports', '_pytest.python', '_pytest.python_api', 'more_itertools', 'more_itertools.more', 'more_itertools.recipes', '_pytest.recwarn', 'scipy', 'scipy._distributor_init', 'scipy.__config__', 'scipy.version', 'scipy._lib', 'scipy._lib._testutils', 'scipy._lib._version', 'scipy._lib.six', 'scipy._lib._ccallback', 'scipy._lib._ccallback_c', 'scipy.interpolate', 'scipy.interpolate.interpolate', 'scipy.linalg', 'scipy.linalg.linalg_version', 'scipy.linalg.misc', 'scipy.linalg.blas', 'scipy.linalg._fblas', 'scipy.linalg.lapack', 'scipy.linalg._flapack', 'scipy._lib._util', 'scipy.linalg.basic', 'scipy.linalg.flinalg', 'scipy.linalg._flinalg', 'scipy.linalg.decomp', 'scipy.linalg.decomp_svd', 'scipy.linalg._solve_toeplitz', '_cython_0_29', 'scipy.linalg.decomp_lu', 'scipy.linalg._decomp_ldl', 'scipy.linalg.decomp_cholesky', 'scipy.linalg.decomp_qr', 'scipy.linalg._decomp_qz', 'scipy.linalg.decomp_schur', 'scipy.linalg._decomp_polar', 'scipy.linalg.matfuncs', 'scipy.linalg.special_matrices', 'scipy.linalg._expm_frechet', 'scipy.linalg._matfuncs_sqrtm', 'scipy.linalg._solvers', 'scipy.linalg._procrustes', 'scipy.linalg._decomp_update', 'scipy.linalg.cython_blas', 'scipy.linalg.cython_lapack', 'scipy.linalg._sketches', 'numpy.dual', 'scipy.special', 'scipy.special.sf_error', 'scipy.special._ufuncs', 'scipy.special._ufuncs_cxx', 'scipy.special.basic', 'scipy.special.specfun', 'scipy.special.orthogonal', 'scipy.special._comb', 'scipy.special._logsumexp', 'scipy.special.spfun_stats', 'scipy.special._ellip_harm', 'scipy.special._ellip_harm_2', 'scipy.special.lambertw', 'scipy.special._spherical_bessel', 'scipy.interpolate.fitpack', 'scipy.interpolate._fitpack_impl', 'scipy.interpolate._fitpack', 'scipy.interpolate.dfitpack', 'scipy.interpolate._bsplines', 'scipy.interpolate._bspl', 'scipy.interpolate.polyint', 'scipy.interpolate._ppoly', 'scipy.interpolate.fitpack2', 'scipy.interpolate.interpnd', 'scipy.spatial', 'scipy.spatial.kdtree', 'scipy.sparse', 'scipy.sparse.base', 'scipy._lib._numpy_compat', 'scipy.sparse.sputils', 'scipy.sparse.csr', 'scipy.sparse._sparsetools', 'scipy.sparse.compressed', 'scipy.sparse.data', 'scipy.sparse.dia', 'scipy.sparse.csc', 'scipy.sparse.lil', 'scipy.sparse._csparsetools', 'scipy.sparse.dok', 'scipy.sparse.coo', 'scipy.sparse.bsr', 'scipy.sparse.construct', 'scipy.sparse.extract', 'scipy.sparse._matrix_io', 'scipy.sparse.csgraph', 'scipy.sparse.csgraph._laplacian', 'scipy.sparse.csgraph._shortest_path', 'scipy.sparse.csgraph._validation', 'scipy.sparse.csgraph._tools', 'scipy.sparse.csgraph._traversal', 'scipy.sparse.csgraph._min_spanning_tree', 'scipy.sparse.csgraph._reordering', 'scipy.spatial.ckdtree', 'scipy.spatial.qhull', 'scipy._lib.messagestream', 'scipy.spatial._spherical_voronoi', 'scipy.spatial._voronoi', 'scipy.spatial.distance', 'scipy.spatial._distance_wrap', 'scipy.spatial._hausdorff', 'scipy.spatial._plotutils', 'scipy._lib.decorator', 'scipy.spatial._procrustes', 'scipy.spatial.transform', 'scipy.spatial.transform.rotation', 'scipy.interpolate.rbf', 'scipy.interpolate._cubic', 'scipy.interpolate.ndgriddata', 'scipy.interpolate._pade', 'pyodesys.native', 'pyodesys.native.cvode', 'pyodesys.native._base', 'pyodesys.symbolic', 'sym', 'sym._release', 'sym.backend', 'sym.util', 'appdirs', 'pycodeexport', 'pycodeexport._release', 'pycodeexport.dist', 'pycompilation', 'pycompilation._release', 'pycompilation.compilation', 'pycompilation.util', 'pycompilation.runners', 'distutils.sysconfig', 'distutils.errors', 'pycompilation.dist', 'distutils.command', 'distutils.command.build_ext', 'distutils.core', 'distutils.debug', 'distutils.dist', 'distutils.fancy_getopt', 'distutils.util', 'distutils.dep_util', 'distutils.spawn', 'distutils.log', 'distutils.cmd', 'distutils.dir_util', 'distutils.file_util', 'distutils.archive_util', 'distutils.config', 'configparser', 'distutils.extension', 'distutils.command.sdist', 'distutils.text_file', 'distutils.filelist', 'pycodeexport.util', 'pycodeexport.codeexport', 'pycvodes', 'pycvodes._cvodes', 'pycvodes._util', 'pycvodes._release', 'pycvodes._config', 'pyodesys.native.gsl', 'pygslodeiv2', 'pygslodeiv2._gsl_odeiv2', 'pygslodeiv2._util', 'pygslodeiv2._release', 'pygslodeiv2._config', 'pyodesys.native.odeint', 'pyodeint', 'pyodeint._odeint', 'pyodeint._util', 'pyodeint._release', 'pyodesys.native.util', 'matplotlib', 'matplotlib.cbook', 'gzip', 'matplotlib.cbook.deprecation', 'matplotlib.rcsetup', 'matplotlib.fontconfig_pattern', 'pyparsing', 'matplotlib.colors', 'matplotlib._color_data', 'cycler', 'matplotlib._version']
DEBUG:matplotlib:CACHEDIR=/root/.cache/matplotlib
DEBUG:matplotlib.font_manager:Using fontManager instance from /root/.cache/matplotlib/fontlist-v300.json
DEBUG:matplotlib.pyplot:Loaded backend module://ipykernel.pylab.backend_inline version unknown.
DEBUG:matplotlib.pyplot:Loaded backend module://ipykernel.pylab.backend_inline version unknown.
DEBUG:matplotlib.pyplot:Loaded backend module://ipykernel.pylab.backend_inline version unknown.

Next we define our what reactions are taking place:

In [2]:
rsys = ReactionSystem.from_string("""
A -> B; 'k1'
B + C -> P; 'k2'
""", substance_factory=Substance)
rsys
Out[2]:
AB MassAction((Symbol((), ('k1',)),))
B + CP MassAction((Symbol((), ('k2',)),))

From this reactionsystem we generate a system of ordinary differential equations:

In [3]:
odesys, extra = get_odesys(rsys, include_params=False, unit_registry=SI_base_registry,
                           output_conc_unit=u.micromolar, output_time_unit=u.minute)

Not that it is strictly needed for this simple system, but since we are using pyodesys, we can generate C++ code which is compiled to a native extension module:

In [4]:
native = get_native(rsys, odesys, 'cvode')

We will use ipywidgets for our interactive controls:

In [5]:
def integrate_and_plot(
    tend_minutes=FloatSlider(5, min=1, max=60, step=1),
    lgA0molar=FloatSlider(-6, min=-7, max=-5, step=.1),
    lgC0molar=FloatSlider(-6, min=-7, max=-5, step=.1),
    k1_per_min=FloatSlider(5.8, min=1.0, max=20.0, step=0.1),
    k2_per_M_per_s=FloatSlider(4000, min=500, max=16000, step=500)
):
    result = native.integrate(tend_minutes*u.minute, defaultdict(lambda: 0*u.M, {'A': 10**lgA0molar*u.M, 'C': 10**lgC0molar*u.M}),
                              {'k1': k1_per_min/u.minute, 'k2': k2_per_M_per_s/u.M/u.s}, integrator='cvode')
    result.plot(title_info=2)

Try exploring the system by adjusting the parameter sliders below:

In [6]:
interact(integrate_and_plot)
INFO:pyodesys.native._base:In "/tmp/tmpkfsmtwur_pycodeexport_pyodesys_NativeCvodeCode", executing:
"/usr/bin/g++ -c -std=c++11 -Wall -Wextra -fPIC -O2 -ffast-math -funroll-loops -fopenmp -o ./odesys_anyode.o -DPYCVODES_NO_KLU=1 -DPYCVODES_NO_LAPACK=0 -DANYODE_NO_LAPACK=0 -I/usr/local/lib/python3.6/dist-packages/numpy/core/include -I/drone/src/ci_cache/pyusrb/lib/python3.6/site-packages/pyodesys/native/sources -I/drone/src/ci_cache/pyusrb/lib/python3.6/site-packages/pycvodes/include odesys_anyode.cpp"
INFO:pyodesys.native._base:In "/tmp/tmpkfsmtwur_pycodeexport_pyodesys_NativeCvodeCode", executing:
"/usr/bin/g++ -pthread -shared -std=c++11 -Wall -Wextra -fPIC -O2 -ffast-math -funroll-loops -fopenmp -o /tmp/tmpkfsmtwur_pycodeexport_pyodesys_NativeCvodeCode/_cvode_wrapper.cpython-36m-x86_64-linux-gnu.so -DPYCVODES_NO_KLU=1 -DPYCVODES_NO_LAPACK=0 -DANYODE_NO_LAPACK=0 -I/usr/local/lib/python3.6/dist-packages/numpy/core/include -I/drone/src/ci_cache/pyusrb/lib/python3.6/site-packages/pyodesys/native/sources -I/drone/src/ci_cache/pyusrb/lib/python3.6/site-packages/pycvodes/include odesys_anyode.o _cvode_wrapper.o -lsundials_nvecserial -lsundials_cvodes -lsundials_sunlinsollapackdense -lsundials_sunlinsollapackband -lblas -llapack -lpython3.6m"
DEBUG:matplotlib.axes._base:update_title_pos
DEBUG:matplotlib.font_manager:findfont: Matching :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0 to DejaVu Sans ('/usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSans.ttf') with score of 0.050000.
DEBUG:matplotlib.font_manager:findfont: Matching :family=STIXGeneral:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0 to STIXGeneral ('/usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf/STIXGeneral.ttf') with score of 0.050000.
DEBUG:matplotlib.font_manager:findfont: Matching :family=STIXGeneral:style=italic:variant=normal:weight=normal:stretch=normal:size=10.0 to STIXGeneral ('/usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf/STIXGeneralItalic.ttf') with score of 0.050000.
DEBUG:matplotlib.font_manager:findfont: Matching :family=STIXGeneral:style=normal:variant=normal:weight=bold:stretch=normal:size=10.0 to STIXGeneral ('/usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf/STIXGeneralBol.ttf') with score of 0.000000.
DEBUG:matplotlib.font_manager:findfont: Matching :family=STIXNonUnicode:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0 to STIXNonUnicode ('/usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUni.ttf') with score of 0.050000.
DEBUG:matplotlib.font_manager:findfont: Matching :family=STIXNonUnicode:style=italic:variant=normal:weight=normal:stretch=normal:size=10.0 to STIXNonUnicode ('/usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUniIta.ttf') with score of 0.050000.
DEBUG:matplotlib.font_manager:findfont: Matching :family=STIXNonUnicode:style=normal:variant=normal:weight=bold:stretch=normal:size=10.0 to STIXNonUnicode ('/usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUniBol.ttf') with score of 0.000000.
DEBUG:matplotlib.font_manager:findfont: Matching :family=STIXSizeOneSym:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0 to STIXSizeOneSym ('/usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf/STIXSizOneSymReg.ttf') with score of 0.050000.
DEBUG:matplotlib.font_manager:findfont: Matching :family=STIXSizeTwoSym:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0 to STIXSizeTwoSym ('/usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf/STIXSizTwoSymReg.ttf') with score of 0.050000.
DEBUG:matplotlib.font_manager:findfont: Matching :family=STIXSizeThreeSym:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0 to STIXSizeThreeSym ('/usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf/STIXSizThreeSymReg.ttf') with score of 0.050000.
DEBUG:matplotlib.font_manager:findfont: Matching :family=STIXSizeFourSym:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0 to STIXSizeFourSym ('/usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf/STIXSizFourSymReg.ttf') with score of 0.050000.
DEBUG:matplotlib.font_manager:findfont: Matching :family=STIXSizeFiveSym:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0 to STIXSizeFiveSym ('/usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf/STIXSizFiveSymReg.ttf') with score of 0.050000.
DEBUG:matplotlib.font_manager:findfont: Matching :family=cmsy10:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0 to cmsy10 ('/usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf/cmsy10.ttf') with score of 0.050000.
DEBUG:matplotlib.font_manager:findfont: Matching :family=cmr10:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0 to cmr10 ('/usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf/cmr10.ttf') with score of 0.050000.
DEBUG:matplotlib.font_manager:findfont: Matching :family=cmtt10:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0 to cmtt10 ('/usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf/cmtt10.ttf') with score of 0.050000.
DEBUG:matplotlib.font_manager:findfont: Matching :family=cmmi10:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0 to cmmi10 ('/usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf/cmmi10.ttf') with score of 0.050000.
DEBUG:matplotlib.font_manager:findfont: Matching :family=cmb10:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0 to cmb10 ('/usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf/cmb10.ttf') with score of 0.050000.
DEBUG:matplotlib.font_manager:findfont: Matching :family=cmss10:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0 to cmss10 ('/usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf/cmss10.ttf') with score of 0.050000.
DEBUG:matplotlib.font_manager:findfont: Matching :family=cmex10:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0 to cmex10 ('/usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf/cmex10.ttf') with score of 0.050000.
DEBUG:matplotlib.font_manager:findfont: Matching :family=DejaVu Sans:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0 to DejaVu Sans ('/usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSans.ttf') with score of 0.050000.
DEBUG:matplotlib.font_manager:findfont: Matching :family=DejaVu Sans:style=italic:variant=normal:weight=normal:stretch=normal:size=10.0 to DejaVu Sans ('/usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSans-Oblique.ttf') with score of 0.150000.
DEBUG:matplotlib.font_manager:findfont: Matching :family=DejaVu Sans:style=normal:variant=normal:weight=bold:stretch=normal:size=10.0 to DejaVu Sans ('/usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSans-Bold.ttf') with score of 0.000000.
DEBUG:matplotlib.font_manager:findfont: Matching :family=DejaVu Sans Mono:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0 to DejaVu Sans Mono ('/usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSansMono.ttf') with score of 0.050000.
DEBUG:matplotlib.font_manager:findfont: Matching :family=DejaVu Sans Display:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0 to DejaVu Sans Display ('/usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSansDisplay.ttf') with score of 0.050000.
DEBUG:matplotlib.axes._base:update_title_pos
DEBUG:matplotlib.axes._base:update_title_pos
DEBUG:matplotlib.axes._base:update_title_pos
Out[6]:
<function __main__.integrate_and_plot(tend_minutes=FloatSlider(value=5.0, description='tend_minutes', max=60.0, min=1.0, step=1.0), lgA0molar=FloatSlider(value=-6.0, description='lgA0molar', max=-5.0, min=-7.0), lgC0molar=FloatSlider(value=-6.0, description='lgC0molar', max=-5.0, min=-7.0), k1_per_min=FloatSlider(value=5.8, description='k1_per_min', max=20.0, min=1.0), k2_per_M_per_s=FloatSlider(value=4000.0, description='k2_per_M_per_s', max=16000.0, min=500.0, step=500.0))>