Transfer Matrix in 1D Schrödinger Problems with Constant and Position-Dependent Mass