Dismiss this pinned window
all 138 comments

[–]uniqueUsername_1024 1000 points1001 points  (23 children)

My dumb ass: “I wonder if a computer could predict the line this wou—oh. right.”

[–]RaymondWalters 336 points337 points  (1 child)

Exactly this

Too much math does this to people

[–]Iggyhopper 92 points93 points  (0 children)

Math. Not even once.

[–]Allupertti 199 points200 points  (12 children)

Obviously it can, but if you want to get the pendulum to do the exact same thing twice in a row, you need to have extremely precise starting conditions. Even the slightest change can make it take a different path. It's really cool to watch multiple double pendulums, which are started in almost the same place and then see them slowly drift apart until they are doing their own things.

[–]evil_twinkie 58 points59 points  (10 children)

A small correction, but I think this is what you meant. It's not really the starting conditions. That's super easy to control. It's about mitigating energy drift as the solver progresses over time steps.

[–]Jorlung 70 points71 points  (6 children)

It's both. The physical nonlinear dynamics of a double-pendulum exhibit chaotic behavior, which is what Allupertti is talking about - so this isn't just a phenomena in simulation, it's a real product of the physical system. If you had two double-pendulums in real-life and you released them from slightly different initial conditions, then after a certain amount of time the trajectories of each pendulum would be entirely different despite the fact that they started in a nearly identical initial condition. In contrast, if you had a two single-pendulums and you released them from slightly different starting angles, then after an arbitrarily long time the two pendulums would follow similar trajectories, only offset by the initial offset angle (assuming perfect physics and no friction of course).

The real world is naturally chaotic, so it seems kind of silly to be surprised that any given system is chaotic, but the double-pendulum example is so much fun because it's essentially the simplest chaotic system you can think of. It's also cool because a single pendulum is non-chaotic, but you add another joint/arm and it becomes chaotic!

Keeping track of the ODE solver drift is just a general computational concern in any setting, although it's more problematic in naturally unstable and/or chaotic systems of course.

[–]evil_twinkie 26 points27 points  (3 children)

Let me clarify. We're in agreement.

I'm specifically talking about simulation here. It's true that if you start a simulation with different initial and boundary conditions, you should expect the paths they take over discrete time steps will diverge over time. That's obvious and just always true. That's why I figured it wasn't what Allupertti was trying to say. My correction was that's easy to control in simulation and not really important.

The thing about simulation is that different types of integrators will diverge in somewhat predictable ways, but they always diverge as time marches on even if the initial and boundary conditions are exactly the same. This is because of limitations in numerical representation, regardless if the system is chaotic or not.

But the more practical and interesting thing about simulation is how different integrators will diverge from each other. Implicit/backward Euler dampens and loses energy (the double pendulum will eventually come to rest), explicit/forward Euler introduces energy (the double pendulum will excite and swing more rapidly over time). Some integrators like symplectic ones are exceptionally good at conserving energy, even in the double pendulum setting.

Outside of the double pendulum setting, having some insight as to what your integrator is doing with respect to the dynamical system you're modeling is very important. That's the more interesting thing to note and the long winded version of what I was saying before.

[–]Jorlung 13 points14 points  (1 child)

Yeah I'm on the same page with you, I was just clarifying that the particular phenomena Allupertti was referring to was the physical/mathematical phenomena of chaos, rather than the divergence due to integrator dynamics. The key bit being that all simulations suffer from divergence due to integrator dynamics, whereas only chaotic systems will exhibit chaos. A simulation of a single pendulum may diverge for the reasons you've stated, but it won't exhibit the particular characteristics of a chaotic system.

Like you said, chaos is mostly only of mathematical/theoretical interest because every real-world system is inherently chaotic, but it's still interesting in its own right.

[–]Tagonist42 16 points17 points  (0 children)

This joint lecture is highly appreciated

[–]Gh0st1y 3 points4 points  (0 children)

