Тёмный

Billiard Balls and the Boltzmann Distribution in Python 

Mr. P Solver
Подписаться 134 тыс.
Просмотров 20 тыс.
50% 1

By simulating collisions between billiard balls in a closed box, we can model the velocity distribution of air molecules in a gas, and recover the Boltzmann distribution of gas molecule speeds.
Code: github.com/lukepolson/youtube...
Discord Server:
/ discord

Наука

Опубликовано:

 

3 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 56   
@nmgreg11
@nmgreg11 2 года назад
As a recently retired ME, this channel is by far my favorite. Thank you so much for the awesome content and teaching style.
@gothicknight5538
@gothicknight5538 2 года назад
It's always good to get an example of empirical proof.
@blackguardian89
@blackguardian89 2 года назад
Awesome! You should definetly make a video about the Lattice Boltzmann Method for CFD :)
@syedabuthahirkaz
@syedabuthahirkaz 11 месяцев назад
You need not take the sqrt of the distances between pairs, just compare the distance squared with the sum of the radii of pairs to detect collision and this would significantly improve the performance of the code. Great Job I've done this independently in Processing Java.👍
@Louis-ml1zr
@Louis-ml1zr 2 года назад
Amazing! Ive been waiting for a video like this thanks !
@markushaysnielsen4885
@markushaysnielsen4885 2 года назад
What a great video! I can’t wait to show this to my students next semester🤓
@declanwk1
@declanwk1 2 года назад
brilliant video. Best kind of physics lesson
@mikekertser5384
@mikekertser5384 2 года назад
Thank you! Fantastic video!
@LearningWorldChatGPT
@LearningWorldChatGPT 2 года назад
Amazing... Fantastic video!!! Thanks for sharing your knowledge.
@danv8718
@danv8718 2 года назад
Awesome content, you're the best.
@mohdtauheed5242
@mohdtauheed5242 4 месяца назад
Really great videos. Nice work, keep the good work up!
@Sam-tg4ii
@Sam-tg4ii 11 месяцев назад
You are such a clear explainer
@jakobkrygersrensen74
@jakobkrygersrensen74 2 года назад
This video is awesome!. Thanks a lot!
@hericklenin
@hericklenin 2 года назад
This is awesome. Thank you!
@amrhssnn
@amrhssnn 11 месяцев назад
Great tutorial and video! Thank you very much
@wenhanzhou5826
@wenhanzhou5826 2 года назад
Super cool video, keep it up!
@derekwang5982
@derekwang5982 Год назад
Indeed useful videos, the best of the best.
@charliearmour1628
@charliearmour1628 2 года назад
Super video. I'm amazed what can be done with Python. My imagination is firing on all cylinders...
@udomtipparach4894
@udomtipparach4894 2 года назад
Useful for undergraduate and graduate students
@HizBela_16
@HizBela_16 2 года назад
I would love it if you can have video on computational Physics in Python.
@juanmanuelriosfranco3711
@juanmanuelriosfranco3711 Год назад
i´m Colombian from, my inglish is very poor, but i'm doing my best to understand you, and it's incredible, you're explanations are better than many spanish youtubers. Thanks a lot. Take care. Grettings. PD: Can you make a video explaining the variable time fields? like Maxwell ecuations solutions, but as a radiant field not waves.
@novampiresremaininromania
@novampiresremaininromania 2 года назад
Продолжай в том же духе! Ты очень крутой
@HypnosisBear
@HypnosisBear 2 года назад
Nice video man 😀
@Science4Ever
@Science4Ever 2 года назад
I was waiting for this video, man! Thank you! You should also make a video and tell us how you actually learned python. Like what books did you use?
@MrPSolver
@MrPSolver 2 года назад
I didn't really use books to be honest! Most of my knowledge I gained from TAing two undergrad computational physics courses at two different universities, and then also trying/experimenting things with regards to my own research. Maybe I'll write a book one day, there seems to be a lack of information in this area!
@Science4Ever
@Science4Ever 2 года назад
@@MrPSolver Where can I preorder it? :)
@a.andacaydn9736
@a.andacaydn9736 2 года назад
@@MrPSolver you definetely should; man this is gold, an thank you for doing this
@KrishanuSengupta-ki8jo
@KrishanuSengupta-ki8jo 16 дней назад
Excellent
@relojsaturno
@relojsaturno 8 месяцев назад
insted of check de distance between ALL pairs, it's better before check if two ball overlapes they horizontal and vertical proyection. I borrowed this idea from another video, I acelerate my simulation very much
@WinstonDodson
@WinstonDodson Год назад
In the comment below I tried to suggest that rebuilding this model using Sympy would be a great next step. It would be a natural extension of your video on Sympy and allow a natural path to generalizing the simulation model to 3D. Then, it would seem to begin to illustrate how Sympy would be foundational to building Digital Twins in a way that can be scaled.
@hugoallen7175
@hugoallen7175 Год назад
You should make a video on fluid flow over an airfoil with the Lattice-Boltzmann method
@canelsproyect8824
@canelsproyect8824 2 года назад
Hello Mr. P. Solver, good video. Could you tell where you got the physical theory of the Boltzmann distribution for this video? Thank you, greetings from LATAM. :)
@syedabuthahirkaz
@syedabuthahirkaz 11 месяцев назад
Try Taking Ensemble Average. Then the velocity distribution will look much smoother over time. I will post a video shortly over this.
@cerioscha
@cerioscha Год назад
Great video thanks. Would it be possible (although maybe of no interest) to calculate / consider Mean Free Path length between collisions?
@prietjepruck
@prietjepruck Год назад
Very interesting project. I wrote the same program in processing (a simplified java language). It calculates 4000 molecules at a 100 FPS single core. I could not be bothered to write it multiple core. Python is really slow.
@anatoliyzavdoveev4252
@anatoliyzavdoveev4252 Год назад
Amazing , interesting, I am going to try to repeat 😇
@shubhamghosal9336
@shubhamghosal9336 2 года назад
Chad moment.
@WinstonDodson
@WinstonDodson Год назад
I think that it would be interesting to repeat building this model but with symphonic.
@WinstonDodson
@WinstonDodson Год назад
sympy not symphonic
@CoolDude911
@CoolDude911 Год назад
I think this would be faster to calculate the distances between two arrays: all_pair_idx = np.array(list(combinations(range(NR_PARTICLES), 2)), dtype=np.int64) all_pair_idx = np.ascontiguousarray(np.tranpose(all_pair_idx)) # This is constant distances = np.square(r[:, all_pair_idx[0]] - r[:, all_pair_idx[1]]).sum(axis=0) # take the square of the threshold
@CoolDude911
@CoolDude911 Год назад
Also the approach taken here could have three particles colliding and two of them would have a mutual collision while the other would collide of one of the other two.
@Johan-yy9pk
@Johan-yy9pk 2 года назад
Do video about how to download python libraries for physics
@Path_k_pradeep
@Path_k_pradeep 2 года назад
@pauldirac6243
@pauldirac6243 6 месяцев назад
It was fun up until about minute 20, then it just got too complicated to follow. Discouraging for such a simple, straightforward simulation... Thank god for Vpython to save time on the arduousness required to create basic animations in regular Python.
@user-yx4jh6gi5n
@user-yx4jh6gi5n Год назад
Hi! I have question. How to make this animation frame-unlimited? I mean you set numbers of moving frames then gif image return to begin of loop. I whant nonlooping time unlimited modeling of moving. Thank you, for video!
@suryadharma3007
@suryadharma3007 2 месяца назад
Why do you define a with 2/500**2, while the boltzmann constant is 1.38*10^-23 and what is the temperature and mass of the particle?
@Brandon_Tyr
@Brandon_Tyr 11 месяцев назад
Can anyone recommend a book to learn stuff like this. RU-vid is far too difficult to collect a coherent curriculum from, and I would love to learn how to do simulations coupled with animations in python preferably. Thanks!
@pranav_cha
@pranav_cha Год назад
whats with the spinning pairs/triplets of particles that seem 'stuck' together?
@haraldhetzinger
@haraldhetzinger Год назад
This happens when particles overlap (distance < 2*radius) i.e. at initial configuration. If these particles cannot manage to get rid of the overlap within the next time step dt the simulation will handle the pair in the next step as comming from the opposite side colliding again with new velocity directions. This results in those particles dancing around each other until they are hit an separated by a third fast collision partner. The simulation is not checking whether particles move towards each oder or away from each oder in case of overlapping scenarios.
@haraldhetzinger
@haraldhetzinger Год назад
x1, x2 (vectors of particle positions, v1, v2 (vectors of particle velocities). If norm(x2-x1) < 2*r particles are overlapping In this case we need to check if (x2-x1)(v2-v1)
@pranav_cha
@pranav_cha Год назад
@@haraldhetzinger that clears it up thanks!
@ddiva1973
@ddiva1973 2 года назад
if you ever do a doctorate, wil you change your username from Mr. P Solver to Dr. P Solver?
@MrPSolver
@MrPSolver 2 года назад
Good question. But seeing as I won't finish my doctorate for at least another 3.5 years, I may put this question on the backburner for now 😂
@jorgemalosti9308
@jorgemalosti9308 2 года назад
my advisor wants me to do pretty much the same... but in fortran i have no ideia how am i gonna do that
@DanushKumarSSMSP
@DanushKumarSSMSP 2 года назад
Hi bro.... it's Danush here, I,m having problem in the simulation of scalar fields by metropolis algorithm to get the kink solution...my code is not working... Can u help me on fixing it ????? If it so.... can I get your mail id??? So that I can sent you my code and you can find what mistake I have done???
@anjishnu8643
@anjishnu8643 2 года назад
0 dislikes and 255 likes. Sorry but I just can't like the video.
Далее
Fourier Optics in Python
29:22
Просмотров 20 тыс.
КРУТОЙ ФОКУС С ШАРАМИ
00:35
Просмотров 113 тыс.
НЕ ДЕЛАЙТЕ УКЛАДКИ В САЛОНАХ
00:43
Python Simulation Tutorial - Conway's Game of Life
41:13
10x Faster Than NumPy (GPU Magnet Simulation)
43:15
Просмотров 14 тыс.
Simulating Particle Life
18:18
Просмотров 161 тыс.
Coding Adventure: Simulating Fluids
47:52
Просмотров 1,7 млн
1st Year Calculus, But in PYTHON
32:13
Просмотров 120 тыс.
Магниты и S Pen 🖊️
0:37
Просмотров 80 тыс.