Тёмный

Coding Challenge #12: The Lorenz Attractor in Processing 

The Coding Train
Подписаться 1,7 млн
Просмотров 406 тыс.
50% 1

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: ru-vid.comjoin
🛒 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

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

 

5 июл 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 432   
@purify_with_liberties_flame
@purify_with_liberties_flame 7 лет назад
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
@davidmitchell2761 3 года назад
EXACTLY.
@theman7050
@theman7050 2 года назад
Ikr
@robertobreve8623
@robertobreve8623 5 лет назад
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!
@thecosmicwhale
@thecosmicwhale 7 лет назад
You make learning programming so entertaining Dan, you ROCK!!!
@dickheadrecs
@dickheadrecs 7 лет назад
I would love to see a processing sketch that graphs Dan's heartbeat when he's doing these challenges
@Shenanigans07
@Shenanigans07 4 года назад
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
@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: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-fkIr0inoQ7Y.html.
@electriic2540
@electriic2540 7 лет назад
This channel is the most underrated thing. Thank you so much for these videos!
@13Uzamakifan
@13Uzamakifan 7 лет назад
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!!
@DannyHudetz
@DannyHudetz 7 лет назад
These are so great. I'm glad i found them. they have taught me so much and deserve a lot more views.
@mikeandrewfernandez9797
@mikeandrewfernandez9797 Год назад
I love the way of him teaching so passionately. Full of energy!
@taylorbaratka6883
@taylorbaratka6883 6 лет назад
add "rotateY((hue/255)/360);" at line 44 or 45 right after "hue +=1;" and the curve will auto-rotate.
@TheCodingTrain
@TheCodingTrain 6 лет назад
nice tip!
@aj1sharma
@aj1sharma 7 лет назад
you are just awesome. you encourage me take on new challenges and finish them as fast as possible.
@abrahamjacob8876
@abrahamjacob8876 6 лет назад
Amazing work ! Please dont stop doing this! you are an inspiration!!
@JohnDoe-ki6fm
@JohnDoe-ki6fm 5 лет назад
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
@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)
@ashmitabhattacharyya6612
@ashmitabhattacharyya6612 3 года назад
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!!
@abominavelhomemdasbets5889
@abominavelhomemdasbets5889 7 лет назад
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!!
@AzuriumOfficial
@AzuriumOfficial 7 лет назад
Thanks Daniel, I finally got the differential essence! Haha, I didn't expect that to happen in a coding challenge. Good job!
@BobIrving2
@BobIrving2 5 лет назад
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!
@AshNapToys
@AshNapToys 7 лет назад
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.
@jothe3inv
@jothe3inv 7 лет назад
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
@TheCodingTrain 7 лет назад
Thank you!
@robertsolomon3328
@robertsolomon3328 8 лет назад
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
@TheCodingTrain 8 лет назад
Thank you I am so glad to hear!
@kronosuber9849
@kronosuber9849 4 года назад
Never thought someone could make differential equations entertaining. You have done it.
@Aprameyo
@Aprameyo 7 лет назад
Best videos ever! Love watching these.
@mahyarazad
@mahyarazad 3 года назад
You are the most inspiring person 🙌🏽 when it comes to coding. Thank you for your great videos.
@adrianojordao4634
@adrianojordao4634 3 года назад
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.
@Timisenman
@Timisenman 4 года назад
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.
@prestonchen2046
@prestonchen2046 6 лет назад
You are flipping dope! Like the Bob Ross of codified art.
@saltyyolk9934
@saltyyolk9934 5 лет назад
This is amazing. I'm starting to get attracted to differential integration. Thank you.
@madhavsirohi2225
@madhavsirohi2225 2 года назад
One of the best/most lovely Teacher/elder brother on the internet!
@penguin1212
@penguin1212 6 лет назад
This is so neat. Thanks a ton for making these vids!
@satyman08
@satyman08 3 года назад
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. 🤯
@astropgn
@astropgn 6 лет назад
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!
@meridel9635
@meridel9635 7 лет назад
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
@TheCodingTrain 7 лет назад
Thanks so much, I'm so glad to hear!
@321123580
@321123580 7 лет назад
I know it is emotional but you are super exciting! Thank you for making learning to code so fun!
@Amrhossam96
@Amrhossam96 7 лет назад
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
@samlau7948
@samlau7948 7 лет назад
Youre really cool, keep up the awesome work!
@user-ig6sc7sg8x
@user-ig6sc7sg8x 8 лет назад
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
@TheCodingTrain 8 лет назад
+Tube You Thanks for the feedback!
@arjunarya2658
@arjunarya2658 3 года назад
This is so useful!! I taught myself javascript and java mainly with these videos
@computerwiz38
@computerwiz38 7 лет назад
Very awesome video! You are very talented! Keep up the good work!
@eduardvolochitin432
@eduardvolochitin432 5 лет назад
Best tutorial and coding RU-vidr.
@_-__-_6355
@_-__-_6355 7 лет назад
I'm so glad I found your videos!
@Dracstar
@Dracstar 7 лет назад
That is simply amazing!
@jaysonbalatong4075
@jaysonbalatong4075 4 года назад
You make programming so entertaining, I hope my professors too😢. Keep making videos Mr. Dan and spread that attitude of yours.
@PsychedelicMindFluid
@PsychedelicMindFluid 7 лет назад
Loving these videos!
@whimsy5623
@whimsy5623 3 года назад
Dude this is such a cool technique.
@EidurMoller
@EidurMoller 5 лет назад
You are like the coding Mister Rogers. Great videos.
@digitalArtform
@digitalArtform 8 лет назад
"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
@TheCodingTrain 8 лет назад
+digitalArtform Added to my list!
@Lostpanda123
@Lostpanda123 7 лет назад
Great illustration!
@brandonallen2301
@brandonallen2301 3 года назад
This is so informative! Thank you!
@shamuratov
@shamuratov 5 лет назад
Thanks for doing what you're doing in the way you're doing it :)
@oldrocker3438
@oldrocker3438 5 лет назад
Thank you. Wonderful lesson!
@furrane
@furrane 8 лет назад
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
@TheCodingTrain 8 лет назад
+Furrane Thanks so much!
@druidofpies
@druidofpies Год назад
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
@favc097
@favc097 5 лет назад
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
@imadsaddik
@imadsaddik Год назад
Thanks this was great!
@mrcoder2035
@mrcoder2035 7 лет назад
This is awesome!
@younusameenmuhammed3860
@younusameenmuhammed3860 2 года назад
very useful and easy understanding, thanks
@blomblorpf
@blomblorpf 7 лет назад
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
@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
@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
@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
@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
@RitobanRoyChowdhury 7 лет назад
Exactly. If you can understand a language like C# or Java, it should be easy to switch to another language.
@milkyroad9593
@milkyroad9593 6 лет назад
I have to say: Awesome Dan!
@jokes108
@jokes108 2 года назад
Amazing!
@klokibril
@klokibril 7 лет назад
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.
@MrThangHam
@MrThangHam 6 лет назад
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
@somthings_wrong_here_now_maybe
On my next day off I'll have to mess around with this :D Seems awesome
@anon5597
@anon5597 8 лет назад
You are so much better than the University of Sydney, I appreciate all the help you've given me!!
@TheCodingTrain
@TheCodingTrain 8 лет назад
+Lumena Projections Thanks for the kind feedback!
@abhijanwasti7991
@abhijanwasti7991 7 лет назад
You the real MVP fam 😂
@AkshatWahi
@AkshatWahi 8 лет назад
great video...! thanks Dan for such amazing videos .. I get so much to learn..
@TheCodingTrain
@TheCodingTrain 8 лет назад
+Akshat Wahi Thanks for the nice feedback!
@noahgundotra1062
@noahgundotra1062 8 лет назад
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
@TheCodingTrain 8 лет назад
I've got this on my list! github.com/CodingRainbow/Rainbow-Topics/issues/15
@plafhz
@plafhz 8 лет назад
You are the best !!!! really thanks!
@TheCodingTrain
@TheCodingTrain 8 лет назад
+Jose Lopez Thanks so much!
@pietroantenucci6415
@pietroantenucci6415 21 день назад
That’s amazing
@moforogue
@moforogue 4 года назад
i love you. thanks for everything.
@zerocoll20
@zerocoll20 5 лет назад
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.
@AlejandroRodriguez-lq9mz
@AlejandroRodriguez-lq9mz 4 года назад
Omg this man is a genious
@touisbetterthanpi
@touisbetterthanpi 7 лет назад
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.
@pa.l.2499
@pa.l.2499 4 года назад
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!!
@Aykoo
@Aykoo 7 лет назад
i love it!!!
@arshadjaveed7877
@arshadjaveed7877 6 лет назад
Awesome 😊😃
@ezzie_baby
@ezzie_baby 2 года назад
Thanks!
@boutalbimedchaker2534
@boutalbimedchaker2534 2 года назад
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
@kunaldas1736
@kunaldas1736 4 года назад
This guy is a genius...
@morwar_
@morwar_ 7 лет назад
this video is so fucking amazing, great work!
@sariojorgeroden
@sariojorgeroden 8 лет назад
Terrific!
@TheCodingTrain
@TheCodingTrain 8 лет назад
+Jorge Munoz Thank you!
@gloverelaxis
@gloverelaxis 4 года назад
god this is so cool!
@zakkia6784
@zakkia6784 7 лет назад
I just witnessed the new "old spice" advert before this and I can't stop laughing
@jay290489
@jay290489 3 года назад
You are a genius...
@souravdey1227
@souravdey1227 2 года назад
You are a wizard.
@JigaByte
@JigaByte 7 лет назад
nice!
@humayan91
@humayan91 7 лет назад
you're the best :D
@GuitarHickNick
@GuitarHickNick 7 лет назад
amazing
@fakkmorradi
@fakkmorradi 7 лет назад
so good
@iamsushi1056
@iamsushi1056 Год назад
I’m considering trying this as a glsl shader that takes an image/video input, and then each pixel’s RGB value gets mapped as the inputs for that pixel’s Lorenz attractor as like this crazy stochastic glitch art camera filter
@tobiasgorgen7592
@tobiasgorgen7592 3 года назад
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
@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
@bluetheredpanda
@bluetheredpanda 2 года назад
Great video! (as always) Quick question @The Coding Train : how would you go about attaching another value to each vector (ie color)? I suppose you'd need to change the array list type, but after that I'm lost.
@QQSwam
@QQSwam 7 лет назад
Finished finals, now I can play with processing :)
@TheOne-fu1nh
@TheOne-fu1nh 6 лет назад
Very nice videos, really stretching out how creative a person can be!!! I'm a begginer coder only know HTML5, CSS and now finishing Javascript... uh , one question (will sound dull i know) is the language used here Python?
@moizshaikh2994
@moizshaikh2994 5 лет назад
Nice
@ffggddss
@ffggddss 4 года назад
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
@circli
@circli 6 лет назад
Yey! At long last, a RAINBOW! :)
@cn-ml
@cn-ml 6 лет назад
"Nothing is broken yet" - Every programmers' remorse
@noonemate3616
@noonemate3616 7 лет назад
Great video! Btw what is your theme/font/fontsize for the ide
@glace848
@glace848 Год назад
great video. how do you rotate/scale your sketch with you mouse tho? (im very new to processing, as a matter of fact i solely started looking into it because of this video)
@NelsonR001
@NelsonR001 7 лет назад
youre so amazing kinda make me feel bad about studying Chem Eng lol. i am learning programing on my own tho.
Далее
Are there other Chaotic Attractors?
6:54
Просмотров 472 тыс.
КОРОЧЕ ГОВОРЯ, ШКОЛА БУДУЩЕГО
10:40
Сумерки сасага🧛
11:41
Просмотров 730 тыс.
Coding Challenge #90: Floyd-Steinberg Dithering
28:51
Просмотров 434 тыс.
Bézier curves (Coding Challenge 163)
22:59
Просмотров 265 тыс.
Coding Challenge #113: 4D Hypercube (aka "Tesseract")
43:53
Coding Challenge 166: ASCII Text Images
22:42
Просмотров 1,1 млн
ASMR Programming - Spinning Cube - No Talking
20:45
Просмотров 3,7 млн
Chaos Theory: the language of (in)stability
12:37
Просмотров 545 тыс.
КОРОЧЕ ГОВОРЯ, ШКОЛА БУДУЩЕГО
10:40