Перейти к содержимому

Coding Challenge #159: Simple Pendulum Simulation

The Coding Train

0:00 / 0:00

Coding Challenge #159: Simple Pendulum Simulation

104 969 просмотров · 5 л. назад
The Coding Train
1,76 млн подписчиков
104 969 просмотров · 5 л. назад
Choo choo! In this challenge, I build on chapter 3 (Oscillating Motion) of the Nature of Code series and simulate a simple pendulum in p5.js via angular acceleration. https://thecodingtrain.com/challenges... 🕹️ p5.js Simple Pendulum https://editor.p5js.org/codingtrain/s... 🕹️ p5.js OOP Pendulum: https://editor.p5js.org/codingtrain/s... 🕹️ p5.js Pendulum Array: https://editor.p5js.org/codingtrain/s... 🎥 Pendulum Array Exploration:    • Coding Train Live!   🎥 Previous Coding Challenge:    • Coding Challenge 158: Shape Classifier Neu...   🎥 Next Coding Challenge:    • Coding Challenge 160: Spring Forces   🎥 All Coding Challenges:    • Coding Challenges   🎥 Previous Nature of Code Video:    • 3.7: Additive Waves - The Nature of Code   🎥 Next Nature of Code Video:    • Coding Challenge 160: Spring Forces   🎥 All Nature of Code Videos:    • The Nature of Code   Links discussed in this video: 🔗 Nature of Code Playlist: https://thecodingtrain.com/learning/n... 🔗 Applications of Differential Equations - The Simple Pendulum: http://calculuslab.deltacollege.edu/O... 🔗 Simple Pendulum (myPhysicsLab.com): https://www.myphysicslab.com/pendulum... 🔗 Object Oriented Simple Pendulum (Nature of Code Book): https://github.com/nature-of-code/noc... Other videos mentioned in this video: 🎥 Polar Coordinates - Nature of Code:    • 3.4 Polar Coordinates - The Nature of Code   🎥 3.2 Angular Motion - Nature of Code:    • 3.2 Angular Motion - Nature of Code   🎥 Double Pendulum - Coding Challenge #93:    • Coding Challenge 93: Double Pendulum   🎥 Coding Train Live! (February 6th 2021):    • Coding Train Live!   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? 🚂 Website: http://thecodingtrain.com/ 👾 Share Your Creation! https://thecodingtrain.com/Guides/com... 🚩 Suggest Topics: https://github.com/CodingTrain/Rainbo... 💡 GitHub: https://github.com/CodingTrain 💬 Discord:   / discord   💖 Membership: http://youtube.com/thecodingtrain/join 🛒 Store: https://standard.tv/codingtrain 📚 Books: https://www.amazon.com/shop/thecoding... 🖋️ Twitter:   / thecodingtrain   📸 Instagram:   / the.coding.train   🎥 Coding Challenges:    • Coding Challenges   🎥 Intro to Programming:    • Start learning here!   🔗 p5.js: https://p5js.org 🔗 p5.js Web Editor: https://editor.p5js.org/ 🔗 Processing: https://processing.org 📄 Code of Conduct: https://github.com/CodingTrain/Code-o...