{
  "id": "linear-demand-supply",
  "name": "Linear demand and supply functions (numeric)",
  "unit": "micro",
  "unitName": "Unit 2 · Microeconomics",
  "topic": "Linear functions (HL)",
  "hl": true,
  "description": "Plot Qd = a − bP and Qs = c + dP from real numbers, find equilibrium, and calculate surplus, tax revenue, subsidy cost, shortages and welfare loss.",
  "keywords": [
    "linear demand function",
    "linear supply function",
    "Qd = a - bP",
    "Qs = c + dP",
    "HL",
    "paper 3",
    "calculate",
    "equilibrium",
    "consumer surplus",
    "tax revenue",
    "welfare loss",
    "quantitative"
  ],
  "schemaUrl": "https://graphs.lectere.com/api/v1/templates/linear-demand-supply",
  "previewUrl": "https://graphs.lectere.com/thumbs/linear-demand-supply.svg",
  "editorUrl": "https://graphs.lectere.com/graph/linear-demand-supply/",
  "params": [
    {
      "key": "a",
      "label": "Demand: a (in Qd = a − bP)",
      "default": 120,
      "group": "Functions",
      "type": "number",
      "step": 1
    },
    {
      "key": "b",
      "label": "Demand: b",
      "default": 10,
      "group": "Functions",
      "type": "number",
      "min": 0.01,
      "step": 0.5
    },
    {
      "key": "c",
      "label": "Supply: c (in Qs = c + dP)",
      "default": -30,
      "group": "Functions",
      "type": "number",
      "step": 1
    },
    {
      "key": "d",
      "label": "Supply: d",
      "default": 20,
      "group": "Functions",
      "type": "number",
      "min": 0.01,
      "step": 0.5
    },
    {
      "key": "policy",
      "label": "Intervention",
      "default": "none",
      "group": "Intervention",
      "type": "enum",
      "options": [
        {
          "value": "none",
          "label": "None"
        },
        {
          "value": "tax",
          "label": "Per-unit tax"
        },
        {
          "value": "subsidy",
          "label": "Per-unit subsidy"
        },
        {
          "value": "max",
          "label": "Maximum price"
        },
        {
          "value": "min",
          "label": "Minimum price"
        }
      ]
    },
    {
      "key": "amount",
      "label": "Tax / subsidy per unit",
      "default": 1.5,
      "group": "Intervention",
      "type": "number",
      "min": 0,
      "step": 0.1
    },
    {
      "key": "pmax",
      "label": "Maximum price",
      "default": 4,
      "group": "Intervention",
      "type": "number",
      "step": 0.1
    },
    {
      "key": "pmin",
      "label": "Minimum price",
      "default": 6,
      "group": "Intervention",
      "type": "number",
      "step": 0.1
    },
    {
      "key": "policyAreas",
      "label": "Shade revenue / cost and welfare loss",
      "default": true,
      "type": "boolean"
    },
    {
      "key": "surplus",
      "label": "Shade consumer and producer surplus",
      "default": false,
      "type": "boolean"
    },
    {
      "key": "axisMode",
      "label": "Axis labels",
      "default": "values",
      "type": "enum",
      "options": [
        {
          "value": "values",
          "label": "Values at the key points"
        },
        {
          "value": "ticks",
          "label": "Numeric scale + symbols"
        }
      ]
    },
    {
      "key": "cur",
      "label": "Currency symbol",
      "default": "$",
      "type": "string"
    }
  ],
  "defaults": {
    "a": 120,
    "b": 10,
    "c": -30,
    "d": 20,
    "policy": "none",
    "amount": 1.5,
    "pmax": 4,
    "pmin": 6,
    "policyAreas": true,
    "surplus": false,
    "axisMode": "values",
    "cur": "$"
  },
  "panels": [
    {
      "id": "main",
      "title": null,
      "xLabel": "Quantity",
      "yLabel": "Price ($)",
      "xRange": [
        0,
        150
      ],
      "yRange": [
        0,
        15
      ],
      "axisKeys": {
        "x": "main:x",
        "y": "main:y"
      }
    }
  ],
  "labels": [
    {
      "key": "main:y",
      "default": "Price ($)",
      "hint": "Vertical axis",
      "panel": "main"
    },
    {
      "key": "main:x",
      "default": "Quantity",
      "hint": "Horizontal axis",
      "panel": "main"
    },
    {
      "key": "main.d",
      "default": "D",
      "hint": "Curve",
      "panel": "main"
    },
    {
      "key": "main.s",
      "default": "S",
      "hint": "Curve",
      "panel": "main"
    },
    {
      "key": "main.e:y",
      "default": "$5",
      "hint": "Vertical-axis value",
      "panel": "main"
    },
    {
      "key": "main.e:x",
      "default": "70",
      "hint": "Horizontal-axis value",
      "panel": "main"
    }
  ],
  "elements": [
    {
      "key": "main.d",
      "kind": "curve",
      "label": "D"
    },
    {
      "key": "main.s",
      "kind": "curve",
      "label": "S"
    },
    {
      "key": "main.e",
      "kind": "point"
    }
  ],
  "stats": [
    {
      "label": "Equilibrium price",
      "value": "$5"
    },
    {
      "label": "Equilibrium quantity",
      "value": "70"
    },
    {
      "label": "Consumer surplus (free market)",
      "value": "$245"
    },
    {
      "label": "Producer surplus (free market)",
      "value": "$122.5"
    }
  ],
  "example": {
    "template": "linear-demand-supply",
    "params": {
      "a": 120,
      "b": 10,
      "c": -30,
      "d": 20,
      "policy": "none",
      "amount": 1.5,
      "pmax": 4,
      "pmin": 6,
      "policyAreas": true,
      "surplus": false,
      "axisMode": "values",
      "cur": "$"
    }
  }
}