Comparative Advantage: Gains From Trade (2D)
2D production-possibility-frontier lab: set each country's own cloth and wine production rates — even make one country more productive at BOTH goods — and watch the PPF diagram and combined-output bars show why opportunity cost, not raw productivity, decides who specializes in what.
This 2D companion drives the same Ricardian two-country, two-good trade model as the 3D version through the classic textbook diagram it is usually taught with: both countries' production-possibility frontiers plotted on one shared cloth/wine axis pair, each with its autarky point (no trade), its current production point under the chosen specialization level, and its post-trade consumption point — connected by a dashed line so gains from trade are visible directly as the green dot moving past the country's own frontier. A bar chart alongside compares combined world cloth, wine and total value before and after specialization and trade. Four production-rate sliders let you set each country's own output per unit of labor for both goods independently — including a case where one country is more productive at making both goods than the other — while separate Specialization and Trade-amount sliders move labor toward each country's comparative-advantage good and exchange goods between them at the price implied by their two opportunity costs.
Ricardian two-country, two-good model: each country has a fixed labor endowment split between cloth and wine, its production-possibility frontier is the line joining full-cloth to full-wine output, and its opportunity cost of cloth equals the wine-to-cloth output-rate ratio (the PPF's slope). Comparative advantage in cloth goes to whichever country has the lower opportunity cost, independent of absolute productivity. Specialization moves each country's labor split toward its comparative-advantage good; trade exchanges cloth for wine at the price midway between the two opportunity costs, up to the smaller of the cloth-specialist's tradable surplus and the wine-specialist's tradable surplus. Verified algebraically: combined world value at the trade price is provably never lower after specialization and trade than in autarky.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install