Make Your PSF Grow (Stella)

The Make Your PSF Grow model built in Stella Architect, loaded from its XMILE file and run on both engines.
Keywords

system dynamics, professional services firm, growth, business simulation, bptk, bptk-py, python, xmile, stella

The Same Model in Stella

The model this chapter builds step by step in the SD DSL also exists as a Stella Architect model: make_your_psf_grow.stmx, in the XMILE format. BPTK-Py compiles it into an SD DSL model and runs it like any other - this page shows how.

The scenario file

A scenario file beside the page names the XMILE file as source, and the file the compiled model is written to as model:

{
    "psf": {
        "source": "simulation_models/make_your_psf_grow.stmx",
        "model": "simulation_models/make_your_psf_grow",
        "scenarios": {
            "base": {}
        }
    }
}

When bptk reads it, the model is compiled - and compiled again whenever the .stmx changes. XMILE Step by Step explains the details.

Running it

The Stella model has the same modules as the SD DSL version, so its elements carry the same names - cash.cash, kpi.projectBacklog:

from BPTK_Py import bptk

bptk = bptk()
bptk.plot_scenarios(
    scenario_managers=["psf"],
    scenarios=["base"],
    equations=["cash.cash"],
    title="Cash, Base Case",
    x_label="Months",
    y_label="€",
    format="axes",
)