System Dynamics Model Builder – User Guide
Welcome to the SD Model Builder
This guide will help you create, simulate, and analyze System Dynamics models directly in your browser. System Dynamics is a powerful methodology for understanding complex systems through stocks, flows, and feedback loops.
Table of Contents
1. Understanding Model Elements
System Dynamics models are built using three fundamental types of elements:
Stocks (Accumulations)
Stocks represent quantities that accumulate over time. Think of them as containers or reservoirs. Examples include: Population, Inventory, Bank Balance, Water in a Tank, or Knowledge. Stocks can only change through flows.
Flows (Rates)
Flows represent the rate at which stocks change over time. They are the “pipes” that fill or drain stocks. Examples include: Births, Deaths, Sales, Production Rate, or Learning Rate. Flows are measured as quantity per time unit.
Variables (Auxiliaries)
Variables are intermediate calculations or constants that influence flows. They help organize complex relationships. Examples include: Birth Rate, Price, Conversion Factor, or Target Inventory. Variables can be constants or formulas.
2. Getting Started
The Canvas
The large white area is your modeling canvas. This is where you’ll place and connect your model elements. You can:
- Pan – Click and drag on empty space to move around the canvas
- Zoom – Use your mouse scroll wheel or pinch gesture to zoom in/out
- Select – Click on any element to select it
- Move – Drag selected elements to reposition them
The Toolbar
The toolbar at the top provides quick access to common actions:
Create a new stock element
Create a new flow element
Create a new variable
Connect two elements
3. Creating Elements
Adding a Stock
- Click the “Add Stock” button in the toolbar
- A new stock will appear on the canvas with a default name
- Double-click on the stock to open the properties panel
- Enter a descriptive name (e.g., “Population”, “Inventory”)
- Set the initial value in the equation field (e.g.,
1000) - Optionally add units and documentation
- Click Save to apply your changes
Adding a Flow
- Click the “Add Flow” button in the toolbar
- A new flow will appear on the canvas
- Double-click to edit the flow properties
- Name your flow (e.g., “Births”, “Sales”)
- Write an equation that calculates the flow rate
- Click Save
Population * Birth Rate
Adding a Variable
- Click the “Add Variable” button
- Double-click to edit properties
- Name your variable (e.g., “Birth Rate”, “Price”)
- Enter a constant value or formula
- Click Save
Moving and Resizing Elements
- Move: Click and drag any element to reposition it
- Resize: Select an element and drag the corner handles to resize
- Delete: Select an element and press Delete or Backspace
4. Creating Relationships
Relationships (also called causal links) show how elements influence each other. They appear as curved arrows with a polarity indicator.
Adding a Relationship
- Click the “Add Relationship” button
- Click on the source element (the influencer)
- Click on the target element (what’s being influenced)
- An arrow will be created connecting them
Understanding Polarity
The polarity shows whether the relationship is positive or negative:
| Polarity | Meaning | Example |
|---|---|---|
| + Positive | When the source increases, the target increases (and vice versa) | Population → Births: More people = more births |
| − Negative | When the source increases, the target decreases (and vice versa) | Price → Demand: Higher price = lower demand |
Editing Relationships
- Click on the relationship arrow or the polarity circle (+/−)
- The properties panel will open
- Change the polarity if needed
- Adjust the curvature using the slider
- Add reasoning to document why this relationship exists
- Click Save
5. Writing Equations
Basic Syntax
Equations define how elements are calculated. You can use:
| Operation | Symbol | Example |
|---|---|---|
| Addition | + |
Inflow + Extra |
| Subtraction | - |
Revenue - Costs |
| Multiplication | * |
Population * Birth Rate |
| Division | / |
Inventory / Coverage Time |
| Exponentiation | ^ |
Base ^ 2 |
| Parentheses | ( ) |
(Price - Cost) * Quantity |
Available Functions
| Function | Description | Example |
|---|---|---|
MIN(a, b) |
Returns the smaller value | MIN(Demand, Supply) |
MAX(a, b) |
Returns the larger value | MAX(0, Inventory - Safety) |
IF(cond, true, false) |
Conditional logic | IF(Stock < 10, 100, 0) |
SQRT(x) |
Square root | SQRT(Variance) |
ABS(x) |
Absolute value | ABS(Error) |
EXP(x) |
Exponential (e^x) | EXP(Growth Rate) |
LOG(x) |
Natural logarithm | LOG(Population) |
Special Variables
TIME- The current simulation time
Example Equations
Stock (Initial Value): 1000
Flow (Rate): Population * Birth Rate
Variable (Constant): 0.03
Variable (Formula): (Desired Inventory - Inventory) / Adjustment Time
Conditional: IF(Inventory < Reorder Point, Order Quantity, 0)
6. Running Simulations
Simulation Controls
Start the simulation
Pause at current time
Return to time zero
Adjust animation speed
Simulation Parameters
Before running, configure your simulation settings:
- Start Time: When the simulation begins (usually 0)
- Stop Time: When the simulation ends (e.g., 100)
- Time Step (DT): The calculation interval (smaller = more accurate but slower)
- Time Units: Label for your time axis (seconds, days, months, years)
Viewing Results
During simulation:
- Canvas Animation: Watch values change in real-time on the diagram
- Chart: View time-series graphs of all variables
- Toggle Variables: Show/hide specific variables in the chart
7. Saving and Exporting
Saving Your Model
- Click the "Save Model" button
- Enter a name for your model
- Your model will be saved and you can return to it later
Exporting to JSON
Export your model in SD-JSON format for backup or sharing:
- Click "Export JSON"
- A file will download containing your complete model
- This format is compatible with other SD tools
Importing a Model
- Click "Import JSON"
- Select or paste your SD-JSON file
- The model will load onto the canvas
Exporting Results to CSV
After running a simulation:
- Click "Export CSV"
- A spreadsheet file will download with all simulation data
- Open in Excel or Google Sheets for further analysis
8. Example: Building a Population Model
Let's build a simple population growth model step by step:
The Scenario
Model a population that grows through births and shrinks through deaths. Birth and death rates are constant percentages.
Step 1: Create the Stock
- Click "Add Stock"
- Double-click and name it
Population - Set equation to
1000(initial population) - Set units to
people - Save
Step 2: Create the Variables
- Add a variable, name it
Birth Rate, equation:0.03(3% per year) - Add a variable, name it
Death Rate, equation:0.02(2% per year)
Step 3: Create the Flows
- Add a flow, name it
Births, equation:Population * Birth Rate - Add a flow, name it
Deaths, equation:Population * Death Rate
Step 4: Create Relationships
- Add relationship:
Population→Births(polarity: +) - Add relationship:
Birth Rate→Births(polarity: +) - Add relationship:
Population→Deaths(polarity: +) - Add relationship:
Death Rate→Deaths(polarity: +) - Add relationship:
Births→Population(polarity: +) - Add relationship:
Deaths→Population(polarity: −)
Step 5: Run the Simulation
- Set Stop Time to
100years - Set Time Step to
1 - Click Play
- Watch the population grow exponentially!
9. Tips and Tricks
Best Practices
- Start simple: Begin with 2-3 elements and add complexity gradually
- Name clearly: Use descriptive names that explain what each element represents
- Document: Add documentation to elements explaining your assumptions
- Test often: Run simulations frequently to catch errors early
- Check units: Ensure your units are consistent (e.g., people/year × years = people)
Troubleshooting
| Problem | Possible Cause | Solution |
|---|---|---|
| Values explode to infinity | Positive feedback without limits | Add constraints using MIN/MAX or negative feedback |
| Values oscillate wildly | Time step too large | Reduce DT (try 0.25 or 0.1) |
| Nothing changes | Missing connections or zero rates | Check that flows connect to stocks and have non-zero equations |
| NaN or error values | Division by zero or undefined reference | Check equations for divide-by-zero cases; verify element names match |
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
| Delete / Backspace | Delete selected element |
| Escape | Cancel current action / Close panel |
| Double-click | Edit element properties |
