Coding Challenge #159: Simple Pendulum Simulation

preview_player
Показать описание


Links discussed in this video:

Other videos mentioned in this video:

Timestamps:
0:00 Choo choo!! 2021 Coding Challenge!
0:43 Code! Drawing a bob and an arm.
1:08 Explain! How are we going to think about this?
2:55 Code! Add our main variables.
3:20 Explain! How do we figure out where the bob is? Trigonometry is the answer!
4:39 Code! Use the polar coordinates formulas we just worked out.
6:30 Code! Let's use angular motion!
7:55 Explain! What is the force of the pendulum? Trigonometry is the answer!
10:46 Code! Add the pendulum force.
12:04 Whoops! Correction on why we multiply by -1.
13:34 Code! Add -1 to the formula.
13:57 Whoops! I figured out some things that I never really understood.
14:24 Code! Correct the 3 step process.
15:32 Something doesn't feel quite right.
16:59 Explain! Angular acceleration relates to the arm length!
18:58 Code! Let's divide by length.
19:54 Code! You could add some damping.
20:21 Ideas! What could you do next?

Рекомендации по теме
Комментарии
Автор

7:04 actually, the mass won't affect the period of the pendulum anyway. It only depends on the length of it.

wallacesantos
Автор

Few days ago I was wondering how could I create something like that and this video just appeared in my recommendations today, I didn't even search about anything related to that in google, I'm getting convinced google is able to read my mind or something.

Snoo
Автор

I'm so happy that you exist, Daniel. <3

joaoferreira_yt
Автор

13:50 my childhood experiment while standing on swing in the park😎

rrMaxwell
Автор

Please please dont stop making videos ever, im so glad that you exist ♥️

tahasharjeel
Автор

Always nice to watch another Coding Train with Dan. Much love from Brazil! 🇧🇷 :)

rafaelgpontes
Автор

Now I know the science behind a pendulum

neerajkatiyar
Автор

So well explained, I love your nature of code series!

bobingstern
Автор

The general pendulum equation (3D) is a lagrangian equation and the solution is a sphere. It's very elegant to solve it using energy instead of vectors.
Thanks for your videos, inspires me a lot!

BrunoidGames
Автор

I would just like to say thank you! I was able to understand and convert this to game maker in order to make a working pendulum that I am now using to make a space pendulum to create procedural music and background flare for my game. You made this really easy to grasp.

malucifer
Автор

Thank you for this amazing video. Thanks for sharing you own learning and discovery with those entertaining correction clips. It encourages me to keep improving my understanding of things I am familiar with, but really don't know as well as I should.

gkreisman
Автор

Even though i code with Python and C, i still catch you explanations so easily, your the best mate, i was getting mad with the pendulum code, you saved my sanity. Thank you.

claverbarreto
Автор

Dan, I am so glad you make these videos!I learn on khan academy, but i dont understand most of it!You helped me out of so much jams!

mattiesavage
Автор

Wow! Love the passion and enthusiasm! Great video as always! Something I really want to mess with someday when I have more time and skill is taking the double pendulum concept and trying to simulate a cuckoo clock with time, weights that would supposedly reach the floor after a certain amount of time, and maybe eventually a cuckoo! There could be an analog clock that moves based on a certain amount of pendulum ticking (to be accurate to a minute) and the weights could slowly move down so it simulates a one day or eight day cuckoo clock! I grew up with about five or six cuckoo clocks throughout my childhood, so it would make me so happy to see that in a simulation! We could increment certain numbers without having to worry about a physics gear simulation behind the scenes. I think it would be so cool to implement music and quail as well so there could be three doors with four weights, etc! If any of you guys (or even Daniel!) could do any form of this idea, I'd love to see any form of this simulation!

zinsy
Автор

I just spent the last 4 hours learning about derivatives and integrals to take a shot at this and my brain is scrambled at this point.

adognamedsally
Автор

I had a similar issue long time ago when my dad told me that if you look at a rotating car wheel, the velocity of a point on the rim would be slower than the velocity of a point on the tire. I had a lot of trouble digesting that!

muadh
Автор

I love this guy! The best teacher I would say

Noobmaster_x
Автор

I'm from c# and had just discovered generative code like this and still understood your explanations thank you mate my version works just flashy because i had to make the draw function myself from timer ticks definitely worth a like!

wshockmc
Автор

Whoa, this was so much more complicated than I expected. And we didn't even pay attention to the weight of the "bob".

kpunkt.klaviermusik
Автор

It also needed a height start. sin/cos (angleS x angle). With angle=pi/180. This will count, in degrees, - or + from the resting position of 0.

vancemccarthy