Code Monkey home page Code Monkey logo

odes's Introduction

Documentation Status Build Status Version License Supported versions Supported implementations PyPI

DOI

Paper DOI

ODES is a scikit for Python 3.6-3.9 offering extra ode/dae solvers, as an extension to what is available in scipy. The documentation is available at Read The Docs, and API docs can be found at https://bmcage.github.io/odes.

Available solvers:

ODES provides interfaces to the following solvers:

  • BDF linear multistep method for stiff problems (CVODE and IDA from SUNDIALS)
  • Adams-Moulton linear multistep method for nonstiff problems (CVODE and IDA from SUNDIALS)
  • Explicit Runge-Kutta method of order (4)5 with stepsize control ( dopri5 from scipy.integrate)
  • Explicit Runge-Kutta method of order 8(5,3) with stepsize control ( dop853 from scipy.integrate)
  • Historical solvers: lsodi and ddaspk are available for comparison reasons. Use IDA instead! Note that lsodi fails on architecture aarch64.

Usage

A simple example solving the Van der Pol oscillator is as follows:

import matplotlib.pyplot as plt
import numpy as np
from scikits.odes import ode

t0, y0 = 1, np.array([0.5, 0.5])  # initial condition
def van_der_pol(t, y, ydot):
    """ we create rhs equations for the problem"""
    ydot[0] = y[1]
    ydot[1] = 1000*(1.0-y[0]**2)*y[1]-y[0]

solution = ode('cvode', van_der_pol, old_api=False).solve(np.linspace(t0,500,200), y0)
plt.plot(solution.values.t, solution.values.y[:,0], label='Van der Pol oscillator')
plt.show()

For simplicity there is also a convenience function odeint wrapping the ode solver class. See the User Guide for a simple example for odeint, as well as simple examples for object orientated interfaces and further examples using ODES solvers.

Projects that use odes

You can learn by example from following code that uses ODES:

  • Centrifuge simulation, a wrapper around the ida solver: see centrifuge-1d

You have a project using odes? Do a pull request to add your project.

Citing ODES

If you use ODES as part of your research, can you please cite the ODES JOSS paper. Additionally, if you use one of the SUNDIALS solvers, we strongly encourage you to cite the SUNDIALS papers.

odes's People

Contributors

bmcage avatar pplk avatar aragilar avatar florian98765 avatar c-abird avatar cklb avatar logicabrity avatar saransh-cpp avatar idontgetoutmuch avatar flokli avatar valentinsulzer avatar martinjrobins 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.