Supply & Demand — Market Equilibrium

Shift supply and demand curves interactively. Explore consumer/producer surplus and the effects of price controls on market efficiency.

About Supply & Demand — Market Equilibrium

This simulation plots a downward-sloping demand line and an upward-sloping supply line on a price-quantity diagram and finds where they cross. Demand is modelled as P = d0 − dSlope·Q and supply as P = s0 + sSlope·Q. Solving the two for equality gives the equilibrium quantity Q* = (d0 − s0)/(dSlope + sSlope), with the equilibrium price read off either curve at Q*.

The sliders set the demand intercept (willingness to pay), the supply base price (minimum producer cost), and the slope of each curve. Two toggles overlay a price floor (set 25% above P*) or a price ceiling (25% below P*), shading the resulting surplus or shortage as dead-weight loss. The model underpins microeconomics, competition policy, minimum-wage and rent-control debates.

Frequently Asked Questions

What does this supply and demand simulation show?

It draws a demand curve and a supply curve and marks their intersection, the market equilibrium E*. At that point the quantity buyers want equals the quantity sellers offer, fixing a single equilibrium price P* and quantity Q*. Shaded triangles show consumer and producer surplus.

How is the equilibrium calculated?

Demand is P = d0 − dSlope·Q and supply is P = s0 + sSlope·Q. Setting them equal and solving gives Q* = (d0 − s0)/(dSlope + sSlope), and P* is found by substituting Q* back into the supply equation. The simulation recomputes this instantly whenever a slider moves.

What do the four sliders control?

The demand intercept (50–110) sets the highest price any buyer will pay, and the supply base price (0–50) sets the lowest cost any seller accepts. The demand slope (0.30–1.50) and supply slope (0.10–1.20) set how steeply each curve responds to quantity, controlling price sensitivity and the rate at which costs rise.

What are consumer and producer surplus?

Consumer surplus is the value buyers receive above the price they pay — the blue triangle between the demand curve and P*. Producer surplus is the gain to sellers above their cost — the green triangle between P* and the supply curve. Each is computed here as half the base (Q*) times its height.

How does a price floor work in the model?

Toggling the price floor draws a horizontal line 25% above P*, mimicking a minimum wage or guaranteed minimum price. Above equilibrium, the quantity supplied exceeds the quantity demanded, so a surplus forms. The simulation shades the resulting dead-weight loss where mutually beneficial trades no longer happen.

How does a price ceiling work in the model?

The price ceiling line sits 25% below P*, representing controls such as rent caps. Below equilibrium, demand outstrips supply, producing a shortage. The shaded region marks the dead-weight loss — value destroyed because sellers will not supply enough at the capped price.

Is this model physically and economically accurate?

It is a faithful textbook treatment of a single competitive market with linear curves, the standard partial-equilibrium model taught in introductory economics. It assumes perfect competition, no externalities and instant adjustment, so it simplifies real markets where curves are non-linear and prices adjust over time.

Why are the supply and demand curves drawn as straight lines?

Linear curves keep the algebra simple and let the equilibrium be solved exactly, which is why introductory courses use them. Real demand and supply are usually curved, but a straight line is a reasonable local approximation around the equilibrium and makes the geometry of surplus and dead-weight loss easy to see.

What causes dead-weight loss?

Dead-weight loss is the value of trades that would benefit both buyer and seller but do not occur because price is held away from equilibrium. A binding floor or ceiling prevents quantity from reaching Q*, so the combined consumer and producer surplus shrinks; the lost area is shaded red in the diagram.

How does this apply to real-world policy?

The same logic guides debates on minimum wages, rent control, agricultural price supports and ticket caps. Economists use supply and demand diagrams to predict whether a control will create surpluses, shortages or efficiency losses, and to estimate who bears the cost. Experimenting with the sliders shows those trade-offs directly.