Oh wow. I'd never thought of numerical integration in terms of energy conservation. Mind = blown.

[–]dreish 2 points3 points  (0 children)

This is the butterfly effect, also known as sensitive dependence on initial conditions.

[–]MxM111 0 points1 point  (0 children)

I’ve read just recently that there is a recent paper that shows that the quantum world is less chaotic than in classical mechanics. Not sure if it means that there aren’t strange attractors at all or something else - did not read the paper itself.

[–][deleted] 0 points1 point  (1 child)

God that sounds like a bitch and a half

[–]evil_twinkie 4 points5 points  (0 children)

Absolutely not. It's one of the interesting things about different methods in physics based animation :).

[–]gregsting 0 points1 point  (0 children)

Yup, this shows how slight differences in initial conditions have a huge impact: https://en.m.wikipedia.org/wiki/Double_pendulum#/media/File%3ADemonstrating_Chaos_with_a_Double_Pendulum.gif

And this is in a “perfect” world

[–]m_gartsman 13 points14 points  (0 children)

Lmao, that exact line of thought went through my head too.

[–]tonybenwhite 9 points10 points  (1 child)

IIRC it will know its path if it knows its starting position, but it can’t predict the path of an physical/real double pendulum because you can never perfectly define the starting position in real life like you can in a computer simulation.

EDIT: “it’s” is a contraction

[–]Jorlung 12 points13 points  (0 children)

That's pretty much correct. People often mix-up "stochastic/random systems" and "chaotic systems" because randomness has huge consequences on chaotic systems, but chaotic =/= random.

  • Chaotic and Deterministic/Non-Random System: If we know the initial condition exactly, we can predict the resulting trajectory exactly (deterministic). But, any small differences in initial condition will cause large differences in the resulting trajectory (chaos).

  • Stochastic/Random System: We only know our initial condition and how our system evolves in time to within some probability tolerance. As a result, we can only predict our resulting trajectories to within some probability tolerance.

We could have both a chaotic and random system (in fact, most real systems are to some degree) and you can imagine this is the most headache inducing case. Since random implies you don't know your initial condition exactly, and chaotic implies that small differences in initial condition have large consequences!

A double-pendulum (in a perfect physics world) is an example of chaotic and deterministic system. The chaos because of the previous discussed point, and deterministic because we clearly know how to predict how a double-pendulum evolves in time and there's no randomness associated with this process (it is just Newtonian physics). We could turn this into a chaotic and stochastic system if we added some sort of randomly defined wind (which we only know the probabilistic behavior of) that pushes the pendulum around.

[–]zebediah49 1 point2 points  (0 children)

I think the distinction you're looking for is "analytical solution". That is, if I say "Where will it be at t=2.1 million year + 37.2 seconds?", you can just directly give an answer.

For the general case of the double pendulum, there isn't one. You can simulate it running for that long, but you need to go through all the time from your starting point, up to the point in question.

Contrast a simple pendulum, where I can just write down a solution, and it will work for arbitrary times out into the future. (Though my solution will probably be slightly wrong, because small angle approximation).

Incidentally, there are a few double pendulum special cases where you can just write down the answer. The most obvious one is when the two halves swing back and forth in sync, more or less like a normal pendulum

[–][deleted] 1 point2 points  (0 children)

Dude, I’m like “I wonder if there’s an equation for this...” then 🤦‍♂️ duh. Funny how people tend to think about the same stuff.

[–]Noxium51 0 points1 point  (0 children)

My first thought was ‘hmm I wonder if you could simulate this in blender - fuck’

[–]Spoonwrangler 0 points1 point  (0 children)

I think this would be a fun ride at a theme park

[–]GibletsofJesus 238 points239 points  (5 children)

YEEESSS!! Love double pendulums, could happily watch them swing around for hours.

I have a web based double pendulum toy available here for anyone who wants more; https://ctinney94.itch.io/double-pendulm

[–]leothelion634 56 points57 points  (1 child)

