Kangaroo2 movement length and strength questions

I am currently working with analysing the deformation of double curved textiles, and have a few questions about Kangaroo2 and how it simulates movement. I have noticed some inconsistencies with my intuitive understanding of it, and am wondering if a better understanding could help making better simulations. I m currently using the normal solver.

  1. From what I read, K2 does not simulate the movement of points by summarising forces and applying acceleration, but by moving them closer to lowest total energy. What is the difference in practice?

  2. K2 is called both a solver and a simulator, but it seems that while my solutions so far have been realistic, the steps towards it have not. Applying goals to points that do not constrain them in a certain direction still seems to slow their movement in that direction. Why does this happen? And if it is unavoidable, can this slowing of movement be viewed as simply taking longer time to reach a solution, or does it have to be accounted for as a type of “friction”?
    This is an issue because unless you are trying to find a theoretically perfect solution for a type of structure like when designing typical tensile structures, there could be many possible solutions. And in my case, the movement of the structure from one state to another can be what decides which solution it “locks” into. If certain parts of the simulation are lagging, it could create the wrong result.

  3. Is there a way to increase step length, ideally change it during the simulation? There seems to be a relation to strength, so I made a function that modulates the strength of everything in the definition. But the relation does not seem to be linear, and even increasing it to ridiculous values that crash the simulation does not create the step length I want.

  4. I have a weird, specific problem related to the line angle, and possibly length goal. It might be related to these questions, but I do not know. To create a directional bending stiffness of my structure, I have decided to use normal lines for each node. Each normal line has angle goals to all of the lines connecting to the node and a length goal to keep it from flipping to the other side.
    This does work, but changing the length of the normal lines changes how it works. With short lines, the goal is quick and responsive. Make the lines long enough, and it does not seem to do anything at all. I can not explain this, and it makes me doubt if it works as intended even though it looks like it with the current settings. I will add real life based goal strengths soon, and would like to know if I can trust this setup if chaning a seemlingly unrelated parameter affects its behavior? Is this related to the slowing of movement described in question 2?

Hi @kais.no

All good questions

  1. This is correct. The biggest difference this causes is a reduction in overshooting and bouncing. Take for instance a single spring, anchored at one end and compressed to less than its rest length. When released, a force/acceleration based approach would push the free end out past the rest length, then it would bounce back to less than rest length etc, and through successive oscillations (depending on the amount of damping) eventually reach the rest length. The big problem with this approach is that depending on stiffness and step length, simulations can sometimes explode.
    The projection and averaging approach used instead in K2 would pull the point straight to the rest length because this minimises the energy.
    Both ways reach the same final equilibrium, but they vary in the steps taken to get there.
    (This is a slight simplification, because to speed convergence K2 does still use a momentum like term between steps, but in a way that avoids most of the problems with the force based approach)

  2. Yes, the final equilibrium state reached can be numerically accurate (for specific types of structure, and with the right inputs), but the steps taken to get there should generally be taken as just visual feedback, or animation rather than strictly accurate simulation of the dynamics.
    It’s true that goals affect movement speed even in directions they do not act in (for instance a strong OnPlane goal will also slow down movement tangential to the plane). This is a downside of the method used, but stability and convergence was the number 1 priority (and this tangential slowdown should not affect the accuracy of the equilibrium reached).
    Things are indeed a bit different when the model doesn’t have a single clear minimum to converge to though. For eg. a catenary or tensile structure (the original intended applications), there is usually one correct solution, or sometimes a small finite number of them it can flip between. However, if you have something which has an infinite range of possible energy minimising solutions (eg a chain falling and crumpling onto a floor), then the only way to guarantee the solution reached was the same as the real world would be to simulate in a way that realistically includes all the friction and dynamics, which K2 will not do.
    See also my answer in this thread What would Galileo do? - #2 by DanielPiker

  3. No, there isn’t really any step length variable as such to modify in the K2 solver, because it is not integrating acceleration-velocity-position.

  4. I’d need to see the setup to understand fully, but if the issue is about 2d bending (where you are concerned with the angle in a specific plane, so the rest angle is on one side), then I have some custom goals that could help, or using the beams with 6dof ends might be more appropriate.

1 Like

I remember we talked about this time ago, @DanielPiker

angle goal study.gh (15.4 KB)
Change initial segment length ^ the shape the polyline create is different every time.
(multiplying “Strength”-es by the initial factor doesn’t help)

This actually make sense, if we see the angle goal as a fixed N*mm or mm^4 resistance: longer segments with same force generate bigger “torque”, obvious.

But usually, working with just compression/stretch goals (Line length goal), at any scale an initial structure will converge to the same shape. With angle goal instead this doesn’t happen, so you have to build a sort of counter-intuitive solution…

All this is probably related to Square–cube law - Wikipedia


Thank you for answering all the questions in a very understandable way. I am a big fan of your work and appreciate the way you interact with the community. It makes learning(and hopefully contributing) from scratch both fun and easy.

About the answers 1 and 4:

  1. I have still had some simulations explode(or at least turn into a vibrating mess) in K2 and not quite understood why. Is this happening in specific cases or is it just that K2 is more resistant to this happening than 1?

  2. I believe that is what I am actually trying to achieve. My structure is supposed to be a type of sheet which wants to bend in a specific direction. So the angle goal should not be able to flip to the other side or work tangentially to the sheet. I have not yet looked into custom goals at all, can you share them? I will also look into beams with 6dof ends.

The structure is a quad mesh with a diagonal cross in each quad. I want bending stiffness along the lines making up the quads if that is relevant to what would be the best solution.
I am not yet sure if also the diagonals lines should have bending stiffness if the goal is to create realistic relations between axial stiffness and bending.

Interesting. I can see how this works because each point has an equal load to it, and the longer the lines, the bigger the bending moment from the force. But I have trouble understanding how this applies in my setup. I have drawn a diagram of how it works here. With lines U and V being the mesh quad edges connecting to this node, and N acting as a sort of mediator that will force the angle goals U, V ; 1, 2 to work in the right direction. The external forces would be on lines U and V, so I understand that changing their length would make a difference. But changing the length of N changes its behavior very noticeably, at least during the simulation steps. Unsure if it changes the end result because it takes a long time to reach.

I would like to share my definition, but this is a project done for a company, so I cannot share it freely.