Diesel engines are ubiquitous: They power everything from passenger vehicles to delivery trucks to bulldozers to trains to ships. The US Department of Energy (DoE) refers to them as the 鈥渨orkhorse engines.鈥

But in the past, they had a severe image problem. As the agency notes in a pamphlet detailing the basics of diesels, they were 鈥渄irty and sluggish, smelly and loud.鈥

鈥淭hat image doesn鈥檛 apply to today鈥檚 diesel engines, however, and tomorrow鈥檚 diesels will show even greater improvements. They will be even more fuel efficient, more flexible in the fuels they can use, and also much cleaner in emissions,鈥 the agency says.

Diesel engine is an internal combustion engine that converts chemical energy in fuel to mechanical energy. It is the mechanical energy that moves pistons up and down in the enclosed spaces called cylinders.

These pistons are connected to the crankshaft, whose movement switches from linear to rotary to propel the wheels.

As the fuel reacts chemically with oxygen, a series of small explosions occurs, releasing energy. In a diesel engine, the fuel ignites on its own.

鈥淎ir heats up when it鈥檚 compressed,鈥 DoE says. 鈥淭his fact led German engineer Rudolf Diesel to theorize that fuel could be made to ignite spontaneously if the air inside an engine鈥檚 cylinders became hot enough through compression.鈥

The inventor of the diesel engine calculated that high compression should lead to high engine efficiency. 鈥淧art of the reason is that compressing air concentrates fuel-burning oxygen,鈥 the agency says.

And if a fuel has high energy content per gallon and is injected into the cylinders at the right time, it should react with most of the concentrated oxygen to deliver 鈥渕ore punch per explosion.鈥

DoE says Mr. Diesel鈥檚 calculations were correct. 鈥淎s a result, although diesel engines have seen vast improvements, the basic concept of the four-stroke diesel engine has remained virtually unchanged for over 100 years.鈥

The first stroke involves the air being sucked into a cylinder while the piston creates a space for it by distancing itself from the intake valve. After the piston swings upward, the air is compressed and heated. Before the piston reaches the top of its compression stroke, the fuel is injected under high pressure and then ignites spontaneously upon contact with the heated air.

鈥淭he hot combustion gases expand, driving the piston downward in what鈥檚 called the power stroke. During its return swing, the piston pushes spent gases from the cylinder, and the cycle begins again with an intake of fresh air,鈥 DoE says.

Gasoline engines, like diesel engines, work by internal combustion. They have slight differences, though.

鈥淚n a gasoline engine, fuel and air is injected into small metal cylinders. A piston compresses (squeezes) the mixture, making it explosive, and a small electric spark from a sparking plug sets fire to it. That makes the mixture explode, generating power that pushes the piston down the cylinder and (through the crankshaft and gears) turns the wheels,鈥 explains Chris Woodford, a British science writer who runs the Web site Explain that Stuff.

Mr. Woodford notes that theoretically the gasoline engine, with its spark plug, should be more efficient than the diesel engine. The reality is different: It is the diesel engine that is substantially more efficient than the gasoline engine.

鈥淚n simple terms, that means you can go much further on the same amount of fuel (or get more miles for your money),鈥 he said. One reason is that the fuel is easily compressed in the diesel engine because it requires no sparking-plug ignition system.

鈥淭here鈥檚 another efficiency saving too. In a gasoline engine that鈥檚 not working at full power, you need to supply more fuel (or less air) to the cylinder to keep it working; diesel engines don鈥檛 have that problem so they need less fuel when they鈥檙e working at lower power,鈥 Mr. Woodford said.

The fuel that diesel engines use also gives them several more advantages. Diesel fuel, which Mr. Woodford described as a lower-grade and less refined petroleum product made from heavier hydrocarbons, contains more energy per gallon because the molecules have more energy locking the atoms together.

鈥淒iesel is also a better lubricant than gasoline so a diesel engine will naturally run with less friction,鈥 Mr. Woodford said.