All Projects → soypat → godesim

soypat / godesim

Licence: BSD-3-Clause License
ODE system solver made simple. For IVPs (initial value problems).

Programming Languages

go
31211 projects - #10 most used programming language
matlab
3953 projects

Projects that are alternatives of or similar to godesim

heyoka.py
Python library for ODE integration via Taylor's method and LLVM
Stars: ✭ 45 (+136.84%)
Mutual labels:  ode, differential-equations, ode-solver
pydens
PyDEns is a framework for solving Ordinary and Partial Differential Equations (ODEs & PDEs) using neural networks
Stars: ✭ 201 (+957.89%)
Mutual labels:  ode, differential-equations, ode-solver
heyoka
C++ library for ODE integration via Taylor's method and LLVM
Stars: ✭ 151 (+694.74%)
Mutual labels:  ode, differential-equations, ode-solver
owl ode
Owl's Differential Equation Solvers
Stars: ✭ 24 (+26.32%)
Mutual labels:  ode, differential-equations, ode-solver
odex-js
Bulirsch-Stoer integration of systems of ordinary differential equations in JavaScript
Stars: ✭ 52 (+173.68%)
Mutual labels:  ode, differential-equations, ode-solver
FLINT
Fortran Library for numerical INTegration of differential equations
Stars: ✭ 37 (+94.74%)
Mutual labels:  ode, differential-equations, runge-kutta
CellMLToolkit.jl
CellMLToolkit.jl is a Julia library that connects CellML models to the Scientific Julia ecosystem.
Stars: ✭ 50 (+163.16%)
Mutual labels:  ode, differential-equations
Sundials.jl
Julia interface to Sundials, including a nonlinear solver (KINSOL), ODE's (CVODE and ARKODE), and DAE's (IDA) in a SciML scientific machine learning enabled manner
Stars: ✭ 167 (+778.95%)
Mutual labels:  ode, differential-equations
numerical-methods-python
Numerical methods implementation in Python.
Stars: ✭ 65 (+242.11%)
Mutual labels:  differential-equations, runge-kutta
DiffEqDevTools.jl
Benchmarking, testing, and development tools for differential equations and scientific machine learning (SciML)
Stars: ✭ 37 (+94.74%)
Mutual labels:  ode, differential-equations
DiffEqUncertainty.jl
Fast uncertainty quantification for scientific machine learning (SciML) and differential equations
Stars: ✭ 61 (+221.05%)
Mutual labels:  ode, differential-equations
DiffEqCallbacks.jl
A library of useful callbacks for hybrid scientific machine learning (SciML) with augmented differential equation solvers
Stars: ✭ 43 (+126.32%)
Mutual labels:  ode, differential-equations
SBMLToolkit.jl
SBML differential equation and chemical reaction model (Gillespie simulations) for Julia's SciML ModelingToolkit
Stars: ✭ 25 (+31.58%)
Mutual labels:  ode, differential-equations
diffeqr
Solving differential equations in R using DifferentialEquations.jl and the SciML Scientific Machine Learning ecosystem
Stars: ✭ 118 (+521.05%)
Mutual labels:  ode, differential-equations
dae-cpp
A simple but powerful C++ DAE (Differential Algebraic Equation) solver
Stars: ✭ 33 (+73.68%)
Mutual labels:  ode, differential-equations
DiffEqPhysics.jl
A library for building differential equations arising from physical problems for physics-informed and scientific machine learning (SciML)
Stars: ✭ 46 (+142.11%)
Mutual labels:  ode, differential-equations
DiffEqGPU.jl
GPU-acceleration routines for DifferentialEquations.jl and the broader SciML scientific machine learning ecosystem
Stars: ✭ 131 (+589.47%)
Mutual labels:  ode, differential-equations
SciMLBenchmarks.jl
Benchmarks for scientific machine learning (SciML) software and differential equation solvers
Stars: ✭ 195 (+926.32%)
Mutual labels:  ode, differential-equations
MultiScaleArrays.jl
A framework for developing multi-scale arrays for use in scientific machine learning (SciML) simulations
Stars: ✭ 63 (+231.58%)
Mutual labels:  ode, differential-equations
odepack
Work in Progress to refactor and modernize the ODEPACK Library
Stars: ✭ 30 (+57.89%)
Mutual labels:  ode, ode-solver

Go Report Card go.dev reference codecov Awesome

godesim

Simulate complex systems with a simple API.

Wrangle non-linear differential equations while writing maintainable, simple code.

Why Godesim?

ODE solvers seem to fill the niche of simple system solvers in your numerical packages such as scipy's odeint/solve_ivp.

Among these integrators there seems to be room for a solver that offers simulation interactivity such as modifying the differential equations during simulation based on events such as a rocket stage separation.

Installation

Requires Go.

go get github.com/soypat/godesim

Progress

Godesim is in early development and will naturally change as it is used more. The chart below shows some features that are planned or already part of godesim.

Status legend Planned Started Prototype Stable Mature
Legend symbol ✖️ 🏗️ 🐞️ 🚦️ ✅️
Features Status Notes
Non-linear solvers 🚦️ Suite of ODE solvers available.
Non-autonomous support 🚦️ U vector which need not a defined differential equation like X does.
Event driver 🚦️ Eventer interface implemented.
Stiff solver 🚦️ Newton-Raphson algorithm implemented and tested.
Algorithms available and benchmarks
Algorithm Time/Operation Memory/Op Allocations/Op
RK4 1575 ns/op 516 B/op 12 allocs/op
RK5 2351 ns/op 692 B/op 21 allocs/op
RKF45 3229 ns/op 780 B/op 25 allocs/op
Newton-Raphson 8616 ns/op 4292 B/op 92 allocs/op
Dormand-Prince 4365 ns/op 926 B/op 32 allocs/op

Examples

Quadratic Solution

// Declare your rate-of-change functions using state-space symbols
Dtheta := func(s state.State) float64 {
	return s.X("theta-dot")
}

DDtheta := func(s state.State) float64 {
    return 1
}
// Set the Simulation's differential equations and initial values and hit Begin!
sim := godesim.New() // Configurable with Simulation.SetConfig(godesim.Config{...})
sim.SetDiffFromMap(map[state.Symbol]state.Diff {
    "theta":  Dtheta,
    "theta-dot": DDtheta,
})
sim.SetX0FromMap(map[state.Symbol]float64{
    "theta":  0,
    "theta-dot": 0,
})
sim.SetTimespan(0.0, 1.0, 10) // One second simulated
sim.Begin()

The above code solves the following system:

for the domain t=0 to t=1.0 in 10 steps where theta and theta-dot are the X variables. The resulting curve is quadratic as the solution for this equation (for theta and theta-dot equal to zero) is

How to obtain results

// one can then obtain simulation results as float slices 
t := sim.Results("time")
theta := sim.Results("theta")

Other examples

To run an example, navigate to it's directory (under examples) then type go run . in console.

There are three simple examples which have been cooked up and left in _examples directory. I've been having problems running Pixel on my machine so the simulation animations are still under work.

Final notes

Future versions of gonum will have an ODE solver too. Ideally godesim would base it's algorithms on gonum's implementation. See https://github.com/gonum/exp ode package.

Contributing

Pull requests welcome!

This is my first library written for any programming language ever. I'll try to be fast on replying to pull-requests and issues.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].