Sounds like something you might need a program running on a digital computer to answer. But an analog computer built with a handful of op amps can model a ball in a box pretty handily too.