Skip to content

paddymul/PoieticFlows

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Poietic Flows

Systems Dynamics Modelling and simulation toolkit based on the Stock and Flow methodology.

Core functionality:

  • Creation and iterative design of stock and flow models.
  • Simulation of systems dynamics models.

Features

Current:

  • Stock and Flow model
    • Implemented nodes: Stock, Flow, Auxiliary, Graphical Function
    • Stocks can be either non-negative or can allow negative values
    • Included Euler and RK4 solvers
  • Simple arithmetic expressions (formulas)
    • Built-in functions: abs, floor, ceiling, round, power, sum, min, max
  • Whole editing history is preserved.
  • Editing is non-destructive and can be reversed using undo and redo commands.
  • Exports:

See also: PoieticCore.

Planned:

  • More useful built-in functions and variables for the Stock and Flow model.
  • Sub-systems.

Installation

To install the poietic command-line tool, run the following command in the project's top-level directory:

./install

The tool will be installed in the Swift Package Manager's' ~/.swiftpm/bin directory. Make sure you have the directory in your PATH, if you do not, then add the following to the end of your ~/.zshrc or ~/.bashrc file:

export PATH=~/.swiftpm/bin:$PATH

Examples

The examples are located in the Examples repository. Follow instructions how to run them in the documentation contained within the repository.

Documentation

Tool

At the moment, the only user-facing interface is a command-line tool called poietic. The available commands are:

  new                     Create an empty design.
  info                    Get information about the design
  list                    List all nodes and edges
  describe                Describe an object
  edit                    Edit an object or a selection of objects
  import                  Import a frame bundle into the design
  run                     Run a model
  write-dot               Write a Graphviz DOT file.
  metamodel               Show the metamodel

The edit subcommands are:

  set                     Set an attribute value
  undo                    Undo last change
  redo                    Redo undone change
  add                     Create a new node
  connect                 Create a new connection (edge) between two nodes

Use --help with the desired command to learn more.

Pseudo-REPL

Think of this tool as ed but for data represented as a graph. At least for now.

The tool is designed in a way that it is by itself interactive for a single-user. For interactivity in a shell, set the POIETIC_DATABASE environment variable to point to a file where the design is stored.

Example session:

export POIETIC_DATABASE="MyDesign.poietic"

poietic new
poietic info

poietic edit add Stock name=water formula=100
poietic edit add Flow name=outflow formula=10
poietic edit connect Drains water outflow

poietic list formulas

poietic edit add Stock name=unwanted
poietic list formulas
poietic edit undo

poietic list formulas

poietic run

Author

Stefan Urbanek

About

Package for Stock-and-Flow modelling and simulation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Swift 99.1%
  • Shell 0.9%