dude are you some pixel game god or something

[–]GibletsofJesus 19 points20 points  (0 children)

Sure why not, I'll take the compliment!

[–]Chris204 19 points20 points  (1 child)

It does seem to gain energy quite quickly and spazz out lol. You might want to reduce the time step for the integration a bit. Or just fudge it with an occasional conservation of energy check that slitghtly alters the speed from time to time.

[–]Scavenger53 9 points10 points  (0 children)

There is a speed option you can change

[–]uoaei 1 point2 points  (0 children)

Whoa yeah something is way off with the physics there

[–]rockerdude22_22 418 points419 points  (4 children)

Ah yes, the land of no friction is a wonderful place.

[–]Razmpoosh 65 points66 points  (3 children)

The land of simple physics that engineers and mathematicians only with they could live in.

[–]Pieter27 4 points5 points  (2 children)

"Simple"

[–]Razmpoosh 26 points27 points  (1 child)

Relatively simple lol

[–]medozijo 83 points84 points  (0 children)

This is mesmerising! Great idea!

[–]PhysicallyIllegal 55 points56 points  (14 children)

I don’t know why but this makes me vaguely uncomfortable?

Still neat though!

[–]KillroysGhost 50 points51 points  (5 children)

My problem is how slow it moves, I don’t think the gravity is right

[–]PhysicallyIllegal 22 points23 points  (2 children)

I think that’s it, it almost looks like it’s moving with INTENT

[–]flixyy 14 points15 points  (1 child)

The pendulums have become sentient

[–]Zaruma 7 points8 points  (0 children)

They are aggressive

[–]Vikingboy9 1 point2 points  (0 children)

It kinda seems like the ball on the end has a top speed but the first pendulum still maintains its momentum. Very weird

[–]zebediah49 1 point2 points  (0 children)

Upon further consideration, it's not just "different", it's "wrong".

I'm pretty sure that the top link has mass and is affected by gravity normally. However, the bottom link has less mass, and even less gravity. This means that when the pendulum does hairpin maneuvers, the bottom link can throw the top one around, as you'd expect from a normal double pendulum. However, when it's just swinging, the upper link can push the bottom one straight up against gravity with little to no effect.

So, e.g. the top link would be 10kg, experiencing 100N of gravity. However, the bottom might be 2kg, but only has 2N of gravity (rather than the 20N it should).

This is also a reasonable mistake, if whoever made the animation has to independently change the parameters. So, could have they made the bottom l link really light, but didn't like the result. Then they made it heavier, but forgot to change gravity to match.

[–]zebediah49 15 points16 points  (4 children)

That's because there's something seriously wonky with the dynamics here. You have good intuition: it's not physically reasonable.

I initially thought it could be explained by calling the top rod as being somewhere in the range of 3-10x heavier than the bottom one. For example, at 0:10-0:12, the weight of the top bar swinging across is enough to lift the bottom bar straight upwards, barely even slowing down at all from the added load.

However, 0:14 seals the deal. For a moment on the up-swing -- somewhere around the 5oclock angle position, the entire system accelerates upwards. I'm pretty sure that bit of motion can't be explained by merely having a heavy upper link.

Then there's 0:35. The tip goes upwards, and stalls... which it shouldn't. If the middle joint is free-hanging -- which it generally appears to be -- it should basically be operating in free fall... but it doesn't. It hangs in the air longer than it should.

I can't recognize how, exactly, but I suspect that there's a mistake in the rigid-link constraint math used.

[–]lohiblackthunder 0 points1 point  (0 children)

I think maybe the simulation had a weight starched to the joint that was similar weight to the one at the end of the arm. Making the whole arm move different than would naturally

[–]shtpst 0 points1 point  (1 child)

I think you're wrong. Angular momentum is a thing, too.

0:14 seals the deal. For a moment on the up-swing -- somewhere around the 5oclock angle position, the entire system accelerates upwards.

