Python Tools for Vensim
This package provides a pure Python wrapper to the Vensim system dynamics simulation software through the Vensim DLL. The Vensim DLL provides the ability to develop interfaces for pre-existing models by allowing access to some of the tools and functions used in the software itself.
- Provide easy access to existing Vensim functionality in Python. This will help to facilitate:
- Batch processing of simulation runs under a range of exogenously driven scenarios, parameter sets, or events.
- Incorporation of changes in model structure over time.
- Allow for the inclusion of non-existant Vensim features such as:
- Communication and data exchange with external programs through Python subprocesses.
- Easy integration of 3rd party Python libraries.
- Ability to run multiple Vensim models simultaneously and exchange data between them.
A guide for basic usage of VenPy is provided here
The goals of this project are very much in line with PySD and is in no way a replacement for this effort. In this project there is a specific focus on Vensim models through the DLL. This includes the use of all Vensim functions (depending on whether the DSS or PLE versions are installed) and features which are not available in other system dynamics simulation programs such as Stella, Simulink, MapleSim, etc.
Due to the dependence on Vensim's DLL functionality there comes a set of limitations with the project which must be kept in mind:
- The use of the Vensim DLL through this package can only support Windows (as far as I know)
- The version of Python must match the bitness of the Vensim version (which mainly provides 32-bit)
- Larger models will have the same performance limitations as the Vensim software
- Only constants and 'Gaming' type auxiliary variables can be set before and during simulations respectively
- Those who have Vensim PLE installed will only be able to modify model constants prior to simulation
- Potential compatibility issues with future versions of Vensim
- Likely more to come...
Although these limitations do exist, the Vensim DLL has been used in many successful applications to extend Vensim functionality. Some of these include the works of:
Peck, A., Neuwirth, C., Simonovic, S.P. (2014). "Coupling System Dynamics with Geographic Information Systems". Water Resources Research Report no.086, Facility for Intelligent Decision Support, Department of Civil and Environmental Engineering, London, Ontario, Canada, 81 pages. ISBN (print) 978-0-7714-3067-1; (online) 978-0-7714-3068-8.
Srivastav, R., and Simonovic, S.P. (2014). "Generic Framework for Computation of Spatial Dynamic Resilience". Water Resources Research Report no. 085, Facility for Intelligent Decision Support, Department of Civil and Environmental Engineering, London, Ontario, Canada, 81 pages. ISBN: (print) 978-0-7714-3067-1; (online) 978-0-7714-3068-8.