{
 "format": "stockflow-1",
 "id": "case-coffee-subscription",
 "name": "Case study: coffee subscription launch",
 "notes": "A café launches a monthly coffee subscription in a neighbourhood of 20,000 people. Advertising brings the first subscribers; after that, word of mouth takes over (a reinforcing loop) until the neighbourhood runs out of new people (a balancing loop). People who cancel come back into the market after about a year. More subscribers mean more coffees to make; baristas are hired with a delay, and when they are overloaded queues build up and people cancel (another balancing loop). Time unit: months. Use it to learn the tool: change the sliders, compare scenarios, let Find best search for the best plan, and read the Summary.",
 "sim": {
  "start": 0,
  "stop": 36,
  "dt": 0.25,
  "unit": "months"
 },
 "elements": [
  {
   "id": "c1",
   "type": "stock",
   "name": "Potential_Customers",
   "eq": "20000",
   "x": 260,
   "y": 260,
   "units": "people",
   "doc": "People in the neighbourhood who might subscribe but have not yet.",
   "nonneg": true
  },
  {
   "id": "c2",
   "type": "stock",
   "name": "Subscribers",
   "eq": "50",
   "x": 660,
   "y": 260,
   "units": "people",
   "doc": "People paying a monthly coffee subscription.",
   "nonneg": true
  },
  {
   "id": "c3",
   "type": "flow",
   "name": "New_Subscribers",
   "eq": "Potential_Customers*(From_Advertising + From_Word_of_Mouth)*Price_Appeal",
   "from": "c1",
   "to": "c2",
   "units": "people/month",
   "doc": "People who sign up each month: reached by advertising or by friends, and put off by a high price.",
   "biflow": false
  },
  {
   "id": "c4",
   "type": "stock",
   "name": "Former_Subscribers",
   "eq": "0",
   "x": 460,
   "y": 450,
   "units": "people",
   "doc": "People who cancelled. After a while some of them are open to subscribing again.",
   "nonneg": true
  },
  {
   "id": "c5",
   "type": "flow",
   "name": "Cancellations",
   "eq": "Subscribers*(Normal_Churn*Price_Churn_Factor + Queue_Churn)",
   "from": "c2",
   "to": "c4",
   "units": "people/month",
   "doc": "Subscribers who cancel each month. Some always leave, more leave when the price feels high, and more again when the queue gets long.",
   "biflow": false
  },
  {
   "id": "c6",
   "type": "aux",
   "name": "Price_Churn_Factor",
   "eq": "MAX(0.5, 1 + Price_Sensitivity*(Price - Reference_Price)/Reference_Price)",
   "x": 700,
   "y": 160,
   "units": "index",
   "doc": "Cancellations go up when the price is above the reference price (1 = normal)."
  },
  {
   "id": "c7",
   "type": "flow",
   "name": "Rejoining_Market",
   "eq": "Former_Subscribers/Rejoin_Time",
   "from": "c4",
   "to": "c1",
   "units": "people/month",
   "doc": "Former subscribers who become potential customers again.",
   "biflow": false
  },
  {
   "id": "c8",
   "type": "aux",
   "name": "Rejoin_Time",
   "eq": "12",
   "x": 200,
   "y": 470,
   "units": "months",
   "doc": "How long a former subscriber stays away before they might sign up again.",
   "slider": {
    "min": 1,
    "max": 36,
    "step": 1,
    "kind": "assumption"
   }
  },
  {
   "id": "c9",
   "type": "aux",
   "name": "Advertising_Spend",
   "eq": "1500",
   "x": 130,
   "y": 80,
   "units": "€/month",
   "doc": "Money spent on flyers, social media and local ads each month.",
   "slider": {
    "min": 0,
    "max": 8000,
    "step": 250,
    "kind": "decision"
   }
  },
  {
   "id": "c10",
   "type": "aux",
   "name": "Ad_Effectiveness",
   "eq": "0.01",
   "x": 260,
   "y": 40,
   "units": "share per €1000",
   "doc": "Share of potential customers who sign up per €1000 of advertising each month.",
   "slider": {
    "min": 0,
    "max": 0.03,
    "step": 0.001,
    "kind": "assumption"
   }
  },
  {
   "id": "c11",
   "type": "aux",
   "name": "From_Advertising",
   "eq": "Advertising_Spend/1000*Ad_Effectiveness",
   "x": 220,
   "y": 150,
   "units": "per month",
   "doc": "Share of potential customers won by advertising each month."
  },
  {
   "id": "c12",
   "type": "aux",
   "name": "Contact_Rate",
   "eq": "10",
   "x": 420,
   "y": 40,
   "units": "contacts/month",
   "doc": "How many people each person talks to about coffee in a month.",
   "slider": {
    "min": 0,
    "max": 30,
    "step": 1,
    "kind": "assumption"
   }
  },
  {
   "id": "c13",
   "type": "aux",
   "name": "Adoption_Fraction",
   "eq": "0.03",
   "x": 560,
   "y": 40,
   "units": "fraction",
   "doc": "Chance that a chat with a subscriber leads to a sign-up.",
   "slider": {
    "min": 0,
    "max": 0.1,
    "step": 0.005,
    "kind": "assumption"
   }
  },
  {
   "id": "c14",
   "type": "aux",
   "name": "Total_Market",
   "eq": "Potential_Customers + Subscribers + Former_Subscribers",
   "x": 110,
   "y": 330,
   "units": "people",
   "doc": "Everyone who could be a customer."
  },
  {
   "id": "c15",
   "type": "aux",
   "name": "From_Word_of_Mouth",
   "eq": "Contact_Rate*Adoption_Fraction*Subscribers/Total_Market",
   "x": 470,
   "y": 150,
   "units": "per month",
   "doc": "Share of potential customers won by subscribers recommending you. Grows as you get more subscribers: the reinforcing loop."
  },
  {
   "id": "c16",
   "type": "aux",
   "name": "Price",
   "eq": "30",
   "x": 720,
   "y": 60,
   "units": "€/month",
   "doc": "Monthly subscription price.",
   "slider": {
    "min": 15,
    "max": 50,
    "step": 1,
    "kind": "decision"
   }
  },
  {
   "id": "c17",
   "type": "aux",
   "name": "Reference_Price",
   "eq": "30",
   "x": 860,
   "y": 40,
   "units": "€/month",
   "doc": "What people think a coffee subscription should cost.",
   "slider": {
    "min": 15,
    "max": 50,
    "step": 1,
    "kind": "assumption"
   }
  },
  {
   "id": "c18",
   "type": "aux",
   "name": "Price_Sensitivity",
   "eq": "2",
   "x": 1000,
   "y": 60,
   "units": "ratio",
   "doc": "How strongly customers react to price: 2 means 10% above the reference price costs 20% of sign-ups and adds 20% to cancellations.",
   "slider": {
    "min": 0,
    "max": 4,
    "step": 0.1,
    "kind": "assumption"
   }
  },
  {
   "id": "c19",
   "type": "aux",
   "name": "Price_Appeal",
   "eq": "MAX(0, MIN(1.5, 1 - Price_Sensitivity*(Price - Reference_Price)/Reference_Price))",
   "x": 860,
   "y": 160,
   "units": "index",
   "doc": "1 at the reference price, lower when you are dearer, higher when cheaper."
  },
  {
   "id": "c20",
   "type": "aux",
   "name": "Normal_Churn",
   "eq": "0.03",
   "x": 840,
   "y": 300,
   "units": "per month",
   "doc": "Share of subscribers who cancel each month anyway (moving away, changing habits).",
   "slider": {
    "min": 0,
    "max": 0.1,
    "step": 0.005,
    "kind": "assumption"
   }
  },
  {
   "id": "c21",
   "type": "aux",
   "name": "Queue_Churn",
   "eq": "0.4*MAX(0, Utilisation - 0.9)",
   "x": 960,
   "y": 380,
   "units": "per month",
   "doc": "Extra cancellations when the baristas are over 90% busy and queues build up."
  },
  {
   "id": "c22",
   "type": "aux",
   "name": "Cancellations_from_Queues",
   "eq": "Subscribers*Queue_Churn",
   "x": 1080,
   "y": 300,
   "units": "people/month",
   "doc": "Subscribers lost because of long queues."
  },
  {
   "id": "c23",
   "type": "aux",
   "name": "Cups_per_Subscriber",
   "eq": "0.8",
   "x": 640,
   "y": 400,
   "units": "cups/day",
   "doc": "Average coffees a subscriber drinks per day.",
   "slider": {
    "min": 0.3,
    "max": 2,
    "step": 0.1,
    "kind": "assumption"
   }
  },
  {
   "id": "c24",
   "type": "aux",
   "name": "Orders_per_Day",
   "eq": "Subscribers*Cups_per_Subscriber",
   "x": 780,
   "y": 470,
   "units": "cups/day",
   "doc": "Coffees to make each day."
  },
  {
   "id": "c25",
   "type": "aux",
   "name": "Capacity_per_Barista",
   "eq": "150",
   "x": 340,
   "y": 580,
   "units": "cups/day",
   "doc": "Coffees one barista can make in a day.",
   "slider": {
    "min": 80,
    "max": 250,
    "step": 10,
    "kind": "assumption"
   }
  },
  {
   "id": "c26",
   "type": "aux",
   "name": "Target_Utilisation",
   "eq": "0.8",
   "x": 340,
   "y": 690,
   "units": "fraction",
   "doc": "How busy you want your baristas to be. Lower = shorter queues but more wages.",
   "slider": {
    "min": 0.5,
    "max": 1,
    "step": 0.05,
    "kind": "decision"
   }
  },
  {
   "id": "c27",
   "type": "aux",
   "name": "Desired_Baristas",
   "eq": "Orders_per_Day/(Capacity_per_Barista*Target_Utilisation)",
   "x": 560,
   "y": 580,
   "units": "people",
   "doc": "Baristas you would need for today’s orders at your target busy-ness."
  },
  {
   "id": "c28",
   "type": "aux",
   "name": "Hiring_Time",
   "eq": "2",
   "x": 520,
   "y": 790,
   "units": "months",
   "doc": "How long it takes to find and train a barista: the delay in the staff loop.",
   "slider": {
    "min": 0.5,
    "max": 6,
    "step": 0.5,
    "kind": "decision"
   }
  },
  {
   "id": "c29",
   "type": "stock",
   "name": "Baristas",
   "eq": "2",
   "x": 780,
   "y": 690,
   "units": "people",
   "doc": "Baristas employed.",
   "nonneg": true
  },
  {
   "id": "c30",
   "type": "flow",
   "name": "Hiring",
   "eq": "(Desired_Baristas - Baristas)/Hiring_Time",
   "from": null,
   "to": "c29",
   "fx": 560,
   "fy": 690,
   "units": "people/month",
   "doc": "Closes the gap between the baristas you need and those you have, slowly. Negative = people leave and are not replaced.",
   "biflow": true
  },
  {
   "id": "c31",
   "type": "aux",
   "name": "Capacity",
   "eq": "Baristas*Capacity_per_Barista",
   "x": 960,
   "y": 600,
   "units": "cups/day",
   "doc": "Coffees your team can make per day."
  },
  {
   "id": "c32",
   "type": "aux",
   "name": "Utilisation",
   "eq": "SAFEDIV(Orders_per_Day, Capacity)",
   "x": 960,
   "y": 480,
   "units": "fraction",
   "doc": "How busy the baristas are. Above 1 = more orders than they can make."
  },
  {
   "id": "c33",
   "type": "aux",
   "name": "Revenue",
   "eq": "Subscribers*Price",
   "x": 200,
   "y": 860,
   "units": "€/month",
   "doc": "Subscription income."
  },
  {
   "id": "c34",
   "type": "aux",
   "name": "Barista_Wage",
   "eq": "3000",
   "x": 360,
   "y": 950,
   "units": "€/month",
   "doc": "Cost of one barista per month.",
   "slider": {
    "min": 1500,
    "max": 5000,
    "step": 100,
    "kind": "assumption"
   }
  },
  {
   "id": "c35",
   "type": "aux",
   "name": "Coffee_Cost",
   "eq": "8",
   "x": 500,
   "y": 950,
   "units": "€/subscriber/month",
   "doc": "Beans, milk and cups per subscriber per month.",
   "slider": {
    "min": 2,
    "max": 15,
    "step": 0.5,
    "kind": "assumption"
   }
  },
  {
   "id": "c36",
   "type": "aux",
   "name": "Fixed_Costs",
   "eq": "4000",
   "x": 640,
   "y": 950,
   "units": "€/month",
   "doc": "Rent, machines and energy.",
   "slider": {
    "min": 0,
    "max": 10000,
    "step": 250,
    "kind": "assumption"
   }
  },
  {
   "id": "c37",
   "type": "aux",
   "name": "Costs",
   "eq": "Baristas*Barista_Wage + Subscribers*Coffee_Cost + Fixed_Costs + Advertising_Spend",
   "x": 420,
   "y": 860,
   "units": "€/month",
   "doc": "All costs per month."
  },
  {
   "id": "c38",
   "type": "stock",
   "name": "Cumulative_Profit",
   "eq": "0",
   "x": 980,
   "y": 860,
   "units": "€",
   "doc": "Profit added up since opening.",
   "nonneg": false
  },
  {
   "id": "c39",
   "type": "flow",
   "name": "Profit",
   "eq": "Revenue - Costs",
   "from": null,
   "to": "c38",
   "fx": 640,
   "fy": 860,
   "units": "€/month",
   "doc": "Monthly profit (negative = loss).",
   "biflow": true
  }
 ],
 "scenarios": [
  {
   "id": "cs1",
   "name": "Steady start",
   "note": "€1,500 a month on ads, €30 a month price.",
   "values": {
    "Advertising_Spend": 1500,
    "Price": 30,
    "Target_Utilisation": 0.8,
    "Hiring_Time": 2
   }
  },
  {
   "id": "cs2",
   "name": "Big launch campaign",
   "note": "€6,000 a month on ads: faster growth, bigger queues.",
   "values": {
    "Advertising_Spend": 6000,
    "Price": 30,
    "Target_Utilisation": 0.8,
    "Hiring_Time": 2
   }
  },
  {
   "id": "cs3",
   "name": "Premium price",
   "note": "€38 a month: fewer sign-ups, more per customer.",
   "values": {
    "Advertising_Spend": 1500,
    "Price": 38,
    "Target_Utilisation": 0.8,
    "Hiring_Time": 2
   }
  },
  {
   "id": "cs4",
   "name": "Hire fast",
   "note": "Baristas start within two weeks.",
   "values": {
    "Advertising_Spend": 1500,
    "Price": 30,
    "Target_Utilisation": 0.8,
    "Hiring_Time": 0.5
   }
  },
  {
   "id": "cs5",
   "name": "No advertising",
   "note": "Rely on word of mouth alone.",
   "values": {
    "Advertising_Spend": 0,
    "Price": 30,
    "Target_Utilisation": 0.8,
    "Hiring_Time": 2
   }
  }
 ],
 "summary": {
  "kpis": [
   {
    "name": "Cumulative_Profit",
    "agg": "final",
    "label": "Profit after 3 years",
    "better": "high",
    "format": "eur"
   },
   {
    "name": "Subscribers",
    "agg": "final",
    "label": "Subscribers at the end",
    "better": "high",
    "format": "num"
   },
   {
    "name": "Cancellations_from_Queues",
    "agg": "total",
    "label": "Customers lost to queues",
    "better": "low",
    "format": "num"
   },
   {
    "name": "Utilisation",
    "agg": "avg",
    "label": "How busy the baristas are (average)",
    "better": "low",
    "format": "pct"
   }
  ]
 },
 "optimise": {
  "goal": {
   "name": "Cumulative_Profit",
   "agg": "final",
   "dir": "max"
  },
  "constraints": [
   {
    "name": "Cancellations_from_Queues",
    "agg": "total",
    "op": "<=",
    "value": 300
   }
  ]
 },
 "plots": [
  "c2",
  "c1",
  "c29",
  "c32",
  "c39",
  "c38"
 ],
 "view": {
  "x": 40,
  "y": -110,
  "w": 1120,
  "h": 1200
 }
}