Questions about Python scripting for physical simulations

I’m relatively new to programming with the Blender API and python, however I’m wondering if it’s possible to create a script that creates a new form of physical simulation. I figured out the maths needed to calculate the simulation per frame, but I’m not sure how to implement it. If anyone could provide insight into implementing frame-by-frame simulation functions and the possibility of using point caches in python scripts, I would greatly appreciate it.