Mathematical Foundations and Simulation Algorithms