Numerical simulations of physical equations of motion always involve a discretization of time, and as the time step is increased the discrete-time behavior becomes increasingly different from that of the continuous-time equations of motion. This feature creates a dilemma for any simulation of a dynamical system: use a small time step, resulting in dynamics that resemble continuous-time behavior at the expense of efficiency; or use a large time step that makes the simulation finish sooner at the expense of meaningful evolution. It is therefore essential to understand the features of different algorithms, such that optimal properties can be chosen for a given set of problems and objectives. Our aim is here to investigate and improve the simulation techniques for systems in thermal equilibrium. We briefly review our recent simple derivation  of a stochastic Stormer-Verlet algorithm for the evolution of Langevin equations in a manner that preserves proper configurational sampling (diffusion and Boltzmann distribution) in discrete time. The method, which is as simple as conventional Verlet schemes, has been numerically tested on both low-dimensional nonlinear systems as well as more complex molecular ensembles with many degrees of freedom . In light of the fundamental artifacts introduced by discrete time, we provide a simple intuitive picture of the unique benefits of our algorithm, which can give accurate configurational sampling in discrete time. We then introduce a new companion algorithm for controlling pressure in molecular ensembles; i.e., a barostat for so-called NPT simulations . Drawing on the idea of Andersen, we consider a global variable (a virtual piston), which emulates the dynamics of the simulated volume in systems with periodic boundary conditions. However, our description of the dynamics is defined differently from previous work and leads to a very simple set of discrete-time equations that is easily implemented and tested for statistical accuracy in existing MD codes. Throughout the talk, we review and identify the commonly overlooked fundamental time-step problems that arise in dynamical simulations where simulated momentum is not exactly the conjugate variable to the associated position. We sketch the derivation and motivation for our new algorithm, and show favorable comparisons against state-of-the-art algorithms when simulating molecular ensembles at constant pressure and temperature.
 Gronbech-Jensen & Farago, Molecular Physics Vol.111, 983 (2013).
 Gronbech-Jensen, Hayre, & Farago, Computer Physics Communications, Vol.185, 524 (2014).
 Gronbech-Jensen & Farago, Journal of Chemical Physics 141, 194108 (2014).