{
 "format": "stockflow-1",
 "id": "lib-piggy-bank",
 "name": "Piggy bank and pocket money",
 "notes": "Savings are a stock. Pocket money and interest flow in, treats flow out. Two loops: interest grows with the savings (reinforcing), and having more money than you feel you need makes you spend more (balancing). Question to try: what grows your savings more, a higher interest rate or a higher comfort amount? Time unit: weeks (two years).",
 "sim": {
  "start": 0,
  "stop": 104,
  "dt": 0.25,
  "unit": "weeks"
 },
 "elements": [
  {
   "id": "p1",
   "type": "stock",
   "name": "Savings",
   "eq": "0",
   "x": 440,
   "y": 260,
   "units": "€",
   "doc": "Money in the piggy bank (or a savings account).",
   "nonneg": true
  },
  {
   "id": "p2",
   "type": "flow",
   "name": "Money_Saved",
   "eq": "Pocket_Money*Share_Saved",
   "from": null,
   "to": "p1",
   "fx": 200,
   "fy": 260,
   "units": "€/week",
   "doc": "Part of the pocket money that goes into savings each week.",
   "biflow": false
  },
  {
   "id": "p3",
   "type": "flow",
   "name": "Interest",
   "eq": "Savings*Interest_Rate/100/52",
   "from": null,
   "to": "p1",
   "fx": 440,
   "fy": 80,
   "units": "€/week",
   "doc": "Interest the bank pays. It grows with the savings themselves: a reinforcing loop.",
   "biflow": false
  },
  {
   "id": "p4",
   "type": "flow",
   "name": "Treats",
   "eq": "MAX(0, Savings - Comfort_Amount)*Temptation",
   "from": "p1",
   "to": null,
   "tx": 700,
   "ty": 260,
   "units": "€/week",
   "doc": "Money spent on treats. The more there is above the amount you feel comfortable with, the more you spend: a balancing loop you may not expect.",
   "biflow": false
  },
  {
   "id": "p5",
   "type": "aux",
   "name": "Pocket_Money",
   "eq": "10",
   "x": 160,
   "y": 120,
   "units": "€/week",
   "doc": "Pocket money each week.",
   "slider": {
    "min": 0,
    "max": 30,
    "step": 1,
    "kind": "assumption"
   }
  },
  {
   "id": "p6",
   "type": "aux",
   "name": "Share_Saved",
   "eq": "0.5",
   "x": 300,
   "y": 120,
   "units": "fraction",
   "doc": "How much of the pocket money you save.",
   "slider": {
    "min": 0,
    "max": 1,
    "step": 0.05,
    "kind": "decision"
   }
  },
  {
   "id": "p7",
   "type": "aux",
   "name": "Interest_Rate",
   "eq": "3",
   "x": 600,
   "y": 80,
   "units": "% per year",
   "doc": "Interest the bank pays per year.",
   "slider": {
    "min": 0,
    "max": 10,
    "step": 0.5,
    "kind": "assumption"
   }
  },
  {
   "id": "p8",
   "type": "aux",
   "name": "Comfort_Amount",
   "eq": "100",
   "x": 760,
   "y": 140,
   "units": "€",
   "doc": "Above this amount you start to feel rich and spend more easily.",
   "slider": {
    "min": 0,
    "max": 500,
    "step": 10,
    "kind": "decision"
   }
  },
  {
   "id": "p9",
   "type": "aux",
   "name": "Temptation",
   "eq": "0.05",
   "x": 760,
   "y": 380,
   "units": "per week",
   "doc": "Share of the money above your comfort amount you spend each week.",
   "slider": {
    "min": 0,
    "max": 0.3,
    "step": 0.01,
    "kind": "assumption"
   }
  }
 ],
 "plots": [
  "p1",
  "p2",
  "p3",
  "p4"
 ],
 "summary": {
  "kpis": [
   {
    "name": "Savings",
    "agg": "final",
    "label": "Savings after two years",
    "better": "high",
    "format": "eur"
   },
   {
    "name": "Treats",
    "agg": "total",
    "label": "Spent on treats",
    "better": "low",
    "format": "eur"
   }
  ]
 },
 "scenarios": [
  {
   "id": "ps1",
   "name": "Save half",
   "values": {
    "Share_Saved": 0.5
   }
  },
  {
   "id": "ps2",
   "name": "Save half, no limit on treats",
   "values": {
    "Share_Saved": 0.5,
    "Comfort_Amount": 0
   }
  }
 ]
}