  We study work extraction (defined as the difference between the initial and
the final energy) in noninteracting and (effectively) weakly interacting
isolated fermionic quantum lattice systems in one dimension, which undergo a
sequence of quenches and equilibration. The systems are divided in two parts,
which we identify as the subsystem of interest and the bath. We extract work by
quenching the on-site potentials in the subsystem, letting the entire system
equilibrate, and returning to the initial parameters in the subsystem using a
quasi-static process (the bath is never acted upon). We select initial states
that are direct products of thermal states of the subsystem and the bath, and
consider equilibration to the generalized Gibbs ensemble (GGE, noninteracting
case) and to the Gibbs ensemble (GE, weakly interacting case). We identify the
class of quenches that, in the thermodynamic limit, results in GE and GGE
entropies after the quench that are identical to the one in the initial state
(quenches that do not produce entropy). Those quenches guarantee maximal work
extraction when thermalization occurs. We show that the same remains true in
the presence of integrable dynamics that results in equilibration to the GGE.
