Coding Challenge #12: The Lorenz Attractor in Processing
In this coding challenge, I show you how to visualization the Lorenz Attractor in Processing. Code: thecodingtrain.com/challenges...
🕹️ p5.js Web Editor Sketch: editor.p5js.org/codingtrain/s...
🎥 Previous video: • Coding Challenge 11: 3...
🎥 Next video: • Coding Challenge #13: ...
🎥 All videos: • Coding Challenges
References:
📑 Lorenz System on Wikipedia: en.wikipedia.org/wiki/Lorenz_...
📖 Lorenz Attractor: paulbourke.net/fractals/lorenz/
📚 PeasyCam library: mrfeinberg.com/peasycam
💻 beginShape(): processing.org/reference/begi...
🧾 What is a differential equation?: www.myphysicslab.com/explain/...
📕 My NOC class on Kadenze: www.kadenze.com/courses/the-n...
Videos:
🔴 Livestream Archive: • Live Stream #38: Viewe...
Related Coding Challenges:
🚂 #13 Reaction Diffusion Algorithm: • Coding Challenge #13: ...
🚂 #160 Spring Forces: • Coding Challenge #160:...
Timestamps:
0:00 Introducing today's topic
0:55 Differential Equations
2:30 Lorenz systems
3:36 Non-linear, chaotic systems
4:30 Start Coding!
6:07 Every cycle through draw is 1 unit of time
6:30 Add formulas to code
8:19 Change of time per frame
10:10 Modify the inputs
12:48 Plot the system
14:08 Scale the scene
14:42 Add an array list to store the data
16:00 Write an enhanced loop
17:00 Add beginShape() and endShape() to connect the points
17:52 Change to HSB mode and add color
19:07 Add an offset
20:06 Conclusion and design possibilities
Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound
🚂 Website: thecodingtrain.com/
👾 Share Your Creation! thecodingtrain.com/guides/pas...
🚩 Suggest Topics: github.com/CodingTrain/Sugges...
💡 GitHub: github.com/CodingTrain
💬 Discord: / discord
💖 Membership: kzread.infojoin
🛒 Store: standard.tv/codingtrain
🖋️ Twitter: / thecodingtrain
📸 Instagram: / the.coding.train
🎥 Coding Challenges: • Coding Challenges
🎥 Intro to Programming: • Start learning here!
🔗 p5.js: p5js.org
🔗 p5.js Web Editor: editor.p5js.org/
🔗 Processing: processing.org
📄 Code of Conduct: github.com/CodingTrain/Code-o...
This description was auto-generated. If you see a problem, please open an issue: github.com/CodingTrain/thecod...
#math #lorenzattractor #processing #java
Пікірлер: 432
If math teachers taught like you and did coding, the words "when would i ever use this in the real world" would be a bit meaningless. I love your videos.
@davidmitchell2761
3 жыл бұрын
EXACTLY.
@theman7050
2 жыл бұрын
Ikr
I've been coding for more than 15 years, I got burned out, with these tutorials, I'm falling in love again with coding again, just like the old days. Thank you so much!
You make learning programming so entertaining Dan, you ROCK!!!
This looks absolutely amazing using Unity's Line Renderer. I've had many teachers, none of them come close to you. You're an absolute gem.
@TheCodingTrain
4 жыл бұрын
Nice work! You can submit a link to the coding train website if you like! github.com/CodingTrain/website/wiki/Community-Contributions-Guide There's also this video tutorial: kzread.info/dash/bejne/mJ991JKintK3Z7w.html.
I would love to see a processing sketch that graphs Dan's heartbeat when he's doing these challenges
add "rotateY((hue/255)/360);" at line 44 or 45 right after "hue +=1;" and the curve will auto-rotate.
@TheCodingTrain
6 жыл бұрын
nice tip!
I've recently found out about your channel. It is amazing. Your videos are the only +10 min videos I can sit through and watch completely. You're both entertaining and informative. The whole range of things you're doing in these videos have convinced me to pick up computer science as my dual major!!
That's pretty awesome. It is a testament to the success of the Processing environment, but also a triumph in terms of a tutorial for the Lorenz attractor and being able to explain what it is and get an interesting visualization of it on the screen without a lot of pain. Great job, Daniel!
@revimfadli4666
4 жыл бұрын
It's such a good environment that it's quite a shame the name's not so search engine optimized(for troubleshooting, at least)
I love the way of him teaching so passionately. Full of energy!
"Send me your coding challenges!" I would like to learn more about reaction-diffusion or navier-stokes in a Processing context. Since you're asking. :D Great series. As usual.
@TheCodingTrain
8 жыл бұрын
+digitalArtform Added to my list!
These are so great. I'm glad i found them. they have taught me so much and deserve a lot more views.
This channel is the most underrated thing. Thank you so much for these videos!
Thank you so much for this. Love your enthusiasm, energy, and of course the clarity with which you explained all of this. I am having to study attractors in general and this one in particular for a dynamical systems class I am taking, and so far I was just seeing boring static pictures and graphs along with the theory. Creating and watching a live animation literally just made the subject come alive for me, haha... again thanks, this was great.
@TheCodingTrain
7 жыл бұрын
Thank you!
Your videos are great! Have you thought about doing a video on potential path planning? It's quite simple and lots of fun to play with.
I learn so much with you! God damn. At first I thought this was kind of a kid channel. Because his theme is unicorns and rainbows. But I was wrong. It does have a more friendly theme, which only adds to the channel, but the content is very solid. I like it very much!
you are just awesome. you encourage me take on new challenges and finish them as fast as possible.
This is so neat. Thanks a ton for making these vids!
Amazing work ! Please dont stop doing this! you are an inspiration!!
Best videos ever! Love watching these.
You are flipping dope! Like the Bob Ross of codified art.
This is amazing. I'm starting to get attracted to differential integration. Thank you.
Crazy cool! I learned so much that I never got to in math in high school: Lorenz attractors, differential equations, etc. Some people don't like Dan's approach and his quirkiness, but it all works great for me!
Youre really cool, keep up the awesome work!
You are the most inspiring person 🙌🏽 when it comes to coding. Thank you for your great videos.
Thanks Daniel, I finally got the differential essence! Haha, I didn't expect that to happen in a coding challenge. Good job!
Beautiful tutorial! I'm a High School Student with a keen interest in coding and computer science and this tutorial has been tremendously useful in teaching me how to generate the Lorenz Attractor by myself for a project :) Thank you!!
Man you are very very good, thanks to this presentation I managed to finally get some great info on Lorenz's atractor and finish my school work. Thank you!!
That is simply amazing!
Hello!! Just wanted you to know that you are really helping people with this channel. I am a physics student and I've been trying to learn programming for a while but didn't reallly feel something to ...... get me hyped for it, you know? That is, until i found your nature of code book on the web and it's awesome. Even more so, you got those vids with really interesting stuff and awesome explanations - really good way of teaching and talking to people to make them understand! So, what I wanted to say, thanks so much for everything you are doing!!!!
@TheCodingTrain
8 жыл бұрын
Thank you I am so glad to hear!
Never thought someone could make differential equations entertaining. You have done it.
I'm reading James Gleick's Chaos right now, and I became a bit spellbound by the Strange Attractor, and I've recently started learning about Processing and playing with it, so I googled "Lorenz Strange Attractor Processing" and the miracle of this video came up. Thank you so much for making it. A true dream come true.
I'm so glad I found your videos!
I made this exercise with 16 at 1994, it was an huge success in class. Used clipper and same graphical new clipper library that I got don’t know were, I think it had some mouse capability too. But then Delphi appears... This blog really captures the joy of programming that many times comes from this small projects. Continue the good work. The number of videos is impressive and already a very good library and an amazing starting point. Potencial value is huge.
Loving these videos!
Dude this is such a cool technique.
This gives me a crazy new perception of the universe. Maybe were just in a 3D simulation, and the Big Bang was just God finishing his processing sketch and clicking run. 🤯
I know absolutely nothing about coding. To be honest, I don't know the first rule of it. It has always been my dream, coding games for entertainment and programs to simplify things. I have I.T. as a subject next year, hoping it could give me some insight on coding, even if it's a minimum. I have a book full of ideas for games I want create, sadly, I can't just jump into it without any knowledge. I watch your videos, because I like the feeling of knowing that I will be able to do this one day if I work hard enough, and I love how code looks and feels. It amazes me. Thank you Daniel.
@satibel
7 жыл бұрын
you can try scratch ( scratch.mit.edu/ ) it's a program to make games easily and visually. It can help you get the idea of how programming works (basically you have blocks that interact together). example of how java works: int myvar; myvar=0; means myvar is an integer=0 String mystr; mystr="hello"; means myvar is a String="" functions work the same, but have parmeters int myfct(String myvar){ //some code return 0; } basically when making something you have [type] [name] [() or nothing] [{ } or ;] if you get these patterns (which are literal blocks in scratch, not words, programming is easy.
@blomblorpf
7 жыл бұрын
manaquri Thank you so much for your help. I think I know what I'll be doing for the rest of today... Thanks!! :D
@RitobanRoyChowdhury
7 жыл бұрын
I think you should look into the unity game engine (unity3d.com). It has some amazing tutorials on its site, as well as amazing youtube channels like Brackeys and quill18creates (as well as the related channels on their respective youtube pages) which should let you learn reasonably quickly. It uses C#, which could be a jump from scratches block-based programming, but it becomes easier and much more flexible than blocks quickly.
@satibel
7 жыл бұрын
Ritoban Roy Chowdhury thought I had put down some rambling about what to use as a "real" programming language, and I included unity, but it seems either ! didn't send it, or it was deleted, or it was somewhere else. though I approve unity (and c sharp) basically most current languages feel like csharp "but without" and/or "but with", so once you get that most mainstream languages will seem easy.
@RitobanRoyChowdhury
7 жыл бұрын
Exactly. If you can understand a language like C# or Java, it should be easy to switch to another language.
One of the best/most lovely Teacher/elder brother on the internet!
Best tutorial and coding KZreadr.
I know it is emotional but you are super exciting! Thank you for making learning to code so fun!
This is so useful!! I taught myself javascript and java mainly with these videos
I was learning java and android development but after seeing your challenges i decided to tackle with web development a little but and i found in very interesting .. You're an inspiration and you make learning so much fun
Thanks for doing what you're doing in the way you're doing it :)
This is so informative! Thank you!
That is great. Learning how to implement mathematics in code, and learning more advanced programming techniques in one video. Thanks Daniel, it's fantastic as always :).
@TheCodingTrain
7 жыл бұрын
Thanks so much, I'm so glad to hear!
Very awesome video! You are very talented! Keep up the good work!
Thanks this was great!
Thank you. Wonderful lesson!
I really like, this kind of live coding. I can see you each time add a piecec of code and how the new added code make a new effect to the whole program and show it as a graphic .
@TheCodingTrain
8 жыл бұрын
+Tube You Thanks for the feedback!
You make programming so entertaining, I hope my professors too😢. Keep making videos Mr. Dan and spread that attitude of yours.
Great illustration!
i love you. thanks for everything.
Amazing!
You are like the coding Mister Rogers. Great videos.
Thanks to you and Unreal Engine I finally understood how to use "ifs" hahaha I'm learning by my own, please don't be rude
very useful and easy understanding, thanks
I had to take a differential equations math course in college. A whole semester, and I was never really told what a differential equation was or when it was used. In 1.5 minutes you told me what my professor couldn't in 5 months. Truly amazing sir
This is awesome!
That’s amazing
I have to say: Awesome Dan!
On my next day off I'll have to mess around with this :D Seems awesome
I just witnessed the new "old spice" advert before this and I can't stop laughing
You are the best !!!! really thanks!
@TheCodingTrain
8 жыл бұрын
+Jose Lopez Thanks so much!
You the real MVP fam 😂
Omg this man is a genious
Smooth edit :) As always it's a pleasure to watch your videos. I both learn code technics and some interesting physic bits. Enjoy Shanghai and come back stronger than ever haha
@TheCodingTrain
8 жыл бұрын
+Furrane Thanks so much!
Wow, I just created a vm for macOS to make my project with xCode after hours of installations and settings. Now it's 4:45 am and I suddenly watch programming challenge on youtube... Pressed the subscribe button
This guy is a genius...
this video is so fucking amazing, great work!
Okay it might have taken me around 30 minutes but i made a functioning Lorenz Attractor! It works beautifully. Great videoseries. I guess the best way to learn programming is to first watch thenewboston's videos, and when you completely understand what you're doing you can proceed to these. Awesome life.
great video...! thanks Dan for such amazing videos .. I get so much to learn..
@TheCodingTrain
8 жыл бұрын
+Akshat Wahi Thanks for the nice feedback!
You are a genius...
Thanks!
You are a wizard.
You are so much better than the University of Sydney, I appreciate all the help you've given me!!
@TheCodingTrain
8 жыл бұрын
+Lumena Projections Thanks for the kind feedback!
Awesome 😊😃
This video inspired me to implement a Lorenz attractor in my arduiono and a RGB Led. Where x = red Y = green Z = blue It was very underwhelming.
@iamsushi1056
Жыл бұрын
Do it for a full screenspace image shader! You could even have another image be the input for the variables used to calculate the derivatives
I love you Daniel so much u saved my PhD with ur courses, 100 of Daniel in this world then we r all okay lol
i love it!!!
Finished finals, now I can play with processing :)
"Nothing is broken yet" - Every programmers' remorse
Really enjoying this series - One crit - butterflies flapping their wings anywhere don't cause eruptions - storms or droughts - yes - eruptions - nahhhh
@TheGreatAbstracto
7 жыл бұрын
yep - it was late /early
@kikones34
7 жыл бұрын
Ever heard about other punctuation marks besides the dash :D?
@mraagh8779
6 жыл бұрын
dashes - they are cool -
nice!
Terrific!
@TheCodingTrain
8 жыл бұрын
+Jorge Munoz Thank you!
god this is so cool!
These are really cool videos! Thanks for sharing. Could you do videos illustrating more complex physics phenomena? Maybe a double pendulum video or one with Lagrangian motion?
@TheCodingTrain
8 жыл бұрын
I've got this on my list! github.com/CodingRainbow/Rainbow-Topics/issues/15
Yey! At long last, a RAINBOW! :)
amazing
why the hell did 48 people dislike this video, dude this guy is a genius and a great teacher... creepy 48 people
i haven't gone through every comment to see if this has been suggested, but my immedate reaction as to how i would color it would be based on the distance the vertexes are from each other. I guess that gets a little meta too, 'cuz then you are looking at the rate it is changing at, or in other words, it dirivative, and you are already doing things with dirivitives. anyways, this was a great vid.
Nice
so good
you're the best :D
He protecc He atttacc But mostly importantly He *a t r a c c*
Nonlinear is not related to "small change in initial conditions leads to big changes in whole solution", it is related with stability. But, in the overall it's a great video, when i have time i will learn this. I simply loved it, if i could make a sugestion, theres anyway to access an "app" written in "processing" via QR code in cellphone? If it is a way, it will be very great advantage in physics and math classes.
Nice done! But my friend programmed a lorenz attractor too. So I'm familiar
youre so amazing kinda make me feel bad about studying Chem Eng lol. i am learning programing on my own tho.
Double is just like a float, but only more decimals... Great to know that the float is sufficient for such things. By the way: you're not '[merely] some person, here on the internet, programming colors and things on the screen,' you are a gifted instructor of mathematics and coding and have revived my interest in this subject. It takes away the daunting air associated with programming differentials and displaying such concepts on the screen through the expansive processing library... Even in 3d! Wow, I didn't know how powerful the existing java libraries were within processing. The possibilities are endless... Any chance of you showing us how to program a binomial expansion or Lorentz Transformation using these tools? Thank you!!
In your introduction, ≈ 2 min - Great idea to illustrate a real-world use of (ordinary) differential equations (ODE's). Except it's the *acceleration* (2nd derivative, d²y/dt²) of the mass, not its *velocity* (1st derivative, dy/dt) that is proportional to the displacement of the mass. But the main idea you wanted to get across, still gets across, IMO. And incidentally, the ODE that governs that mass-on-a-spring system, is one of the most important (and ubiquitous!) in all of physics - it's the Simple Harmonic Oscillator (SHO) equation, and its solutions are sine waves. It's the mathematical reason for there being so many sine waves in our lives... PS. My dad was a meteorologist who develeoped much of the early NWP (numerical weather prediction) computer models; and he once mentioned Ed Lorenz and his findings regarding chaos. Ultimately, this is why, no matter how powerful computers become, no matter how precise and how dense the observations going into the model are, there is some time range beyond which weather forecasting will always be impossible. And that's just one area of physics that's affected by chaotic behavior; there are scads of others. So this is a very important topic. Plus, you can make all these pretty pictures ;-) Fred
Daniel Shiffman, Saraj Raval, and Sentdex, you guys are my heroes. Am I missing anyone else guys?