Solving PDEs with the FFT [Python]

Поділитися
Вставка
  • Опубліковано 14 жов 2024
  • This video describes how to solve PDEs with the Fast Fourier Transform (FFT) in Python.
    Book Website: databookuw.com
    Book PDF: databookuw.com/...
    These lectures follow Chapter 2 from:
    "Data-Driven Science and Engineering: Machine Learning, Dynamical Systems, and Control" by Brunton and Kutz
    Amazon: www.amazon.com...
    Brunton Website: eigensteve.com
    This video was produced at the University of Washington

КОМЕНТАРІ • 73

  • @fzigunov
    @fzigunov 4 роки тому +52

    Dr. Brunton, I just would like to thank you. I'm towards the end of my PhD in fluid mechanics and your lectures have been an integral part of it. You're an awesome presenter and teacher!!

    • @Eigensteve
      @Eigensteve  4 роки тому +8

      Awesome, glad these helped!

    • @funkygenesis
      @funkygenesis 3 роки тому +3

      @@Eigensteve could you tell me what advantage does fft offer over contemporary methods (e.g. finite difference etc. etc.) While solving pdes? Thanks!

  • @pradiptahafid
    @pradiptahafid 2 роки тому +12

    0:29. Is he writing with the mirror effect? I thought he writes normally and during the editing, he mirrors the video. Anyway, Trully blessed the modern era because of you. For someone who does not come from a math background, this video is a gem. I have been spending 2 weeks on your books and videos. They are amazing.

  • @nezv71
    @nezv71 4 роки тому +18

    I've always wanted to make a video series like these. So many students feel like there is a big mystical gap between these concepts and the hands-on of coding and using them. Your videos do a great job of demystifying, keep up the good work!

  • @flaguser4196
    @flaguser4196 2 роки тому +5

    I had always thought that the videos are mirrored in post production. But after seeing Steve write a mirrored "FFT" by mistake at the start, I'm not sure anymore. So he actually trained to write mirrored after all. I'm really thankful!

    • @huaiyizhao8896
      @huaiyizhao8896 Рік тому

      Same. Can't imagine how he managed to write mirrored.

    • @huaiyizhao8896
      @huaiyizhao8896 Рік тому

      And I'm not sure if he writes with his left hand...

    • @AkamiChannel
      @AkamiChannel 10 місяців тому +8

      Haha I think that was a little tongue-in-cheek trolling

  • @pierrestemmettmusic
    @pierrestemmettmusic 4 роки тому +5

    My new favourite youtube channel of all time! Thank you Steve Brunton you're a hero. The sole reason I am passing my degree.

  • @mohammadumair7778
    @mohammadumair7778 4 роки тому +27

    Dr. Brunton, you have played a cruel trick, a cruel trick indeed! 😅

  • @HassanKhan-cs8ho
    @HassanKhan-cs8ho 4 роки тому +4

    This video lecture series by you have been a life changing experience for me. you have truly demystified on how to go from complex mathematical concept to coding it and then applying it. the elegance with which you implement the algorithm in code is really motivating for me to apply it myself and test under different applications. Thank you sir and i hope you keep us mesmerized further with your future lectures.

  • @mathieug6136
    @mathieug6136 4 роки тому +10

    That was a good lecture! I didn't look at those math in like 10 years.

  • @pipertripp
    @pipertripp 3 роки тому +1

    ha. First time I've ever seen someone write "backwards" on a lightboard. It's such cool tech. Probably makes teaching a lot more engaging for the presenter since they can look at the class the entire time.

  • @qiguosun129
    @qiguosun129 Рік тому

    Dr.Brunton's lecture just like art.

  • @apostoloskountouris5144
    @apostoloskountouris5144 4 роки тому +4

    Hi ambidextrous mirror magician Steve!
    Your videos are outstanding and you are a real teacher!
    However I must say that you are a very sneaky individual for doing this inverse writing FFT (3 letters) in the beginning making this surprised look and then starting all over!
    Very sneaky indeed!
    cheers!

  • @dypoet
    @dypoet 4 роки тому +28

    I have been thinking Steve must been writing the text left to right and flipped the video so that we won't see the text opposite. But at the beginning he wrote the text from right to left accidentally. Does this means he has been writing/drawing in the opposite way all the time?

    • @dericknganyut.3795
      @dericknganyut.3795 3 роки тому +1

      exactly my thoughts. If he has been writing/drawing in the opposite way all this while, then that is even more mind-blowing :)

    • @psylonmusic5264
      @psylonmusic5264 3 роки тому +11

      isn't it just a little joke to fool us ?

    • @eCabrolify
      @eCabrolify 3 роки тому +1

      @@psylonmusic5264 I think so, yes.
      Director's cut :)

    • @danielprol1115
      @danielprol1115 3 роки тому +4

      In older videos you can watch some of his university lectures. He is left handed, so this video is clearly mirrored.

  • @LucasDimoveo
    @LucasDimoveo 4 роки тому +4

    I'm a stay-at-home parent on the journey of self-learning mathematics until I can go to university. Knowing that I'll be able to approach interesting and difficult applied problems with Python and PDEs is a huge motivator. Thank you for making your material public!
    Other than a background in Scientific Computing, Calculus and ODEs, and (introductory) Linear Algebra, what else would you recommend as preparation for your book?

    • @Eigensteve
      @Eigensteve  4 роки тому +9

      Thanks so much for your comment! Really glad you like the material and that you are finding it useful! I think the background you mentioned would be a great start. Most of the book relies on linear algebra and ODEs. Taylor series are also good. A good course in statistics and another in optimization will never hurt anything.

  • @DeonMitton
    @DeonMitton 3 роки тому +1

    That trick was very clever... I bet people were thinking hard about that one !

  • @felipegabriel9220
    @felipegabriel9220 4 роки тому +3

    Nice lecture, those plots were awesome!

  • @williamcoggins8336
    @williamcoggins8336 Рік тому +1

    Amazing content! Do you think this approach can be use to solve the time - independent Schrodinger eqn?

  • @leilikheirkhah6203
    @leilikheirkhah6203 3 роки тому

    Thanks Dr. Brunton, your teaching style is incredibly great! The video helped me alot.

  • @alialavib
    @alialavib 4 роки тому +2

    Great job posting videos amid all this

  • @kristiantorres1080
    @kristiantorres1080 3 роки тому +1

    Amazing video! Why is a 2*pi multiplying de fft in the kappa calculation?

  • @onlinepradeep
    @onlinepradeep 4 роки тому +2

    Great lecture Sir. Please upload a video for solving of non linear partial differential equations like Navier stock equations.

    • @Eigensteve
      @Eigensteve  4 роки тому +1

      Thanks for the suggestion -- it is on my list, but might take a while.

  • @CHAMPION-1-Winner
    @CHAMPION-1-Winner 3 місяці тому

    The 🐐 PERIOD!

  • @hemanthHK45
    @hemanthHK45 4 роки тому +1

    The presentation was excellent.... Good Explanation.... What about PDE solving in OpenFOAM Simulation?

    • @Eigensteve
      @Eigensteve  4 роки тому

      Thanks! There are absolutely lots of other good environments to solve complex PDEs with non-trivial boundary conditions. OpenFOAM is a really cool open platform for fluids simulations.

  • @TURALOWEN
    @TURALOWEN 4 роки тому

    Dr. Brunton, I have learned a lot from you in the last couple of years by watching your videos. Thank you so much! I have a question on the Python code for solving PDEs using FFT. In the notebook of solving heat equation with FFT, it says that 'odeint' does not play well with complex numbers, and that is why you extended uhat that vector into real and imaginary parts. But in the 'Burgers' code, you actually use np.fft.fft() and np.fft.ifft() within the RHS function, and odeint still works. Why would odeint work in one scenario but not in another when both have complex numbers in them? I tried to add few other terms such as dispersion (u_xxx), and I get results that do not make sense (I should have energy preserved but code gives me 0's after one-time step). In particular, whenever I try (1j) * (kappa**3)*uhat for the Fourier transform of u_xxx, it seems that odeint fails. Could you please help me understand what is going on? Thank you. Tural Sadigov

  • @stepanshcherbinin7409
    @stepanshcherbinin7409 3 роки тому

    It is a great pleasure to watch this lection. Thanks!

  • @ismaelpour
    @ismaelpour 4 роки тому +1

    Thank you, Thank you, Thank you. Truly life-changing ✌

  • @prasanthkumar1770
    @prasanthkumar1770 4 роки тому

    Hello Steve, awesome lectures. Great work.
    Can you please let me know how were you able to display the computer screen and preconstructed graphs on the glass board.
    This would be really helpful to me please guide me. Thank you in advance. 😊

  • @hubstrangers3450
    @hubstrangers3450 4 роки тому +1

    Thank you for the content, just a simple query, is there a git repos, or just have use the book?

    • @Eigensteve
      @Eigensteve  4 роки тому

      Everything is at: github.com/dynamicslab/databook_python

  • @human-b3b
    @human-b3b 4 роки тому

    Thank you for the series. By your mistake at 0:26 I acknowledged that you write from right to left to counter the mirror effect! Wouldn't it be easier for you to write normally and then just flip the video vertically? Or you just enjoy the mental exercise ;)

    • @fnegnilr
      @fnegnilr 4 роки тому

      Magic is created through misdirection.....

  • @ing.erickosorio2887
    @ing.erickosorio2887 4 роки тому +2

    Awesome video

  • @Rudolf-ul1zh
    @Rudolf-ul1zh Рік тому

    What is the advantage of integrating in the frequency domain if we could also just integrate the heat equation in the space domain?

  • @thiernomamadoubalde686
    @thiernomamadoubalde686 3 роки тому

    very interesting course. Could we have a PDF version?

  • @eduardofontanalazzari9498
    @eduardofontanalazzari9498 3 роки тому

    Professor Brunton, thank you for the awesome lecture! Besides initial conditions, is there anyway to impose boundary conditions in this problem? For example, if there was a heat source in x = -L/2, how to describe it in the algorithm? Thank you a lot again.

    • @federicogasparv
      @federicogasparv 3 роки тому

      There is a boundary condition. I cite his book: When solving this PDE using the FFT, we are implicitly assuming that the solution domain is periodic, so that the right and left boundaries are identified and the domain forms a ring. However, if the domain is large enough, then the effect of the boundaries is small.

  • @teddyregrets8384
    @teddyregrets8384 2 роки тому

    taking a class on this rn with THE Leslie Greengard

  • @funkygenesis
    @funkygenesis 3 роки тому +1

    So could anybody tell me what advantage does this algorithm offer over contemporary methods (e.g. finite difference etc. etc.)? Thanks!

  • @yuanhu6031
    @yuanhu6031 2 роки тому

    Amazing content! Great work!

  • @AJ-et3vf
    @AJ-et3vf 2 роки тому

    Awesome video! Thank you!

  • @ashutoshsingh-et7vm
    @ashutoshsingh-et7vm 2 роки тому

    Hello Dr. Burton thank you for all theses content. Cant we solve navierstokes equation from this approach and this may be better than discretization of diff eq and way faster than it. But still ITS more famous and used mostly by every commercial package

  • @shahul3464
    @shahul3464 3 роки тому

    I am a bit confused. to solve a PDE consisting of second order derivative in space, should have two boundary conditions specified. What are the boundary conditions assumed here? any help? thanks in advance.

  • @randomness2622
    @randomness2622 4 роки тому +1

    Joke's on you, I was watching from the back of my screen when you started 😊

  • @ouni127
    @ouni127 Рік тому

    Does anyone know what magic this blackboard has? Can it automatically mirror the words written by the teacher, or does the teacher need to judge the writing method of the mirror when writing, which may be a bit too difficult.

  • @navsquid32
    @navsquid32 3 роки тому

    Anyone have any idea what integrator odeint uses? Documentation says it uses the LSODA algo from FORTRAN, but I couldn't an overview anywhere. I programmed a 4th-order Runge-Kutta integrator to solve this system, and needed a time-step of 1 millisecond in order for the solution to be stable. Obviously here the time step of 0.1 seconds is sufficient for odeint, and it's boggling my mind.

  • @Fonzie2909
    @Fonzie2909 3 роки тому

    Is the Jupyter script available online?

  • @jdsahr
    @jdsahr Рік тому

    Nice presentation.
    But all real scientists know that n starts at 0 and goes to N-1. When we meet our Maker, those who use Matlab/FORTRAN array indexing will be severely frowned at.

  • @biswarajpalit
    @biswarajpalit 3 роки тому +1

    where can I find the python codes ?

    • @kunvin
      @kunvin 4 місяці тому

      On the screen!

  • @cunningham.s_law
    @cunningham.s_law 4 роки тому

    any uses for the z transform?

  • @devargyachakraborty9068
    @devargyachakraborty9068 4 роки тому

    Can any body tell me the line after the odient command is used. I am not getting it

  • @bgaskin
    @bgaskin 4 роки тому +1

    Oh, partial differential equations. I see :)

  • @robbiewilliamson9783
    @robbiewilliamson9783 6 місяців тому

    I love you

  • @HakanTheUltimateHoca
    @HakanTheUltimateHoca 2 роки тому +2

    0:25 what

  • @keeperofthelight9681
    @keeperofthelight9681 2 роки тому

    How to do this on 2D surface.

  • @sciaeil4917
    @sciaeil4917 3 роки тому

    Steve "EigenSteve" Brunton

  • @likestomeasurestuff3554
    @likestomeasurestuff3554 2 роки тому

    ok wow thats interesting

  • @AkamiChannel
    @AkamiChannel 10 місяців тому

    No link to a git repo 😭😭😭
    Are we just monkeys that have to type everything out? And then make a typo and spend an hour troubleshooting? Then realize the problem is that we are using a newer version of python? Is that what you wish of us?

  • @shakirullah9434
    @shakirullah9434 3 роки тому

    ODE convert to PDE
    is posibal.

  • @PaulKorir
    @PaulKorir 10 місяців тому

    Did you just fake that you can write in reverse?!? 😂😂😂 I’m curious how many people noticed that.