Theory and practice of simulation of optical tweezers