Skip to content

Package for Stock-and-Flow modelling and simulation

Notifications You must be signed in to change notification settings

OpenPoiesis/PoieticFlows

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 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
    • Nodes: Stock, Flow, Auxiliary, Graphical Function
    • Interface nodes: Chart, Control
    • Included Euler and RK4 solvers
    • Experimental features: Delay
  • 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

Available platforms: MacOS 14 (and later), Linux

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

The Poietic Flows includes a command-line tool to create, edit and run Stock and Flow models called poietic.

See the Command Line Tool documentation.

Command summary:

  • new: Create an empty design.
  • info: Get information about the design
  • list: List design content objects.
  • show: Describe an object.
  • edit: Edit an object or a selection of objects.
    • 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
    • remove: Remove an object – a node or a connection
    • auto-parameters: Automatically connect parameter nodes: connect required, disconnect unused
    • layout: Lay out objects
    • align: Align objects on canvas
  • import: Import a frame into the design.
  • run: Run the simulation and generate output
  • write-dot: Write a Graphviz DOT file.
  • metamodel: Show the metamodel
  • create-library Create a library of multiple models.

Use --help with a 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:

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 formula=0
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

Packages

No packages published