← 📈 Economics
📈 Economics • Difficulty ★★☆

Market Dynamics — Supply, Demand & Equilibrium

Explore how supply and demand curves create market equilibrium. Apply price controls, taxes, and subsidies to observe surplus, deadweight loss, and price elasticity effects.

📈 Market Controls

Policy tools:
Presets:
Equilibrium P*:
Equilibrium Q*:
Consumer Surplus:
Producer Surplus:
Deadweight Loss:

Physics & Equations

Demand: Q_d = a − b·P. Supply: Q_s = c + d·P. Equilibrium: P* = (a−c)/(b+d), Q* = (ad+bc)/(b+d). Consumer surplus = ½·(a/b − P*)·Q*. Producer surplus = ½·(P* − c/d)·Q*. Price ceiling below P* creates shortage. Per-unit tax shifts supply up, reducing Q* and creating deadweight loss.

Price Controls & Taxes

A price ceiling set below equilibrium prevents the market from clearing: Q_d > Q_s (shortage). Deadweight loss = ½·|tax|·|Q_eq − Q_control| represents value destroyed. The tax burden splits between consumers and producers depending on price elasticity. More elastic demand = producers bear more of the tax.

Price Elasticity

Price elasticity of demand Ed = −(dQ/dP)·(P/Q) = −b·P/Q. Elastic demand (|Ed|>1): large quantity response to price change. Inelastic (|Ed|<1): small response. The slope b controls elasticity in this linear model. Try the "Elastic Demand" preset to see how a steeper demand curve affects surplus and tax incidence.

About this simulation

This simulation models a linear supply-and-demand market: demand follows Q_d = a − b·P and supply follows Q_s = c + d·P, where a and c are the intercepts and b and d are the slopes. The two lines cross at the market-clearing equilibrium price and quantity, P* = (a−c)/(b+d). From there the model derives consumer surplus, producer surplus, and — when a price ceiling or per-unit tax is applied — the shortage or deadweight loss those interventions create.

🔬 What it shows

Two straight lines — demand (blue, sloping down) and supply (green, sloping up) — plotted on a price-quantity chart. Where they intersect is the equilibrium point (yellow dot). The shaded blue triangle above the price line is consumer surplus, the shaded green triangle below it is producer surplus, and when a tax is active a red triangle shows the deadweight loss from the reduced quantity traded.

🎮 How to use

Drag the Demand intercept a and Demand slope b sliders to reshape the demand curve, and Supply intercept c and Supply slope d to reshape supply. Use the Price Ceiling slider to cap price below equilibrium and watch a shortage appear, or the Per-unit Tax slider to shift the supply curve and generate deadweight loss. The four preset buttons — Competitive Market, Price Ceiling (rent), Tax Impact, and Elastic Demand — load ready-made scenarios instantly.

💡 Did you know?

A steeper demand slope b means demand is less price-elastic, so a per-unit tax falls more heavily on consumers; a flatter, more elastic demand curve (try the Elastic Demand preset) shifts more of the tax burden onto producers instead — this split is exactly what economists call tax incidence.

Frequently asked questions

What do the demand and supply equations actually mean?

Demand is modelled as Q_d = a − b·P: as price P rises, the quantity consumers want (Q_d) falls, with a as the maximum quantity demanded at zero price and b controlling how steeply demand falls. Supply is Q_s = c + d·P: as price rises, the quantity producers offer (Q_s) rises, with c as a baseline quantity and d controlling responsiveness to price. Both are simplified linear approximations of real-world curves.

How is the equilibrium price and quantity calculated?

Equilibrium occurs where quantity demanded equals quantity supplied: a − b·P = c + d·P. Solving for P gives the equilibrium price P* = (a−c)/(b+d), and substituting back into either equation gives the equilibrium quantity Q* = a − b·P*. At this point there is no shortage or surplus — every unit producers want to sell finds a buyer.

What happens when I set a price ceiling?

A price ceiling fixes the maximum legal price. If it is set below the equilibrium price P*, quantity demanded exceeds quantity supplied at that price, creating a shortage — the classic effect seen in rent-controlled housing markets. If the ceiling is set above P*, it has no effect because the market already clears below it.

Why does a tax create deadweight loss?

A per-unit tax effectively shifts the supply curve up by the tax amount, so producers need a higher price to supply the same quantity. The new equilibrium quantity Q_tax is lower than the original Q*, and some mutually beneficial trades that would have happened without the tax no longer occur. The value of those lost trades is the deadweight loss, calculated here as ½·tax·(Q* − Q_tax), shown as the red triangle.

What is price elasticity and how does it relate to the sliders?

Price elasticity of demand measures how much quantity demanded changes for a given change in price, calculated as Ed = −b·(P/Q) in this linear model. A larger slope b makes demand more responsive to price changes (more elastic), while a smaller b makes it more inelastic. Elasticity determines how a tax burden splits between consumers and producers, and how severe a shortage becomes under a price ceiling.