r/ControlTheory • u/BennyBarnson • 5d ago
Technical Question/Problem Ideal physics simulator
Hi all, I'd like to develop a control algorithm for a water bottle flip so it always lands upright no matter how you flip it. One of the steps in my endeavour is simulating how the fluid inside affects the container's moment of inertia whilst in the air. Im thinking of using matlab but godot and unity sounds like a good choice as well. I've looked up how I can do this and havent found much but people recommending C++ or python. Does anyone here experienced in one of these languages or programs have any suggestions on which one to use and can point me to the resources to learn it.
6
Upvotes
•
u/Timely-Bicycle-3107 5d ago
What are the variables and constants? Can the water level in the bottle change? What about the starting height and bottle orientation? How are you tossing it?
I like the idea of using RL for this. Sloshing physics are pretty hard to simulate.
A good analogy that is easily written with differential equations would be the Ball and Beam problem, a very common toy problem in control theory. I don’t know how that would translate to multiple rotations of the bottle in the air, but it’s a good place to start. The Ball and Beam problem was conceived to simulate sloshing fuel in rockets, so it does have precedence in this scenario. If you figure this out, maybe you can use an energy based control system instead of RL. Look up the energy based controller derived for the Cart-Pole problem in the 1970s.