Computational study of an optical NEMS sensor