# What's the maths behind the movements of a two-legged air dancer (aka skydancer, tube man)? How can I simulate its behavior?

I am trying to understand the maths behind the movements of a two-legged air dancer, aka skydancer aka tube man. Well, I mean these cheery friends here:

The following discrete time algorithm is my devised solution, but I am sure that other much better approaches are possible. Indeed it is not very realistic and I am not very happy. I would like to learn other solutions more closer to reality and related with dynamical systems, complex dynamics or fluid dynamics:

1. Take for instance a unit square, same width and height. Then generate two partially (explanation of the "partially" wording is done below) random walks with these rules:

2. The first partially random walk $R1$ starts at $(0,0)$ and finishes at $(1,1)$

3. The second random walk $R2$ starts at $(0,1)$ and finishes at $(1,0)$

4. We will generate $n$ random points sequentially for $R1$ as follows. The first point is $(x_0,y_0)=(0,0)$, then we will take a random point from the intervals $([0,1],[0,1])$, it will be $(x_1,y_1)$. Then $(x_2,y_2)$ will be a random point from the intervals $([x_2,1],[y_2,1])$, then next point $([x_3,1],[y_3,1])$, etc. So we are approaching $(1,1)$ on each iteration. Usually $n=20$ iterations is good enough to be visually very close to $(1,1)$ so the simulation is good enough. The reason of the "partially" wording is that on every iteration we reduce the intervals, so it is not always a random point of the square unit, so it is not totally random.

5. In the same fashion we will generate points for $R2$ but the intervals will approach on each iteration to $(1,0)$.

6. Now we will create segments joining the sequential points of $R1$ and same for $R2$.

7. As both paths are crossing completely each diagonal of the square unit, there is an intersection point between them. Mark with a disk the intersection of both random paths and display the unit square including the segments and the intersection.

8. Execution: the algorithm can be looped for an infinite time of $t$ units in a loop, and each iteration $t$ will generate the aspect of the air dancer for that unit of time. So in my case the algorithm makes a kind of discrete system.

And this is how looks my air dancer simulation:

And another one with two dancers:

Some facts and trivia:

1. Due to the way that the segments are generated, the lengths of them are not totally random, see the square line picking problem.

2. The above solution might be defined as a kind of discrete map where each unit of time $t$ is independent of the status of the previous unit of time (but this can be modified to make movements depend on the previous unit of time at some extent so it would be a standard discrete-time map).

3. The algorithm works for any square, not only the unit square, it is just an example. They can be any desired width and height.

4. The legs of the air dancers are usually fixed to the ground, but not the arms, and that is a part of my simulation that is not very realistic (apart from others) although I think that it would be more or less easy to enhance this point specifically.

My questions are:

1. How can I simulate this kind of objects with a more realistic approach? What's the maths behind it?

2. Initially I did not find a reference on internet, but this must be very related to dynamical systems and more specifically to fluid dynamics. Is it possible to express the movement by a discrete (map) or continuous (based on derivatives) dynamical-system? I appreciate any insights, thank you!

P.S.: if somebody is interested in the Python code please let me know and I will add it to the question.

Update 2017/11/16: finally I have uploaded the code to my repl.it account (link here). It cannot be run online because it requires the pygame library, but it will work in, for instance, a personal computer using Python Anaconda if the pygame library is downloaded as usual. Feel free to use and modify it and enjoy!

• If the Python code is quite long, I would suggest putting it on Pastebin and linking to it here. Nevertheless, I think this is more a physics question first with a lot of math in it. – J. M. is a poor mathematician Nov 15 '17 at 5:16
• @J.M.isnotamathematician thanks for the reference, I use for instance repl.it because basically my simulations are Python code (or PARI/GP). I believe that a dynamical system could do the maths, at least much better than my solution. Hope somebody will be able to provide some insights about it. – iadvd Nov 15 '17 at 5:27
• Also, wandbox would be a good fit if you have the complete code – polfosol Nov 15 '17 at 6:38
• @polfosol I did not know that one and looks quite good indeed! thanks! – iadvd Nov 15 '17 at 6:39