Nonlinear Differential Equations Using Finite Differences: Can we Use Sparse Matrices?

Поделиться
HTML-код
  • Опубликовано: 11 фев 2025
  • NOTE: WHEN RECORDING THIS, i ACCIDENTALLY FORGOT TO USE THE SPARSE IDENTITY MATRIX IN MATLAB. THE GITHUB CODE HAS BEEN UPDATED AND IS CORRECT. THE 10000-DIMENSIONAL SYSTEM IS NOW SOLVED IN 0.9 SECONDS INSTEAD OF TWO MINUTES!
    In answer to a question, we look at using sparse matrices in the solution of boundary value problems. For nonlinear problems, things become more complicated, but we can still use fsolve to solve the underlying system of equations. The issue with Python is the solver cannot handle sparse Jacobian matrices so this limits the utility of this method to small problems. For solvers that can handle sparse Jaboians such as MATLAB’s, we can still get good performance despite having to use a nonlinear solver.
    Wikipedia Article on the Jacobian Matrix: en.wikipedia.o...
    Github Python Notebook: github.com/kpm...
    Github MATLAB Code: github.com/kpm...
    Tip Jar: paypal.me/kpmo...

Комментарии • 7

  • @nordenstorm
    @nordenstorm 3 года назад +2

    You are just a wonderful human being for making this content. Thanks : )

  • @NurbolBekbossin
    @NurbolBekbossin 4 месяца назад +1

    I over coded my simple 2D homogeneous diffusion model with one injector and producer wells using insane amount of for loops. Where was this when I was struggling :D

  • @joaovictorfonseca4256
    @joaovictorfonseca4256 3 года назад +1

    Yours videos are awesome, thanks for making it public

  • @AJ-et3vf
    @AJ-et3vf 3 года назад +2

    Thank you very much sir for giving an example of solving a nonlinear system with fdm. I thought and tried to understand and derive the sparse matrices in the nonlinear fdm case, but I'm not able to do it. But now that I've seen your video, I think I might be able to now. Thank you for this.
    I could only solve a nonlinear bvp problem using fdm using the Gauss-Seidel method.

  • @hyunmyunglee8962
    @hyunmyunglee8962 Год назад +1

    thanks for the great video! It helped a lot! But I have a question. Can nonlinear differential equations that involves sine of the function to be known be solved using these methods? for example, d^2/dx^2( f(x,y) ) + d^2/dy^2( f(x,y) ) + sin( 2*f(x,y) ) = 0 ?

  • @meghashree2887
    @meghashree2887 2 года назад

    The video is completely blur to follow the code, please can u share the clarity one