
Fluid dynamics, lock engineering, and the deadliest construction project in history.
The French Disaster
In 1881, Ferdinand de Lesseps — the man who had built the Suez Canal — arrived in Panama with a plan to do it again. He would cut a sea-level canal straight through the Continental Divide, connecting the Atlantic and Pacific oceans. It would take eight years, he said. It would cost 600 million francs.
He was wrong about everything.
The Suez Canal had been built through flat, dry desert. Panama was the opposite: a strip of land covered in tropical rainforest, crossed by rivers that flooded violently in the rainy season, and underlain by a chaotic geology of volcanic rock, soft clay, and unstable shale. The highest point of the route — the Culebra Cut through the Continental Divide — was 110 metres above sea level.
De Lesseps insisted on a sea-level design. No locks, no steps — just dig a trench from one ocean to the other. His engineers warned him that this would require excavating 120 million cubic metres of earth and rock. He ignored them.
But the real killer was not the geology. It was the mosquito.
Death by Mosquito
In the 1880s, no one knew that malaria was transmitted by mosquitoes. The leading theory was that the disease was caused by "bad air" — mal aria in Italian — rising from swamps. The French hospitals in Panama kept their patients' beds cool by placing the bed legs in dishes of water. They planted flowers around the hospital grounds for the patients' comfort. They did everything they could to create a pleasant healing environment.
They were, unknowingly, breeding mosquitoes. The dishes of water were perfect nurseries for mosquito larvae. The flowers attracted more mosquitoes. The open windows let them in.
Between 1881 and 1889, more than 20,000 workers died — mostly from malaria and yellow fever. The death rate was so high that the Panama Railroad, which ran alongside the canal route, kept a permanent train of flatcars ready to haul corpses to mass graves. Workers called it the "death train."
In 1889, the project collapsed. The French company went bankrupt. De Lesseps was convicted of fraud. The greatest engineering project of the 19th century had been defeated by a mosquito.
The American Insight
Fourteen years later, the United States took over. The chief engineer was John Frank Stevens, a railroad man who understood one thing the French had not: you don't fight geography. You work with it.
Stevens looked at the 110-metre-high Continental Divide and asked a simple question: "Why are we trying to dig through this? Why not go over it?"
His solution was locks — a series of water-filled chambers that would lift ships up to the level of an artificial lake, carry them across the Divide on the lake, and lower them down on the other side. Instead of excavating 120 million cubic metres to sea level, they would excavate only enough to create the lake and the lock channels.
The key insight was that locks need no pumps. They work entirely on gravity. To fill a lock chamber, you open a valve at the bottom of the chamber. Water flows in from the higher lake above, lifted by nothing more than the weight of the water itself. To empty the chamber, you open a valve at the bottom and let the water drain to the lower level. The entire system runs on the most abundant and reliable force on Earth: gravity pulling water downhill.
How a Lock Works
Imagine a bathtub with a drain at each end. One end connects to a lake 26 metres above sea level. The other end connects to the ocean at sea level.
A ship enters the low end. The gates close behind it. You open the valve connecting the lock to the lake above. Water pours in — 100 million litres of it, enough to fill 40 Olympic swimming pools. The water level rises, and the ship rises with it, floating on the surface like a rubber duck in a filling bathtub. When the water level inside the lock matches the lake level, the upper gates open, and the ship sails out onto Gatun Lake, 26 metres above the ocean it just left.
On the other side, the process reverses. The ship enters a descending lock. The valve opens. Water drains out. The ship sinks with the water level, gently, until it reaches the Pacific Ocean.
The entire transit takes 8 to 10 hours. The ship travels 82 kilometres. It rises 26 metres, crosses a lake, and descends 26 metres. And not a single pump is used.
The Disease Solution
But none of this engineering would have mattered if the Americans hadn't solved the mosquito problem first. In 1904, Colonel William Gorgas — the chief sanitation officer — arrived in Panama armed with a new theory: that malaria was carried by the Anopheles mosquito and yellow fever by the Aedes aegypti mosquito.
Gorgas declared war on standing water. His teams drained swamps, filled puddles, oiled the surfaces of ponds and ditches (oil prevents mosquito larvae from breathing at the surface), installed screens on every window in the Canal Zone, and fumigated buildings with pyrethrum smoke.
The results were dramatic. Yellow fever, which had been killing hundreds of workers per year, was eliminated entirely by 1906. Malaria rates dropped by 90%. The death rate fell from the French era's catastrophic levels to rates comparable with construction projects in the United States.
It was one of the first great victories of epidemiology — the science of understanding how diseases spread through populations. And it happened not in a laboratory but on a construction site in the jungle.
The Canal Opens
On August 15, 1914, the SS Ancon became the first ship to transit the Panama Canal. It took nine hours and forty minutes. The ship rose 26 metres through three locks at Gatun, crossed Gatun Lake, passed through the Culebra Cut, and descended through three more locks at Pedro Miguel and Miraflores to the Pacific.
The canal had taken ten years to build. It had cost $375 million (about $12 billion in today's money). More than 5,600 American-era workers had died, in addition to the 20,000 French-era deaths.
But it worked. And it changed the world. A ship sailing from New York to San Francisco no longer had to go around Cape Horn — a journey of 22,500 kilometres. The canal cut it to 9,500 kilometres. Global trade routes were redrawn overnight.
Today, about 14,000 ships pass through the Panama Canal every year. Each one rises and falls on gravity-fed water, through lock chambers built more than a century ago — a monument to the insight that the best engineering doesn't conquer nature. It cooperates with it.
The end.
Choose your level. Everyone starts with the story — the code gets deeper as you go.
Here is a taste of what Level 1 looks like for this lesson:
import numpy as np
import matplotlib.pyplot as plt
# Your first data analysis with Python
data = [45, 52, 38, 67, 41, 55, 48] # measurements
mean = np.mean(data)
plt.bar(range(len(data)), data)
plt.axhline(mean, color='red', linestyle='--', label=f'Mean: {mean:.1f}')
plt.xlabel("Sample")
plt.ylabel("Value")
plt.title("Fluid Dynamics & Lock Engineering — Sample Data")
plt.legend()
plt.show()This is just the first of 6 coding exercises in Level 1. By Level 4, you will build: Build a Canal Lock Simulator.
Free
Level 0: Listener
Stories, science concepts, diagrams, quizzes. No coding.
You are here
Level 0 is always free. Coding levels (1-4) are part of our 12-Month Curriculum.
How gravity moves ships across a continent — fluid dynamics, buoyancy, and the epidemiology that made it possible.
The big idea: "The Panama Canal" teaches us about Fluid Dynamics & Lock Engineering — and you don't need to write a single line of code to understand it.
Imagine you're standing in a bathtub. Someone starts filling the tub with water. As the water level rises, you rise with it — you're floating, and the water carries you upward. You don't need a crane, a pulley, or any machinery. Just water, flowing in from a tap.
A canal lock works exactly the same way, but on a massive scale. A lock is a water-tight chamber — basically a giant bathtub — with gates at each end. A ship sails in through the lower gate. The gate closes behind it. Then a valve opens, letting water flow in from the higher level above. The water level in the chamber rises, and the ship rises with it.
When the water inside the lock reaches the same level as the water on the high side, the upper gate opens, and the ship sails out — now 8 or 9 metres higher than when it entered. No pumps, no engines, no electricity. Just gravity pulling water from a high place to a low place.
The Panama Canal uses three locks going up (Gatun Locks, on the Atlantic side) and three locks going down (Pedro Miguel and Miraflores, on the Pacific side). Each lock raises or lowers the ship about 8-9 metres. Total lift: 26 metres — the height of Gatun Lake above sea level.
Check yourself: If the lock uses no pumps, where does the energy come from to lift a 50,000-tonne ship? (Hint: where is the water coming from, and where is it going?)
Key idea: A canal lock lifts ships by filling a chamber with water from a higher source. The ship floats upward as the water level rises. No pumps are needed — gravity pulls water downhill from the lake above, and buoyancy does the lifting.
A nail sinks in water. A ship made of steel floats. Both are made of metal. So why the difference?
The answer is shape. A nail is solid steel all the way through — its density (mass per volume) is about 7.8 g/cm³, much heavier than water (1.0 g/cm³). But a ship is mostly air. The steel hull is thin, and the interior is hollow. If you could take all the steel in a ship and calculate the average density of the entire ship (steel + air inside), it comes out to about 0.2-0.3 g/cm³ — less dense than water. So it floats.
Archimedes' principle explains exactly how much the ship sinks: it sinks until the weight of the water it pushes aside (displaces) equals the weight of the ship itself. A loaded cargo ship sits deeper in the water than an empty one — it needs to displace more water to support its greater weight.
In the Panama Canal locks, the ship floats regardless of the water level. When the lock is filling, the ship doesn't "struggle" to rise — it simply continues floating at the surface as that surface moves upward. The water does the work. The ship is just along for the ride.
Prediction: A lock chamber in the Panama Canal holds about 100 million litres of water. A large container ship weighs 50,000 tonnes. When the ship enters the lock, what happens to the water level in the lock? (It rises — because the ship displaces water, pushing it up.)
Key idea: Ships float because their average density (steel hull + air inside) is less than water. Archimedes' principle: any floating object displaces its own weight in water. In a lock, the ship floats at the surface regardless of the level — it rises automatically as water fills the chamber.
Access all 130+ lessons, quizzes, interactive tools, and offline activities
The French attempt to build the canal killed **over 20,000 workers** — not from construction accidents, but from **malaria** and **yellow fever**. The...
The French planned to dig a **sea-level canal** — a straight trench from Atlantic to Pacific, at ocean level, with no locks. This is how the Suez Cana...