# Why is rapid expansion/compression reversible?

I am looking over the Otto Cycle on this MIT website and it says at one point "the processes from 1 to 2 and from 3 to 4 are isentropic" in reference to the expansion and compression of the piston. I understand however that the compression and expansion in an internal combustion engine is quite violent and quick. And according to wikipedia "Throughout an entire reversible process, the system is in thermodynamic equilibrium, both physical and chemical, and nearly in pressure and temperature equilibrium with its surroundings." However this isn't the case for our expansion and compression is it? the pressure and temperature of our expansion/compression is not in equilibrium? It also says "reversible processes are extremely slow (quasistatic)". But once again, our expansion/compression isn't slow at all?

I've noticed, there are many processes that seem to be described as isentropic that from what I can tell are not in equilibrium with their environment throughout and are not quasistatic (my book for example says pumps, turbines, nozzles, and diffusers perform isentropic operations)? So through what justifications are these approximations made?

The main reason I ask this question is because I am attempting to calculate the pressures in a gun barrel, and I have seen the process described as isentropic (adiabatic and reversible) but for the same reasons as the Otto cycle, cannot understand how this would apply. The gun barrel acts similar to a rapidly expanding piston. Ignition, rapid expansion of gases against bullet (piston), then bullet (piston) leaves and the gases diffuse rapidly into the atmosphere. How is this reversible or quasistatic in any way? If anyone has an idea regarding the gun barrel and what process it is that would be appreciated as well.

The heat exchanged in the process can be related to the change in entropy through the second law of thermodynamics, which can be stated as $$dS = \frac{dq_{\textrm{rev}}}{T}$$ For a reversible adiabatic process $$dq_{\textrm{rev}}$$, the quantity of heat exchanged during an infinitesimal step of the process, is zero, and it follows that the total entropy change is zero: $$\Delta S = \int_1^2 dS = \int_1^2 \frac{dq_{\textrm{rev}}}{T} = 0$$ This explains the conclusion that the process is isentropic. The diagrams in the MIT course lecture notes show that this is an idealization. The true Otto cycle is not isentropic. The ideal and real cycles are arguably similar, however.