Hello,

I am currently working on a project with Kangaroo solver. I use different goals at the same time and I would like to understand how does the strength of the GoalObjects works within the solver. Is it just a weighting of the different goals when they are summed together or is it more complex?

Thank you very much for your help!

Best, Dorsan

Hi @dorsan.dallemagne

Yes, the strength is a weighting for how the goals are combined.

Each goal has a rest state for the particles it acts on, at which the constraint is satisfied and its potential energy is zero. For instance, a `Length`

goal is in its rest state whenever its 2 particles are the given distance apart.

The energy of a goal is the half the squared distance of its particles from their rest state, multiplied by the weighting of that goal.

(The energy is proportional to *half the squared distance* because the *force* is proportional to the displacement, which is Hooke’s law for elasticity, and energy is what we get when we integrate that)

What the Kangaroo solver does is minimize exactly the sum of all these energies for all the goals.

Because it is consistent with Hooke’s law it can model linear elastic behaviour with real quantities.

If none of the goals conflict with each other, they will all reach their rest state where the total energy is zero, and their relative weightings only affect the route it takes and how quickly it gets to this equilibrium.

Often though, you will want goals which act against each other, and systems where it is impossible for all the goals to be satisfied simultaneously, and here weighting one higher relative to the others will give satisfying that goal higher priority.

If you have one goal you want to act more as a hard constraint, you can increase its weighting arbitrarily high, so that it effectively overrides any other goals acting on the same particles.

4 Likes

Thank you very much for your answer @DanielPiker ! I now understand better the interest of the strength

1 Like