I've got a problem about physics modeling in a really particular case. I'm not exactly sure if i have to ask it into physics or gamedev,but i suppose the problem is best suited here, since it is about modeling. I'm not really good with physics, so I'll try to improve this post's formulation regarding answers.
First, let's go for some context
(that's not mandatory, you can skip if needed). I'm currently implementing a -supposedly- lightweight game engine using a predictive approach : instead of simulating on a succession of interval and therefore looking at "what happened" after each interval (frame) to update the state of the simulation, I look in the future for when the next state changing event (for example a collision) happens, and I only recompute simulation when the event occurs. For physics, it means that my collision detection takes acceleration and speed in account.
if only physics simulation is taken in account, this gives something like this :
"traditional approach" : move bodies by the interval time -> detect collision by interpenetration -> update simulation -> move bodies by the interval time
"predictive approach" : compute when the next collision occurs -> wait for the game's clock to reach next collision time -> update bodies involved in the collision -> compute when the next collision occurs -> etc
Now, the problem
I therefore need to compute acceleration and speed of bodies in order to perform collision. Please note that in my simulation, I do not want rotation involved, so every movement is translation. Computing acceleration for an isolated rigid body is trivial (it's the sum of forces on the rigid body divided by the mass), as Newton's law states. Body can have any shape, but it's ok to restrain shapes to convex shapes.
collision with several bodies involved
One problem comes when a collision involves several bodies, as described in this post (not mine), to compute resulting speed change of every bodies involved in the collision. Since this already has a quite good solution, I think there is no need for solving it again.
Several bodies "sharing" forces
My problem is to compute resulting acceleration when several bodies "shares" their resulting forces :
We can see that A and B are "pushing" in the same direction. By "pushing", I mean that the net force affecting isolated A and isolated B (if there were no contact at all). Let's call them Ra and Rb. Intuitively, if we consider A, B, C and D to have equal mass Mi, and Ra and Rb to be equal as well, with no other forces involved, the resulting acceleration Acc per body is
$ Acc = (Ra + Rb) / (Ma + Mb + Mc + Md) $
But when cases becomes complicated, I struggle to see how to solve the problem :
case 1 : one object is distanced by others
Here A and B are pushing together, yet, push of A is much much less than push of B, so instantly after this instant, A will be distanced by the group, therefore, A push shall not influence neither B or C. Here my problem is detecting efficiently when a force has no relation with another.
Case 2 "resisting" forces
Second problem I encounter is when objects are subject to forces which adapt to counter other forces up to a certain threshold, as for example friction (represented by circles on C and D).
Case 3 : forces depending on other forces
Third problem (and the worst of all), which can eventually be removed for game simulation purpose, is when forces are depending over each other. :
Here we suppose D has an infinite mass, it can't move. There is no friction between B and D. A is pressing B on D, while "dragging" B along the border of D, through friction represented by a circle. The more A presses B on D, the more the friction will be strong between B and A, and therefore the more A will efficiently drag B along.
Kind of solution I'm looking for
I feel like this problem is meant to be solved as an equation system or alike, since it involves finding a "balance point" between every forces computing against each other.
I'm currently trying to model relations between bodies like a graph to parse to exchange forces according to the "action-reaction" principle (a body applying a force to another body will get the opposite force applied to in return).
It seems it will lead to a tremendous algorithmic complexity, which is unwanted in the case of real-time game.
I would appreciate an already existing solution (well, that's logic) if one of you have it, but hints and modeling thought are more than welcome, they will be precious for me. Also, if you spot wrong formulations in the post, please let me know so I can change it.
Thanks you for reading !
EDIT I found a solution based on linear programming, I will take some time to check its robustness and then I'll add it as a solution



