The Double-SPRINGED Pendulum in PYTHON

preview_player
Показать описание
Those equations you see on the background of the thumbnail? Those make up ONE OF EIGHT differential equations you need to solve when computing the motion of the double pendulum. Here we make use of sympy to save ourselves about 1000 trees-worth of paper.

Code located in the link below. Go to "Python Metaphysics tutorials" and then "Vid 7"
Рекомендации по теме
Комментарии
Автор

I'm gonna have to apologize to my advisor for not getting more work done because I've been too busy watching your videos... Keep it up!

markmekosh
Автор

You sir, are awesome. Please keep up the great work.

sumitdey
Автор

Im not a matematicia nor a programmer, but your videos are absolutely fantastic, you are very talented.
I also love your baroque rap

Pedozzi
Автор

Thank you for these videos! Keep up the awesome work! Maybe something with Navier-Stokes could be interesting...

matejivanek
Автор

Awesome! I watch your Python videos and become more motivated and inspired each day 😎

AJ-etvf
Автор

Loving your videos man! Super intelligent content!

andrewz
Автор

This was fun, good job! Dont forget to try n springs, we want to see for loops!

borko
Автор

@Mr. P Solver, you were kinda laughing at that long formula
But that's exactly what theoreticians have been doing not long ago
Even much bigger expressions with pen and paper

igorshvab
Автор

Channel so great thanks for making these

typeer
Автор

Follow your video and got awesome results, I later modified it to have to different masses and it did wonders, also added a tracer to the animation (due to my laptop, it took around 30 min to run). Thinking about modifying it to have different lengths and spring constants. Right now I'm writing a triple pendulum simulation based on your code, it if works I'll test a triple-springed pendulum just for fun. Awesome video !

flash
Автор

could you do a video talking about your background and your research (if possible)? maybe even n-coupled oscillators? some videos for the less programming inclined may be nice also (showing relevant programming tools for physics). again, i absolutely love the videos

danielgitlin
Автор

I feel like it would be fun to add linear damping to the masses

anonymusplatypus
Автор

If you don't use Lagrangian formalism but simple newtonian equations of motion the problem is absolutely doable on paper too.
Symbolic software often gives unnecessarily complicated equations without simplifying the expressions properly
I have done it in Java applet without computer algebra about 15 years ago and you could even move the bobs with the mouse while moving. Used 4th order Runge-Kutta and made chains of 3 or more springs too...

MrKA
Автор

nice work man,
I wonder what would happen if the the origin was in SHM

len
Автор

I have to choose a project for my Computational Physics class in the next few weeks. Do you know of any systems which can be described in a second-order or higher PDE that can reasonably be analysed in a short timeframe? I'm currently looking at analysing rocket equation or binary star systems.

Any suggestions will be greatly appreciated :)

GoldenPatrice
Автор

I suppose you prefer Lagrange, but the Hamiltonian would give you the two sets for first order differential equation. Just wondering. Great video!

stephanel
Автор

The difference between good and not good when trying to solve a system of ODEs as in:
sols = sp.solve([LE1, LE2, LE3, LE4], (the1_dd, the2_dd, r1_dd, r2_dd), simplify=False, rational=False)
Good:
LE1 = sp.diff(L, the1) - sp.diff(sp.diff(L, the1_d), t)
LE1 = LE1.simplify()
Not good (that's when the solver hangs):
LE1 = sp.diff(L, the1) - sp.diff(sp.diff(L, the1_d), t).simplify()

frankkoslowski
Автор

Any ideas on modeling a rotary inverted pendulum?

ibrahimsakr
Автор

I'm not getting why L the fixed length of the spring is equal to 1 still? Are we kind of saying that every unit of length will just equal 1--so that we abstract away any exact lengths allowing us to generalize the problem?

davidsanjenis
Автор

Given prior issues with indexing by means of a symbol rather than an integer,
using an ordered iterable of symbols (e.g., solve(f, [x, y, z])) appeared to be more logical than implementing a
nested list of symbols (e.g., solve(f, (x, y, z)))
Thus:
sols = solve([LE1, LE2, LE3, LE4], [the1_dd, the2_dd, r1_dd, r2_dd],
simplify=False, rational=False)
sols[the1_dd] was found to return 9 neat looking set of fractions, each separated by the appropriate `+` or ` -`
What's been happening with your solver?
Try:
# The ODE-solver
# Specifically imported like this to prevent `solver hanging` as was observed with the Spinning Top Lagrangians!
from sympy.solvers import solve 🙃

frankkoslowski