Computer simulation and optimization of a light addressable potentiometric sensor