# What would Galileo do?

Continuing my quest to understand K2 and its potential limitations, here is another simple “physics experiment:”

freefall1.gh (10.5 KB)
There are four “participants” - a single point, a doublet of points, a triplet of points, and 2 points joined by a spring. Two problems:
A- When dropped, the “heavier” doublet and triplet fall faster.
B- The joined points (dumbbell) falls slower than a single point, unless the spring strength is 0.
Clearly, as with my prior experiment with pendulums, it is clear that I don’t understand how K2 handles “mass”.

Simply dividing the load force by the number of points affected “corrects” things - but I have no explanation for the effect caused by points joined by springs:

freefall1 corrected.gh (17.7 KB)

I’d refer again though to my answer here, particularly the bit about the damping:

The solver in K2 prioritizes convergence to a numerically accurate equilibrium solution in a fast and stable way, since for the form-finding applications which it is primarily intended for this is what actually matters. It minimizes the sum of squared distances from satisfying all the goals, which allows fast and precise modelling of the equilibrium solutions of systems of loads and Hooke’s law springs, even with extremely high stiffness values.
This also means it deliberately removes energy. What it converges to can be physically accurate with the right inputs, but exactly how fast things swing or bounce is only approximate.

The ‘bouncy’ solver option was added later in order to allow something visually like the more dynamic behaviour that the original Kangaroo1 had, but it still uses a modification of the projective method used in the regular K2 solver.

The solver in Kangaroo1 is actually a more classical dynamic simulation, with a force and velocity based symplectic integrator that does preserve energy very well when the damping is set to zero. It also has options for setting the mass of individual particles, and this will correctly affect their momentum (K2 does have mass values internally but they are not exposed in the interface). I believe these falling and pendulum examples would give the expected physical results in Kangaroo1. It also worked well for orbital mechanics and faithfully reproduced classical examples for that.
The big downside with K1 though was that stability was dependent on the timestep, and when using stiff elements you would often have to adjust it down to a very small value to ensure things didn’t explode, which made the simulation run slower, and getting this value right could be fiddly and non-intuitive.

I’ve long had it on the to-do list to have another go at adding an option for an integrator that does a better job of both (stability and energy preservation/realistic dynamics), but (a bit to my surprise) it’s almost never come up over the years, so I’ve got the impression it isn’t important to what most people want to use Kangaroo for.
I promise I will have another look at it though. One option would be to simply add in a solver option using the same integration method as K1, and options for mass, but I think there would be some challenges in then presenting it all in a coherent way that doesn’t compromise or complicate the main form finding use.
There have been some good new papers on the topic of stable energy preserving integrators since I last changed this that might work here, and my preference would be to try and make a single system which can do numerically accurate equilibria of even extremely stiff elastic systems, as well as energy preserving dynamics.

1 Like

Thanks @DanielPiker!

You needn’t apologize for not responding quickly (or at all) to my posts - you are very much in demand for reasons that are clear to all. Early on, I didn’t understand that my interest in kinetic phenomena is somewhat outside the scope of K2’s intended use. But you messed up: you made it so good that it even works well for stuff you hadn’t intended . What astounds me, is just how well I can simulate my kinetic work (with a whole lot of help from you). Though my sculptures all use very simple mechanisms coupled to common materials, the complexity of motion they can generate bewitches me. While I’ve used CAD for many decades as an aid to fabrication, I never thought I’d be able to simulate such motion - certainly not in real time! I can’t thank you enough for making it possible. That Kangaroo in its present incarnation does not make it easy to accurately model certain phenomena (like masses in gravitational fields), is completely understandable given the well-reasoned choices you’ve made. Thank you for so patiently explaining (again). But I thrill at your hint that the compromise, between fast / stable equilibrium solution vs. energy preservation / realistic dynamics, may be possible to bridge. I patiently / passionately await whatever progress you make .

1 Like