Supply & demand
Drag the curves. Watch equilibrium, surplus, taxes and price controls respond in real time.
Drag either curve to shift it, or the round handle at its end to change its steepness. Everything is keyboard-operable: tab to a curve and use the arrow keys, with shift for larger steps.
Market outcome
Welfare
Elasticity at equilibrium
Elastic — quantity responds strongly
Elastic
Controls
Shift presets
How it works
Both curves here are linear, which is the standard teaching simplification. Demand slopes down because buyers want less as price rises; supply slopes up because sellers offer more.
demand: P = a − bQ
supply: P = c + dQ
equilibrium: Q* = (a − c) / (b + d), P* = a − bQ* Shifts versus movements
This is the distinction students lose marks on most often. A change in the good's own price is a movement along a curve. A change in anything else — income, the price of a substitute, input costs, technology, expectations, the number of buyers — shifts the whole curve. Dragging a curve here is a shift; the equilibrium then moves along the other curve to meet it.
Consumer and producer surplus
The blue triangle is consumer surplus: the gap between what buyers were willing to pay (the demand curve) and what they actually paid. The green triangle is producer surplus: the gap between the price received and the minimum sellers would have accepted (the supply curve). Together they measure the total gains from trade, which at the free-market equilibrium are as large as they can possibly be.
Tax incidence does not depend on who pays it
Switch on a per-unit tax and watch the wedge open between what buyers pay and what sellers receive. Now change the steepness of the two curves. The burden falls mainly on whichever side is less elastic — less able to walk away. This is why taxes on cigarettes fall almost entirely on smokers, and why a payroll tax split “equally” between employer and employee is not, economically, split equally at all. The legal incidence is irrelevant; only the elasticities matter.
Deadweight loss
The red triangle is trade that would have created value and no longer happens. Every unit between the taxed quantity and the free-market quantity was one where a buyer valued the good more than it cost to produce — a mutually beneficial trade the tax prevented. Nobody captures that value; it simply disappears. Its size grows with the square of the tax, which is the core argument for broad taxes at low rates rather than narrow ones at high rates.
Price controls
A ceiling below the equilibrium price creates a shortage: at the lower price buyers want more and sellers offer less. Rent control and petrol price caps are the standard examples, and the queues, waiting lists and quality decline that follow are the market rationing by something other than price. A floor above equilibrium creates a surplus — agricultural price supports produce butter mountains, and a minimum wage above the market-clearing wage produces unemployment in this model.
Note that a control on the wrong side of equilibrium does nothing at all: a ceiling above the market price never binds. Drag the control line past the equilibrium and watch the effects vanish.
Elasticity
Elasticity is the percentage change in quantity for a one percent change in price. It is not the slope: a straight demand curve has constant slope but elasticity that varies continuously along it — elastic at the top, inelastic at the bottom, unit elastic at the midpoint. That is why the figures above are quoted at the equilibrium point specifically.
When demand is inelastic (|Ed| < 1), a price rise increases total revenue. When it is elastic, a price rise reduces it. This single fact drives an enormous amount of real pricing strategy.
What this model leaves out
Perfect competition, perfect information, no externalities, no market power, and linear curves. Real markets violate all five. The model is still worth knowing because it is the baseline against which those violations are measured — you cannot describe what monopoly or pollution does to a market without first knowing what the market would have done without them.
Sources
The model is the standard partial-equilibrium treatment found in any introductory microeconomics text — Mankiw's Principles of Economics, Varian's Intermediate Microeconomics, or Krugman & Wells. Surplus areas, tax incidence and deadweight loss are computed from the closed-form geometry of the linear case, so the figures are exact for this model rather than numerically approximated.