Lab-on-a-chip (LOC) devices capable of manipulating micro/nano-sized samples have spurred advances in biotechnology and chemistry. Designing and analyzing new and more advanced LOCs require accurate modeling and simulation of sample/particle dynamics inside such devices. In this video, researchers present a generalized computational physics model to simulate particle/sample trajectories under the influence of dielectrophoretic or optical forces inside LOC devices. The model takes into account time varying applied forces, Brownian motion, fluid flow, collision mechanics, and hindered diffusion caused by hydrodynamic interactions. Researchers develop a numerical solver incorporating the aforementioned physics and use it to simulate two example cases: first, an optical trapping experiment, and second, a dielectrophoretic cell sorter device. In both cases, the numerical results are found to be consistent with experimental observations, thus proving the generality of the model. The numerical solver can simulate time evolution of the positions and velocities of an arbitrarily large number of particles simultaneously. This allows researchers to characterize and optimize a wide range of LOCs. The developed numerical solver is made freely available through a GitHub repository so that researchers can use it to develop and simulate new designs.