Simulation:

Theory: