Modeling erbium-doped fiber amplifiers