I need a sanity check. I am comparing two expansion processes with the same volume change. In both processes, there is a load on a piston that needs to be lifted a specified height. The piston cylinder is filled with a gas.
For the first process, the gas is heated reversibly so that the internal pressure is constantly equal to the external pressure (atmosphere + load). The amount of work done by the gas in this reversible process is $ W=p \Delta V $.
For the second process, the piston is pinned at its initial height, and the gas is heated at constant volume. Once the gas is heated sufficiently, the pins are removed and the gas is allowed to expand irreversibly and adiabatically against the constant external pressure (atmosphere + load). For this set of processes, the work done by the gas is still $W = p \Delta V $.
The initial and final states of the two processes are the same, so $ \Delta U $ for the two processes must also be equal. Because $\Delta U$ and $W$ are equal, the heat transfer into the gas must also be equal.
So my question is: Am I correct that the heat and work involved in these two processes, one which is a single-step reversible process and another which is a two-step irreversible process, are equal? Am I missing something in this analysis? This seemed surprising at first glance, though after I considered what these processes might look like on a $p-V$ diagram they seemed to be roughly the same. For the two-step irreversible process, the gas pressure isn't well-defined, but one could imagine that once the pins are removed, the local pressure next to the piston head would be roughly equal to the external pressure throughout the process, and so the fact that the two work values are the same perhaps makes sense.