I'm doing a game with somewhat realistic physics, and I have a system of springs, for this you can imagine a table supported by >=3 springs, if necessary we can assume all spring have the same stiffness.
Visual example of table with springs
What I know:
- Centre of mass of the table (CoM)
- Mass of the table (M)
- Table rotation (Rx/Ry)
- Springs displacement (X)
- Springs stiffness (K)
- Springs position (Px/Py)
What I need:
- Mass or load supported by each spring (Fn)
With some investigation I made some constraints, correct me if I'm wrong (please note that I'm not a mathematician neither physicist):
$$ M * 9.81= F_1+F_2+...F_n $$ Spring equation: $$ \sum_{i=0}^n X_n = \frac{F_1}{K_1}+\frac{F_n}{K_n}+...\frac{F_n}{K_n} $$ Torque forces in equilibrium in x/y: $$ \sin(Rx_1)F_1Px_1 + \sin(Rx_2)F_2Px_2 + \dots + \sin(Rx_n)F_nPx_n = CoM_X $$ $$ \sin(Ry_1)F_1Py_1 + \sin(Ry_2)F_2Py_2 + \dots + \sin(Ry_n)F_nPy_n = CoM_Y $$
I found online a way to solve a problem when I have 4+ springs, so I tried to do a constrained minimization using lagrange multipliers, using the function f = sum((Fn - Mu)^2). Where Mu is the mass average.
Will this work? I tried to make some calculations and I got weird values I not used to this kind of problem, so I'm taking the right direction?