Giter VIP home page Giter VIP logo

ode's Introduction

ODE

These codes are examples of solving ordinary differential equations using the finite difference method, the method of runge kutta of order 4, scipy's "odeint" function and other methods. Some codes also feature an animation of the solution. The "neōn_katalogos" file (as the name might suggest) is a list containing several examples of implicit, explicit and symplectic ode-solving algorithms; all of them, for simplicity are applied to the harmonic oscillator. Some of them are also in the file ode.c

We briefly present the various methods used, each of these, unless otherwise specified, is contained as an example in the file neōn katalogos:

Euler

The former are Euler's methods, classical, implicit and semi-implicit (the latter symplectic)

it is easy to verify the advantage of the latter method compared to the previous two as it is associated with a canonical transformation.

Mid-point

Another first order method and symplectic integrator is the midpoint method that we present in its implicit and explicit formulation: implicit:

explicit:

velocity verlet

Another algorithm is verlet velocity integration, a symplectic method:

Runge-Kutta 4

A method that could not miss the is :runge kutta of 4 th order:

if f=f(t) this method became Cavalieri-Simpson rule

Yoshida4

If we wanted a symplectic integrator of higher order we can use Yoshida4:

the value of the coefficients d_i and c_i are in the code

prediction and correction

We can also use multiple integrators through the prediction and correction method. In this code it is implemented using the classic euler and the trapezoidal rule. With classical Euler we do the prevision and then correct them with trapezoidal rule:

adams-bashforth-moulton, order 4

The following is a fourth-order predictor-corrector method using an explicit Adams-Bashforth scheme as a predictor and an implicit Adams-Moulton scheme as a corrector. To get started, three points of the solution are needed, which are calculated using an RK4

Boundary problem

A technique that is not used in the neōn katalogos code is the shooting method, because it was made for boundary value problems and not for initial value problems. It allows you to solve a boundary value problem by reducing it to the system of an initial value problem as we can see in shooting.py. In this code we use the first derivative in t = 0 as a parameter that is not known and we try to find the value for which the solution takes the correct value on the boundary. (we remember that in general the solution isn't unique for boundary problems)

In some particular case, as in Schrodinger's equation where the initial condition are known, if the potential is even, we can use the energy as parameter. Two examples are in buca quadrata e osc.arm-s (see repository: quantum-mechanics)

Adaptive integrator

The adaptive.py code is an example of an integrator with an adaptive step (Runge–Kutta–Fehlberg method and Cash-Karp Runga-Kutta Method (to do) ), i.e. the integration step changes during the simulation. To test it, as always, the harmonic oscillator is used. Brief explanation of the method:

The coefficients are reported in the code.

ode's People

Contributors

francesco-zeno-costanzo avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

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.