Numerical simulation of HgCdTe detector characteristics