[SOLVED] Manually step through the physics simulation in Python

[EDIT: After some more playing around, it appeared that the correct solution is to bake the rigid body cache, then step to the required frame in the animation.]

I haven’t been able to find any info on this - is there a way to manually step through/iterate the physics simulation in Python?

Basically, my use case is that I want to automatically render a bunch of images of the outcome of different simple physics simulations, after some time (e.g. after X seconds or Y iterations). I want this to work as fast as possible, so I don’t want to sit through the animations waiting for them to reach some point. There will be thousands of these simulations so speed is key.

Hopefully this makes sense, any ideas?