Skip to content

Tutorial for BPTK-Py, the Python simulation engine for System Dynamics & Agent based models.

Notifications You must be signed in to change notification settings

poorejc/bptk_py_tutorial

 
 

Repository files navigation

Overview Of The BPTK-Py Tutorial

This tutorial contain sample agent-based and System Dynamics models along with Jupyter notebooks that illustrate the features of the BPTK-Py framework. This tutorial is designed as a companion to the BPTK-Py online documentation.

Installation

Using Docker

If you have Docker installed (e.g. Docker Desktop on MacOS or on Windows), follow these steps:

  1. On the command line, move into a directory where you would like to store the BPTK-Py tutorial.
  2. Clone this repository: git clone https://github.com/transentis/bptk_py_tutorial.git
  3. Run docker-compose up
  4. Point your browser at http://localhost:8888 – this will open JupyterLab showing the contents of your directory.
  5. Open the notebook readme.ipynb from within JupyterLab.
  6. When you are finished, close your browser and call docker-compose down from within your directory. This will stop and remove the container.

Using a virtual environment

First, make sure you have Python 3 installed on your machine.

Then follow these steps:

  1. On the command line, move into a directory where you would like to store the BPTK-Py tutorial.
  2. Clone this repository: git clone https://github.com/transentis/bptk_py_tutorial.git
  3. Install a virtual environment in that directory: python3 -m venv venv
  4. Activate the virtual environment: source venv/bin/activate (MacOS/Linux) or ``venv\scripts\activate.bat``` (Windows)
  5. Install the necessary python modules: pip install -r requirements.txt
  6. Start JupyerLab: jupyter lab
  7. Your browser will open showing JupyterLab and your chosen directory
  8. Open the notebook readme.ipynb from within JupyterLab

Getting Started

This tutorial contains a number of Jupyter notebooks that illustrate usage of the BPTK-Py framework. Which one to get started with depends on whether you are interested in Agent-based modeling, in System Dynamics using XMILE (e.g. using Stella Architect or iThink) or in our domain-specific language for System Dynamics (SD DSL):

Contents

We illustrate the BPTK-Py framework using three simple models:

  • Simple Project Management Model. This model is an illustration of Parkinson's law, which states that work expands so as to fill the time available for its completion.
  • Bass Diffusion Model. This model is an implementation of the Bass diffusion model originally created by Frank Bass that describes the process of how new products get adopted in a population. The Bass model has been widely used in forecasting, especially new products' sales forecasting and technology forecasting.
  • Customer Acquisition Model. A small model about referral marketing that builds upon the Bass Diffusion Model.

Here is an overview of the documents contained in this tutorial, they all use at least one of the models listed above.

Learning More About System Dynamics and Agent-based Modeling

The main objective of this tutorial is to show you how to use the BPTK-Py framework and not to explain System Dynamics or Agent-based modeling.

For those new to dynamic modeling, we have included a small step-by-step Introduction to System Dynamics with Python.

You can also find further introductions on our blog:

Get in Touch

Please let us know if you need help getting started, if you find a bug or are missing important functionality.

We are keen to hear how you use BPTK-Py – your feedback is invaluable in helping us improve BPTK-Py.

You can best reach us per e-mail at [email protected]

About

Tutorial for BPTK-Py, the Python simulation engine for System Dynamics & Agent based models.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Jupyter Notebook 97.6%
  • Python 2.4%