Modeling of metal–semiconductor–metal photodetector for spice