system
Given the following post, respond as if you're commenting on Reddit:
human
[Star Wars] How did Luke's Proton torpedos dive down the Exhaust Shaft?

Seriously, they made 90 degrees turns!
gpt
To really tackle this question, we need to examine the practical application of the Death Star. We have to ultimately ask, why does a mobile, man-made fire platform need an exhaust vent?

The deathstar is essentially an enormous fusion engine. It converts energy into destruction. Assuming it uses an antimatter reaction, (which would require magnetic shielding), each blast requires roughly two oil tankers worth of antimatter.  This reaction is clearly conducted in ten different locations around the deathstar and then gravitationally lensed into a resonance that can cause planets to explode. Yes, you are going to have some waste heat from those reactions. But that waste heat can be used to power your enormous planetary spaceship, it probably doesn't need to be 'vented'. So what were those thermal exhaust ports for, if not to get rid of waste heat?

Turns out heat dissipation is one of the largest problems facing extraterrestrial craft of any kind, specifically asymmetric heat distribution. On an object the size of the death star  the difference between the the warm side of the death star (facing the sun) and the cool side of the death star could be up to 500 degrees. Which at 161 km, is almost 2 km! This unnatural stress on the device can been limited by turning on the exhausts on the cold side, which explains not only why they have exhaust vents, but also why they are in a trench since you want that waste heat to expand over a wide surface area. Also, the trench could be built in a manner that minimizes stress from size changes. The equator would show the greatest stress after all. This also conveniently explains the consistent orientation of the Death Star relative to the nearest solar body.

The exhaust vents are magnetically shielded. But that magnetic shielding doesn't seem to do anything to repel proton torpedoes, which should most definitely have a magnetic charge. (Protons are positively charged particles.) Which would mean it is a cation. Which goes a long way to explaining their behavior when they arrive at the exhaust port. They seemed to alter course and drop directly into the port. As if the port was designed to channel cations. This implies two things A) that the thermal exhaust was positively charged, and B) that it was currently not flowing (which would provide resistance to the proton torpedoes). This is born out by the fact that the face of the death star attacked by the X-wings is the side facing the gas giant. This would be the warm side, and thus the exhaust ports on this side would be quiescent. The only reason to leave that magnetic shielding on when it was not in use is because it cannot be turned off at all! That really is a design flaw! Especially since the exhaust port is basically a giant slip and slide for any positively charged particle, like a proton torpedo, and the splash at the end is in an enormous anti-matter reactor!

Theoretically, the easiest way to defeat the trench run would be to turn on the cation flow again, thus creating resistance for the proton torpedos to overcome. Literally, all they had to do to defeat the Rebel Alliance was turn up the thermostat.

TL:DR
Exhaust ports were used to calibrate heat differential.
Exhaust ports were magnetically shielded to conduct warm particles.
Magnetic shielding could not be turned off.
When ports were not in use, explosive charged particles could be sent the other direction.
All the Empire needed to do was turn up the thermostat.