A quasi-analytic model for longitudinally non-uniform semiconductor optical sources