(This is an edited version of the original question, since I'm starting a bounty)
I'm trying to find a function $y$ from given data. Reverse optimization, so to speak.
Say we have two (two-dimensional) bodies $A$ and $B$ of known (but arbitrary) shapes at known positions relative to each other. There are forces of attraction and repulsion between the two bodies, but I only know that the bodies are in stable equilibrium. If I understand "equilibrium" correctly, that means that the total force is zero and the total energy is minimized (or is that wrong to begin with?).
Let's assume we suspect that the force between two differential elements in the bodies (one element in one body, the other one in the other body) is given by a function $y({\bf r})$. ${\bf r}$ could be the coordinates of the elements $[x_1,y_1,x_2,y_2]$ or more complicated things, but let's assume it's simply the distance between the elements for now. The total force between the two bodies would then be: $ \int_A \int_B y(r) \: dA \: dB$
If have a couple thousand of such equilibrium configurations, with known body shapes and known body positions is there any way for me to find out what the function might look like? With actual, discrete data, and descriptions of the bodies -- can I get a numerical approximation somehow? E.g., is there a way to turn this into a system that can be least-square-approximated, for example?