Skip to content

Repository files navigation

docs/source/_static/images/logo/logo_nskinetics_light_white-circle.png

The (Non-)Steady state Kinetics simulation package (NSKinetics)

Version_status Documentation license Supported_versions https://coveralls.io/repos/github/sarangbhagwat/nskinetics/badge.svg?cachebuster=202507072

Contents

NSKinetics is a fast, flexible, and convenient package in Python for simulating steady- and non-steady-state reaction kinetics — including microbial fermentation and enzyme kinetics — and connecting them to techno-economic analysis (TEA) and life-cycle assessment (LCA) under uncertainty. Kinetic models are declared as SBML — most easily authored as Antimony text, or imported from an existing SBML file — and wrapped in a KineticModel, which adds unit-aware value access and a Python event API on top of a Tellurium RoadRunner engine that performs the actual ODE integration. Event covers a single trigger/assignment pair (a parameter switch, a control action); the higher-level FeedSpike builds on it for fed-batch feeding, topping a species back up to a target concentration whenever it drops below a threshold. The same kinetic model can then drive a BioSTEAM process unit through the NSKBatchReactor bridge, coupling kinetics directly to TEA.

Get the latest version of NSKinetics from PyPI. If you have an installation of Python with pip, simply install it with:

$ pip install nskinetics

To get the git version, run:

$ git clone https://github.com/sarangbhagwat/nskinetics

For help on common installation issues, please visit the documentation.

NSKinetic's full documentation includes a staged tutorial, starting from a minimal model and building up to a full process/TEA-coupled fed-batch fermentation. The interactive quickstart demo below runs that full picture end to end.

One factory call builds a complete, industrially configured process around a real kinetic model: nskinetics.processes.create_sugar_prep_and_fermentation_system assembles the sugar-solution preparation and fed-batch fermentation section of an actual biorefinery model — a splitter feeding parallel initial-feed and spike-feed conditioning trains (multi-effect evaporator, pumps, dilution-water mixer, heat exchanger), a FermentationSaccharomycesEthanolIsobutanol fermentor driven by the shipped S. cerevisiae kinetic model, and a compressed-air aeration loop. The complete biorefinery built around this section ships with NSKinetics as the isobutanol biorefinery case study. This example runs the section end to end: build, simulate, change the fed-batch strategy, and inspect the reactor. Total simulation time is a few seconds once the imports are loaded; the ~1-minute interactive demo below plays through the whole thing, showing real output at every step:

Watch the NSKinetics quickstart run — a ~1-minute interactive demo

▶ Watch the quickstart run end to end — a ~1-minute interactive demo (build, simulate, re-tune, inspect).

See the full tutorial for the full walkthrough — writing and simulating a kinetic model from scratch, the Event/FeedSpike API used inside the fermentor, a tour of the shipped S. cerevisiae kinetic model, and the kinetics-to-biosteam bridge behind V406.

NSKinetics ships a complete corn dry-grind biorefinery as a case study, nskinetics.biorefineries.isobutanol: a BioSTEAM flowsheet whose fermentor runs the shipped S. cerevisiae fed-batch model with an engineered isobutanol pathway, so titer, rate and yield are outputs of the strain kinetics and the feeding policy rather than inputs to the techno-economic analysis. It comes with ten scenarios (the wild-type ethanol plant, an engineered ethanol + isobutanol co-producer and eight strain-design optima), its TEA, and the scripts behind its feeding-strategy and kinetic sweeps, Bayesian strain-design optimization, objective-landscape, enzyme-burden (proteome allocation), global sensitivity and uncertainty analyses.

The case study needs NSKinetics 0.7.0 or later, the first release that ships nskinetics.biorefineries; earlier releases do not include it. Until 0.7.0 is on PyPI, install it from source, with its optional isobutanol dependencies, and check the installation with a pinned smoke case (a few minutes):

$ git clone https://github.com/sarangbhagwat/nskinetics
$ cd nskinetics
$ git checkout dev
$ pip install -e ".[isobutanol]"
$ python -m nskinetics.biorefineries.isobutanol.smoke 1

Once 0.7.0 is on PyPI, pip install "nskinetics[isobutanol]>=0.7.0" installs the same package and dependencies. Running the analyses has the full installation instructions (including the validated dependency versions) and lists every analysis script, its runtime and its outputs; the case study documentation presents the findings.

To report bugs, please use NSKinetics's Bug Tracker at:

https://github.com/sarangbhagwat/nskinetics

For guidelines on how to contribute, visit:

[link to be added]

See LICENSE.txt for information on the terms & conditions for usage of this software, and a DISCLAIMER OF ALL WARRANTIES.

Although not required by the NSKinetics license, if it is convenient for you, please cite NSKinetics if used in your work. Please also consider contributing any changes you make back, and benefit the community.

NSKinetics was created and developed by Sarang S. Bhagwat as part of the Scown Group and the Energy & Biosciences Institute at the University of California, Berkeley (UC Berkeley).

[1]` To be added <link to be added>`__.