Modeling of a-Si:H n-i-p detectors