Understanding some simple phenomena in thermoacoustics with applications to acoustical heat engines