File size: 995 Bytes
283f1de
 
719c7a7
 
 
 
 
 
283f1de
719c7a7
283f1de
 
719c7a7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
title: Basic Econ Demo
emoji: 💹
colorFrom: blue
colorTo: green
sdk: streamlit
sdk_version: 1.33.0
app_file: app.py
pinned: false
license: mit
---

# Basic Econ Demo (Supply & Demand Playground)

An interactive Streamlit app to explore microeconomics fundamentals:
- Adjustable linear or power-form supply and demand curves
- Policies: per-unit tax, price ceiling, price floor, and quota (quantity cap)
- Automatic calculation of equilibrium, consumer surplus, producer surplus,
  tax revenue / quota rent, total surplus, and deadweight loss
- Interactive Plotly visualization with shaded areas (CS, PS, TR/QR, DWL)
- Download buttons for metrics and curve data as CSV

## How to run locally

```bash
pip install -r requirements.txt
streamlit run app.py
```

## Notes
- Curves use: Demand P = α_d − β_d Q^γ_d, Supply P = α_s + β_s Q^γ_s
- Power form exponents γ ∈ [0.5, 2]
- For price controls, assumes efficient rationing
- Quota rent computed as (Pc − Pp) × Q when binding