Newtons' Cradle in Kangaroo 2

Trying to wrap my head around K2 by making some simple projects. Very fiddly to work with. Subtle changes the strength of one node throws everything so crazy out of whack it’s seems almost impossible to find a perfect balance. I know you guys are busy with WIP… just wondering if anything is coming down the pipeline for K2? @DanielPiker

Here’s the Newtons’ Cradle definition if anyone wants to play with it (27.9 KB)

1 Like

Nice definition, thanks for sharing.

I see what you mean. When developing Kangaroo 2, I was mainly focused on applications where the converged solution was the desired output (eg form-finding, rigid mechanical systems, constrained sketches), so was thinking mainly about stability and fast convergence
(this is what I see as the key distinction between dynamic-relaxation and simply simulation of dynamics).

However, this has meant that the solver I am using has a tendency to slightly overdamp things, and for simulations like this, where the actual dynamics are what is wanted it is not always ideal.
I do want Kangaroo to be something that can be used for both though. I’ll see what I can do to improve the dynamic behaviour - I have some ideas of things to try.

This example system is particularly sensitive to small variations in damping and stiffness, and to get the expected effect, where when a sphere hitting one end knocks only one sphere at the other end without disturbing the other spheres much, the collisions need to be extremely stiff and near perfectly elastic.

1 Like

I don’t know if this suggestion is practical to you or no but being able to toggle between a input value for the strength or an absolute would helpful to me as a user. For example the Anchor XYZ in this definition Y is set to true but it will still move in the Y axis depending on the strength input. It would be nice to be able to turn off the strength if I don’t need it and just have the balls move in the Y-Axis only. Same with Length Line, if the sim doesn’t need the length to change it would be very handy just to turn that aspect off.

Might help to run sims faster too if there’s less math for the solver?

Solving for absolute/hard constraints isn’t necessarily always ‘less math’, especially when in combination with soft constraints.

Currently all goals acting on one particle get combined and applied to it simultaneously. Higher weighted goals have more effect (and weightings can be made arbitrarily high to enforce a hard constraint).

One alternative option I have considered though is allowing hierarchical constraints.
So at each iteration, the ‘level 0’ goals would get combined as usual, then the ‘level 1’ goals get combined and the result of level 0 gets projected to this new position.

I decided against it at the time, because it felt like it could complicate the interface too much, and be confusing (for instance, you’d have to choose convergence thresholds for each level), but perhaps it is something worth revisiting.

Thanks for the reply. Absolutely loving the K2! Can’t wait to see what you come up with next!

Fast forward three and a half years, and I’d like to continue this. I have a model with the original in K2 as well as FlexHopper, but I struggle to achieve more realistic behaviour. Any thoughts anyone? (72.6 KB)

Newtons (14.0 KB)

The more I fall in love with K2, the more I want to understand how it works. Not having the math/coding chops to fully do that, I’ve been using a more empiric / intuitive approach recently, by trying to simulate very simple physics demos to see if I can get results that are close to “real.” My first try, with simple pendulums, failed (period appeared to be mass-dependent). My next experiment was what I now understand to be “Newton’s cradle” (after googling “conservation of momentum demo”). After a lot of fiddling with goal strengths and solver iterations, I got what I wanted. Then I searched on the forum, and found this thread.

Reading again that your focus in developing K2 was on converged, static solutions - am I on the wrong path, hoping it can accurately handle intrinsically dynamic systems?

1 Like