52 States in 8 Months

Integrating unstable and chaotic systems

Posted in University stuff by Ulf on May 8, 2009

A young Ph.D. student in our group is working on the simulation model of a multi-bar-linkage since a few weeks. She was already working on this problem before I went to Las Vegas, and that was in March. Actually it’s really a simple system, but our adviser wants her to use some strange method which is … well, strange. Now, I spent the last few hours on setting up the dynamic equations with the standard Lagrange formalism and some holonomic constraints which I could directly put into the Lagrangian. Well, to sum things up, my simulation model was written down after a few hours and it worked immediately.

Well… if things were so simple, then I wouldn’t write about it on this blog. The bars in this linkage system had roughly a length of l=10m. The gravity constant is g=9.81m/s2, and a linearization yields T=sqrt(l/g). I’ve therefore concluded that the time constants in this system are at roughly 1s. I think this fits with what you see in the simulation plots. I thought that a simulation step size of 0.1s would be sufficient to get acceptable results, so I set the MaxStep bound of ode45 to 0.1s. The left-hand side figure shows my first simulation result (the plotted values are angles in radians). On the second plot you can see the overall system energy.

sim11 sim12

I wasn’t adding any energy to the system, so I decided that the total energy was fluctuating a bit to much in the simulation. Maybe taking a maximum step size of 0.05s would be better?

sim21 sim22

See the difference? The pink link doesn’t infinitely turn around now, but instead it oscillates from a little less than -π to a little more than 0. Everybody knows that pendulums are chaotic systems, where a small change in a parameter or an initial condition can yield a complete change in the overall system behavior. Now, apparently the numerical errors due to the finite step size can cause the same effect.

To get better results, I’ve reduced the step size to 0.01s, with this disappointing outcome:

sim31 sim32

Instead of decreasing the fluctuations in the total energy I’ve increased them. I hate chaotic systems. And unstable systems. And especially systems which are both unstable and chaotic. Still, I’m already much further than our poor Ph.D. student, so I’ll send her the results and go home. It’s already 10:40pm. I shouldn’t spend so much time in the lab.

Edit: Just before I left I realized that I had to chose different initial conditions to address her problem. I chose my step size at about 0.02s, and I like the results. The animation however doesn’t really look physical, so I might still have screwed something up. It’s 11:54pm now. I’ll be leaving tomorrow. FML.

sim41 sim42


6 Responses

Subscribe to comments with RSS.

  1. scytale said, on May 8, 2009 at 12:58 pm

    I was wondering why you use the term “chaotic” especially in the context with pendula. At least for pendula there are nonlinear equations to completely describe the behaviour. Can’t you predict any motion then? Therefore I would not relate it to chaotic bevahiour. Just a thought…

  2. Ulf said, on May 8, 2009 at 2:00 pm

    You are right about the nonlinear equations, but that is what chaos is all about:
    Even if the system is (theoretically) fully determined, it shows an unpredictable behavior. A tiny change in the initial condition of such a system will change the result of a simulation completely. The same goes for a small uncertainty in a parameter or a little numerical error.

    I’ll try to give an easy example: Think of an inverted pendulum without friction. If it has a slight displacement angle from its upper steady state, then the pendulum will swing down and (since energy is conserved) it will also swing up again. It will stop shortly before it reaches a steady state, swinging just until it reaches the old displacement angle (only on the other side of the steady state). Basically, the result is a pendulum which keeps on swinging from one side to the other.
    Now, consider a small velocity added to the initial displacement angle. Just enough to make the pendulum overshoot the upper steady state a little. The result is a pendulum which is constantly rotating. A completely different result with only a little change in the initial velocity.

    I found a phase plot of the pendulum on Wikipedia:

    You’ll notice that there are some trajectories which always go back from positive dθi/dt to a negative one, swinging from -π to π (at most, smaller amplitudes are possible) or from π to 3π and so on. For other trajectories, either dθi/dt>0 or dθi/dt<0 holds all the time. That means that the pendulum is rotating.

    Now, this pendulum is a simple example where a small change in a parameter or an initial condition can have a large influence. If you couple two or more rods to a double pendulum and so on, the system gets more and more chaotic (although I don’t really know how to quantify “chaoticness”).

  3. scytale said, on May 9, 2009 at 2:54 am

    Just in addition to your point: (http://en.wikipedia.org/wiki/Chaos_theory)
    In mathematics, chaos theory describes the behavior of certain dynamical systems – that is, systems whose states evolve with time – that may exhibit dynamics that are highly sensitive to initial conditions (popularly referred to as the butterfly effect). As a result of this sensitivity, which manifests itself as an exponential growth of perturbations in the initial conditions, the behavior of chaotic systems appears to be random. This happens even though these systems are deterministic, meaning that their future dynamics are fully defined by their initial conditions, with no random elements involved, this behavior is known as deterministic chaos, or simply chaos.
    This is probably the point: you define the system as chaotic even though it is fully deterministic but anyway highly sensitive to initial conditions. I would have called such systems just nonlinear… ;)

  4. Tommy said, on May 9, 2009 at 5:47 am

    Every chaotic system is a nonlinear system.
    However, not every nonlinear system is chaotic.
    (I would say not even half of them. :D …)
    In Wikis (suboptimal gewählten) Worten:
    “Chaotisches Verhalten kann nur in Systemen auftreten, deren Dynamik durch nichtlineare Gleichungen beschrieben wird. […] Ursache des exponentiellen Wachstums von Unterschieden in den Anfangsbedingungen sind dabei oft Mechanismen von Selbstverstärkung beispielsweise durch Rückkopplungen. Ist durch Reibung hinreichend Dissipation im Spiel, so kann sich in der Regel kein chaotisches Verhalten ausbilden.”
    Parameterabhängigkeit chaotischer Phänomene:
    LG – Tommy

  5. Martin said, on May 9, 2009 at 7:55 am

    After reading this post (and the discussion) a question arose. In what way stability (of the solution) and chaotic systems work together? In one of the classes stability was defined in meaning of the initial condition (IC). So if (I’ll ignore other inputs in the notation for the sake of visibility)
    f(x0) = f(x0+dx)
    meaning that the trajectories will end up in the same point in the phase diagram, than the solution is stable. So here they also use the sensitivity in the IC to determine the stability of a solution. But where is the difference to chaos? Or let’s say we find out our solution is not stable, than we can’t conclude it’s instable? But how can I find out?

    Hope my question is clear 0:)

  6. Ulf said, on May 9, 2009 at 10:09 am

    Let’s assume a dynamical system that will always approach one of two distinct steady states x1 or x2. If a slight disturbance dx0 in the initial condition decides to which steady state the system converges to, then I wouldn’t call the system stable. At least from a practical point of view. Even though a setpoint linearization might still show that both steady states are stable.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: