I'm working on a problem involving the acoustic transmission of a impact-generated shockwave through a layered material. In the following $Z$ refers to acoustic impedance and $v$ the impact velocity. The initial impact generates a pressure, $ p_{\text{in}} = v\cdot\frac{Z_1Z_2}{Z_1 + Z_2}. $ The transmission of the pressure wave from the $n$-th medium to the $(n+1)$-th reduces the amplitude by a factor $ \frac{2Z_{n+1}}{Z_n + Z_{n+1}}. $ Hence for an $n$-layer system, the pressure after the final layer is $ p_{\text{out}} = v\cdot2^{n-2}\frac{\displaystyle\prod_{k=1}^{n}Z_k}{\displaystyle\prod_{k=1}^{n-1}(Z_k + Z_{k+1})} $
My question is this, how do I find the maximum value of this function? That is to say, the number of layers and all the values of $Z$ can be chosen independently (where the physical range of $Z$ is $0$ to $100$), which choices give the maximum value?
Many thanks in advance for any help or hints offered,
Nick