More Practice with Lagrangian Mechanics in Python
HTML-код
- Опубликовано: 5 авг 2024
- In this video I tackle a unique problem in Lagrangian Mechanics using python. This problem was sent in the discord channel:
/ discord
My other videos on Lagrangian Mechanics can be found in my physics problem playlist:
• Physics Problems
All code for this video found here:
github.com/lukepolson/youtube... Наука
Really enjoyed coding along with you. Results were amazing. Thanks :)
Fantastic! I just love the combination of physics + numerics + python!
this is beautiful. interesting system as well!
Dude this was awesome, I love pendulum systems. I comment here so youtube algorithm will suggest this to more ppl
What you did is amazing. Thanks so much!
Subscribed, this is so cool .
Great video! Thank you!
This is very amazing to learn as phys major knowing how to implement in the coding
Bro really linked us up with the sauce oh my days man
Amazing 🤩
I haven't seen you use `sympy.init_printing()` in notebooks. It might be useful to show, to teach it to others. It makes a little bit of difference, for example it displays sympy variables and expressions nicely even if you have them in a tuple or list. Try (x, y) before or after initializing printing, for variables x, y.
Thanks for everything *you* have taught me! :)
Great video!As a student major in physics, I can always learn from your video. May I ask how did you draw such beautiful diagram?
Awesome 😍😍
Thank you very much thank you thank you thank you
I'm trying to solve a Lagrangian that is also subject to an external field. There is an object moving according to theta(t) = sin(2*pi*t). I defined it in the 3rd block of code (like in your example), instead of just writing theta = theta(t) like for the other variables. I run into issues when I get to the smp.lambdify part due to the sines and cosines present from theta(t) in my sols[ ]. Do you know if there's a way to go around this? Contrarily to g, m, M, l... the values of theta aren't fixed and will change at each time step.
It has been a long time since I had to deal with those kind of problems. Perhaps it is time to refresh my memory. In the mean time I have the following question. WOuld you be able to find out limits of the parameter space (probably spring constant and or masses) which does not allow for example the mass m2 to not be located at the origin since then there is no room for spring. Or, but that constraint might be already in place because l1 is fixed, is it possible to set the value of k (probably very small) so that the spring m2 will be located a distance greater then 2*L1 from the origin?
Love ur channel, can you help me to construct a wannier function from a photonic crystal?
Great content!! Thanks for introducing me to symbolic math in Python. I just finished deriving the Lagrangian for an Inverted Pendulum Cart problem by hand :( It was so tedious and took many hours, paper & pencil to get right.
I did have a problem running your notebook in Colab online. All cells seem to run but the animation doesn't run. After several seconds it prints out 1 frame, no motion. Any ideas where I might look?
I did find I could add :
from IPython.display import HTML
HTML(ani.to_html5_video())
and it displays a nice mp4 video. The results look great now.
Why do you still use odeint? Isn't it being phased out in favor of solve_ivp?
Good point here...it was just a random selection really. But ya solve_ivp in general is much nicer.
Very nice video. A question, do you really need to write smp. All the times?, cause i dont
It's annoying but when using sympy and numpy at the same time I don't want to confuse the numerical np.cos with the symbolic smp.cos
@@MrPSolver i see, i thought you didnt know :)
This was interesting. I noticed that you have a bunch of videos with more complicated examples at the end of this video. Is there any chance you could make a more simple example that would explain the basic concepts of a Langrangian and the differential equation connected with it in a more simple way that would be more useful for a beginner?
There is a video in the channel doing the same practice but with a simple pendulum. It's way more intuitive
@@8adrisg Thank you! Clearly, I should've scrolled down further.
Please do a solution for why my putts lip out. I heard it has to do with the Corolla effect but I don’t drive Toyotas. -- tiger would
this is beautiful, but where did the beard go? :(((
it looked manly, but I guess no more, fam. good video though. :D
Great video! Thank you!