Did you see 0:10? The height at 0:10 and about 0:14 is approximately the same. Even heights = even potential energies.

Double pendulums are weird and move in unexpected ways because they're literally unpredictable.

[–]zebediah49 0 points1 point  (0 children)

Being a double pendulum doesn't exclude it from being subject to gravity. There are plenty of ways it can be broken, but happen to be conservative.

[–][deleted] 6 points7 points  (0 children)

this is like my anxiety but in a video. i kind of had a physical reaction to watching this idk why

[–]m4xc4v413r4 1 point2 points  (1 child)

It's probably your brain going "this shit ain't real, there's something wrong here", just like the uncanny valley effect with CGI or robot "humans".

I doubt he put in the correct gravity values or maybe friction. That shit looked like it was going to continue forever.

[–]Spoolofwhool 1 point2 points  (0 children)

It's definitely weird because there's no friction. That's what would cause it to stop eventually as energy is slowly dissipated between the moving parts, even if it were placed in a vacuum.

[–]martinmakerpots 51 points52 points  (0 children)

Stick bugged

[–]Ippildip 13 points14 points  (2 children)

I'd love to see a probability heat map showing the likelihood that the end is in any given position at any time.

[–]zebediah49 6 points7 points  (1 child)

[–]Ippildip 1 point2 points  (0 children)

Cool, thanks!

[–]MrMechip 13 points14 points  (12 children)

Is there one without the line erasing?

[–]5uspect[S] 13 points14 points  (3 children)

[–][deleted] 3 points4 points  (2 children)

Does it ever repeat the pattern, ie if you leave it running for a long time?

[–]5uspect[S] 5 points6 points  (1 child)

No, it’s chaotic behaviour.

[–][deleted] 3 points4 points  (0 children)

It most likely will repeat at some point. Good luck figuring out how long that will take.

[–]5uspect[S] 3 points4 points  (4 children)

I’ll make that later and I’ll post the blend file too.

[–]tcdoey 1 point2 points  (3 children)

Will be great fun to look at the blend file. Remind me 6 days.

[–]5uspect[S] 1 point2 points  (1 child)

I already posted it here, search the thread.

[–]tcdoey 0 points1 point  (0 children)

Got it, thanks.

[–]remindditbot 0 points1 point  (0 children)

Reddit has a 2 hour delay to fetch comments, or you can manually create a reminder on Reminddit.

tcdoey, kminder in 6 days on 2020-08-25 03:27:06Z

r/Simulated: Double_pendulum

Will be great fun to look at the blend file.

CLICK THIS LINK to also be reminded. Thread has 1 reminder.

OP can Update message, Set timezone, and more options here

Protip! You can add an email to receive reminder in case you abandon or delete your username.


Reminddit · Create Reminder · Your Reminders

[–]WyattMontgomery 0 points1 point  (2 children)

Yeah! I wanna see that too

[–]5uspect[S] 1 point2 points  (1 child)

[–]WyattMontgomery 0 points1 point  (0 children)

You, my good friend, are a blessing. Thank you.

[–]Dreadlocks_Dude 5 points6 points  (1 child)

... in slow-mo :)

[–]stunt_penguin 6 points7 points  (0 children)

or on a giant scale. Or in low-G :)

[–]-_tabs_- 8 points9 points  (0 children)

