Giter Club home page Giter Club logo

diffsol's Introduction

DiffSol

Diffsol is a library for solving ordinary differential equations (ODEs) or semi-explicit differential algebraic equations (DAEs) in Rust. You can use it out-of-the-box with vectors and matrices from the nalgebra or faer crates, or you can implement your own types by implementing the various vector and matrix traits in diffsol.

Features

DiffSol implements the following solvers:

  • A variable order Backwards Difference Formulae (BDF) solver, suitable for stiff problems and singular mass matrices.
  • A Singly Diagonally Implicit Runge-Kutta (SDIRK or ESDIRK) solver, suitable for moderately stiff problems and singular mass matrices. You can use your own butcher tableau or use one of the provided (tr_bdf2 or esdirk34).
  • A BDF solver that wraps the IDA solver solver from the Sundials library (requires the sundials feature). This is similar to the BDF solver above and is include for comparison purposes.

All solvers feature adaptive step-size control to given tolerances, dense output, event handling, stepping to specific times and forward sensitivity analysis. For comparison, the BDF solvers are similar to MATLAB's ode15s solver or the bdf solver in SciPy's solve_ivp function. The ESDIRK solver using the provided tr_bdf2 tableau is similar to MATLAB's ode23t solver.

Users can specify the equations to solve in the following ODE form:

$$M \frac{dy}{dt} = f(t, y, p)$$

where $M$ is a (possibly singular) mass matrix, $y$ is the state vector, $t$ is the time, $p$ is a vector of parameters, and $f$ is the right-hand side function. The mass matrix $M$ is optional (assumed to be the identity matrix if not provided).

Installation

See instructions on the crates.io page.

Usage

For more documentation and examples, see the API documentation.

diffsol's People

Contributors

martinjrobins avatar siel avatar mhovd 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.