# 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.

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

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

2 Likes

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.