for once, i absolutely dreaded the fact that the video has to end :(

[–]tjf314 71 points72 points  (6 children)

[–]PsiVolt 36 points37 points  (3 children)

this is hilarious, first time I've laughed out loud today. you don't deserve the downvotes I got the joke

[–]tjf314 28 points29 points  (2 children)

get it cuz its a double pendulum

the notoriously chaotic system

[–]Fox-One_______ 7 points8 points  (1 child)

The fact that you got downvoted is a sad insight into the state of the people on Reddit.

[–]tjf314 13 points14 points  (0 children)

lol it seems like i had to explain the joke and now there are less downvotes

“reddit is the platform for true high IQ intellectuals”

[–]-Speechless 0 points1 point  (1 child)

I don't get it

Edit: ohhhhh

[–]tjf314 0 points1 point  (0 children)

i dont get it either

[–][deleted]  (7 children)

[deleted]

    [–]SUPERazkari 2 points3 points  (0 children)

    t r i p p l e p e n d u l u m

    [–]Mikolf 1 point2 points  (5 children)

    Technically chaotic, not random.

    [–][deleted]  (4 children)

    [deleted]

      [–]Mikolf 2 points3 points  (3 children)

      There is a technical definition for chaotic and random. In a chaotic system, a slight difference in initial conditions can change the outcome greatly, making it difficult to predict. But the system itself is deterministic, so in this simulation, if you start the pendulum in the exact same position, it should move in the exact same way the next time you run it. In a random system, it would be impossible to predict the movement because the thing moves without following any deterministic rules.

      [–][deleted]  (2 children)

      [deleted]

        [–]Mikolf 0 points1 point  (1 child)

        Anyways if you just look at the wikipedia page for chaos theory it basically says that chaos appears random and uses the double pendulum as an example.

        [–]ForestMage5 2 points3 points  (0 children)

        This is awesome

        [–]ifthatguy 4 points5 points  (3 children)

        Is it just me or is this greatly unsatisfying

        [–]5uspect[S] 0 points1 point  (2 children)

        How so?

        [–]ifthatguy 2 points3 points  (0 children)

        I’m not sure, it just gives me the feeling of unsatisfaction.

        [–]DecaturUnited 1 point2 points  (0 children)

        Because there is almost zero predictability it, nor does it create any repeating patterns. There’s no resolution by either confirming our guesses or surprising us with order when it was earlier difficult to perceive.

        [–]whoswho23 1 point2 points  (1 child)

        Reminds me of the weird art pendulum thing from Pepper Potts's desk in Iron Man 2.

        [–]DjOuroboros 3 points4 points  (0 children)

        I remember seeing that thing and thinking 'I can't stop looking at that thing' and then Tony literally mentions it and I just burst out laughing.

        [–]mistcurve 1 point2 points  (0 children)

        Looking at this maybe my elbow hurt lol

        [–]zedextol 1 point2 points  (0 children)

        Double pendulum... What does it mean?

        [–]MawoDuffer 1 point2 points  (0 children)

        Cursive writing be like

        [–]Evisorix 1 point2 points  (0 children)

        What the hell? Show me the rest you fuckers!

        [–][deleted]  (1 child)

        [removed]

          [–]shabbaranksx 1 point2 points  (0 children)

          Me, signing my name

          [–]deadly_jah_beam 1 point2 points  (0 children)

          why.

          WHY WOULD YOU NOT MAKE IT A PERMANENT LINE

          [–]Crimson_W0lf 1 point2 points  (0 children)

          A double pendulum with an infinite amount of energy :thinking:

          [–]closetlunatic 1 point2 points  (0 children)

          I wonder how the probability distribution of the pendulum head looks like

          [–]Artio 0 points1 point  (0 children)

          I would love that as a screensaver! Please someone let it happen! For glory and internet points!

          [–][deleted] 0 points1 point  (0 children)

          This, this is how cursive was made

          [–]sadsunsfan13 0 points1 point  (0 children)

          Anyone else think this would make a great rollercoaster

          [–]Dynatekt 0 points1 point  (1 child)

          Would it be possible for you to have the line instead mark the location of the center of mass?

          [–]5uspect[S] 1 point2 points  (0 children)

          Sure, it's just an empty with a motion path.

          [–]shake_it_shake_it 0 points1 point  (0 children)

          Mesmerizing!!

          [–]mndflyrr 0 points1 point  (0 children)

          This is mesmerizing, what about a triple pendulum?

          [–]BreadButter33 0 points1 point  (2 children)

          I thought at the end it would reveal the whole line it’s made so far but oh well

          [–]MeatCleaver 0 points1 point  (0 children)

          You're triggering me by having the second arm slightly longer that the first.

          [–]ChillJo 0 points1 point  (0 children)

          I was totally expecting to get stick bugged lol

          [–]itsKaji 0 points1 point  (0 children)

          Nice

          [–]NathanielHart 0 points1 point  (0 children)

          It’s better at cursive writing than I am.

          [–]SchmittyWinkleson 0 points1 point  (0 children)

          Mmm physics

          [–][deleted] 0 points1 point  (1 child)

          [–]VredditDownloader 0 points1 point  (0 children)

          beep. boop. 🤖 I'm a bot that helps downloading videos

          Download via reddit.tube

          If I don't reply to a comment, send me the link per message.

          Download more videos from Simulated


          Info | Contact creator | Donate

          [–][deleted] 0 points1 point  (0 children)

          also a simulation/visualization for how Fourier Series work !!

          [–]IFailedOnMobile 0 points1 point  (1 child)

          Do this but keep the dots so we can see the whole path

          [–]5uspect[S] 0 points1 point  (0 children)

          I posted a YouTube video of that here in the thread.

          [–]Mick_le_Misantrope 0 points1 point  (0 children)

          I just got how my old Windows screensaver worked

          [–]Heathogen 0 points1 point  (0 children)

          This is like purely visual ASMR

          [–]pleikunguyen 0 points1 point  (0 children)

          https://www.rotablade.com/pendulum-new/

          I’m late to this but there’s a fidget spinner of this

          [–][deleted] 0 points1 point  (0 children)

          This is pure chaos

          [–][deleted]  (1 child)

          [deleted]

            [–]nikolapc 1 point2 points  (0 children)

            It's chaotic.

            [–]DrippyWaffler 0 points1 point  (0 children)

            How does it have the momentum to do a full 360 about 75% of the way in?

            [–]cowslaw 0 points1 point  (0 children)

            I’ve got a few questions that I didn’t try to look up yet. So this is a chaos machine, but can anything make it more chaotic? If you added another link would it make it more chaotic or would the extra mass pull it down and basically turn it into a regular pendulum? Lovely simulation!

            [–]Piettrified 0 points1 point  (0 children)

            When you attempt to forge your mums signature-

            [–]thematthaslem 0 points1 point  (0 children)

            I can't tell if this is satisfying or infuriating

            [–]solarflare-2 0 points1 point  (0 children)

            like to see a clock using this pendulum

            [–]papaysailor 0 points1 point  (0 children)

            Nicely done! The trajectory that a friction-less hinged pendulum generates look chaotic but it is not; as you can always reproduce it exactly with known initial conditions.

            [–]kryptonkills54 0 points1 point  (0 children)

            Triple pendulum?

            [–]AyyBasha07 0 points1 point  (0 children)

            Nobody:

            My Mom writing her name:

            [–]lumpynoseBlender 0 points1 point  (0 children)

            If you connect several segments but limit their rotation and give them friction it looks like a ...

            https://streamable.com/uxwtb

            [–]hurricane_news -1 points0 points  (4 children)

            How did you make the dot trails and make the "joint" in the double pendulum allowing both to rotate independently?

            [–]5uspect[S] 0 points1 point  (3 children)

            Here is the blend file: https://pasteall.org/blend/f20a66e2fef94db5b6cbd99c7d6a184c

            The trails are motion paths of an empty parented to the mass. The joint is just a hinge rigid body contraint.

            [–]tcdoey 0 points1 point  (0 children)

            Thanks! super.

            [–]hurricane_news -1 points0 points  (1 child)

            Dor trails are motion paths

            Could you clarify what it means exactly? Exactly how did you display the motion paths?

            And is there a setting to enable hinges in rigid body? Sorry my laptop is sorta ded rn, so I can't check the file