GithubHelp home page GithubHelp logo

Accuracy about findiff HOT 2 CLOSED

maroba avatar maroba commented on August 18, 2024
Accuracy

from findiff.

Comments (2)

maroba avatar maroba commented on August 18, 2024

Hi,

the problem is that you are trying to use an extremely high accuracy order (60) on an equidistant grid. The finite difference method is inherently unstable in that case. The reason is the so-called Runge phenomenon, which also appears for Lagrange interpolators of high order. To avoid that, you would have to use a non-equidistant grid. With finite difference methods, you would normally want to find the sweet spot between performance, accuracy and stability. Personally, in practice, I wouldn't go higher than order 6. If you need higher accuracy orders, for instance because you can only afford to calculate on a coarse grid, then you should consider spectral methods. If you have periodic boundary conditions, then Fourier methods would be the way to go. If you have a non-periodic case, Chebyshev methods are a great spectral method. The cost for that is to use a non-equidistant grid, though. For a great practical introduction to spectral methods, I can highly recommend "Spectral Methods with MATLAB" by Lloyd Trefethen.

Best regards,
Matthias

from findiff.

trixxx3 avatar trixxx3 commented on August 18, 2024

Thanks for the fast reply Matthias,

okay than it is a general issue i cannot avoid. The gererall thing is, that i try to reproduce a papers outcome on an equation like
dw/dt = A * d^4w/dx^4 + B * d^2w/dx^2 + C * w
using FowardTimeCentralSpace method and i cannot set dx and dy to their default values since it runs unstable in my case thats is why i tried higher accuracy to reduce the errors.

Lets see if i can handle Spectral Methods. I tried to avoid it since my time in understanding a new technique is limited.

Best regards
Lukas

from findiff.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.