All Projects → SciML → Modelingtoolkit.jl

SciML / Modelingtoolkit.jl

Licence: other
A modeling framework for automatically parallelized scientific machine learning (SciML) in Julia. A computer algebra system for integrated symbolics for physics-informed machine learning and automated transformations of differential equations

Programming Languages

julia
2034 projects

Projects that are alternatives of or similar to Modelingtoolkit.jl

Reduce.jl
Symbolic parser generator for Julia language expressions using REDUCE algebra term rewriter
Stars: ✭ 172 (-68.15%)
Mutual labels:  computer-algebra
symengine.rb
Ruby wrappers for SymEngine
Stars: ✭ 26 (-95.19%)
Mutual labels:  computer-algebra
Angourimath
Open-source symbolic algebra library for C# and F#. One of the most powerful in .NET
Stars: ✭ 266 (-50.74%)
Mutual labels:  computer-algebra
Symbolism
Computer Algebra and Symbolic Computation in C#
Stars: ✭ 191 (-64.63%)
Mutual labels:  computer-algebra
Oscar.jl
A comprehensive open source computer algebra system for computations in algebra, geometry, and number theory.
Stars: ✭ 182 (-66.3%)
Mutual labels:  computer-algebra
Bracmat
Programming language for symbolic computation with unusual combination of pattern matching features: Tree patterns, associative patterns and expressions embedded in patterns.
Stars: ✭ 42 (-92.22%)
Mutual labels:  computer-algebra
Numbas
A completely browser-based e-assessment/e-learning system, with an emphasis on mathematics
Stars: ✭ 144 (-73.33%)
Mutual labels:  computer-algebra
Kotlingrad
Shape-Safe Symbolic Differentiation with Algebraic Data Types
Stars: ✭ 388 (-28.15%)
Mutual labels:  computer-algebra
rascas
Computer Algebra System for Racket
Stars: ✭ 20 (-96.3%)
Mutual labels:  computer-algebra
Mathnet Symbolics
Math.NET Symbolics
Stars: ✭ 256 (-52.59%)
Mutual labels:  computer-algebra
Mppp
Multiprecision for modern C++
Stars: ✭ 196 (-63.7%)
Mutual labels:  computer-algebra
piranha
The Piranha computer algebra system.
Stars: ✭ 91 (-83.15%)
Mutual labels:  computer-algebra
obake
A C++20 library for the symbolic manipulation of sparse polynomials & co.
Stars: ✭ 16 (-97.04%)
Mutual labels:  computer-algebra
Symja android library
☕️ Symja - computer algebra language & symbolic math library. A collection of popular algorithms implemented in pure Java.
Stars: ✭ 170 (-68.52%)
Mutual labels:  computer-algebra
Grassmann.jl
⟨Leibniz-Grassmann-Clifford⟩ differential geometric algebra / multivector simplicial complex
Stars: ✭ 289 (-46.48%)
Mutual labels:  computer-algebra
Mathics
This repository is for archival. Please see https://github.com/Mathics3/mathics-core
Stars: ✭ 2,087 (+286.48%)
Mutual labels:  computer-algebra
Hecke.jl
Computational algebraic number theory
Stars: ✭ 142 (-73.7%)
Mutual labels:  computer-algebra
Gap
Main development repository for GAP - Groups, Algorithms, Programming, a System for Computational Discrete Algebra
Stars: ✭ 447 (-17.22%)
Mutual labels:  computer-algebra
Expreduce
An experimental computer algebra system written in Go
Stars: ✭ 318 (-41.11%)
Mutual labels:  computer-algebra
libsemigroups
C++ library for semigroups and monoids
Stars: ✭ 34 (-93.7%)
Mutual labels:  computer-algebra

ModelingToolkit.jl

Github Action CI Coverage Status Stable Dev ColPrac: Contributor's Guide on Collaborative Practices for Community Packages

ModelingToolkit.jl is a modeling framework for high-performance symbolic-numeric computation in scientific computing and scientific machine learning. It allows for users to give a high-level description of a model for symbolic preprocessing to analyze and enhance the model. ModelingToolkit can automatically generate fast functions for model components like Jacobians and Hessians, along with automatically sparsifying and parallelizing the computations. Automatic transformations, such as index reduction, can be applied to the model to make it easier for numerical solvers to handle.

For information on using the package, see the stable documentation. Use the in-development documentation for the version of the documentation which contains the unreleased features.

High-Level Examples

First, let's define a second order riff on the Lorenz equations, symbolically lower it to a first order system, symbolically generate the Jacobian function for the numerical integrator, and solve it.

using ModelingToolkit, OrdinaryDiffEq

@parameters t σ ρ β
@variables x(t) y(t) z(t)
D = Differential(t)

eqs = [D(D(x)) ~ σ*(y-x),
       D(y) ~ x*(ρ-z)-y,
       D(z) ~ x*y - β*z]

sys = ODESystem(eqs)
sys = ode_order_lowering(sys)

u0 = [D(x) => 2.0,
      x => 1.0,
      y => 0.0,
      z => 0.0]

p  = [σ => 28.0,
      ρ => 10.0,
      β => 8/3]

tspan = (0.0,100.0)
prob = ODEProblem(sys,u0,tspan,p,jac=true)
sol = solve(prob,Tsit5())
using Plots; plot(sol,vars=(x,y))

Lorenz2

This automatically will have generated fast Jacobian functions, making it more optimized than directly building a function. In addition, we can then use ModelingToolkit to compose multiple ODE subsystems. Now, let's define two interacting Lorenz equations and simulate the resulting Differential-Algebraic Equation (DAE):

using ModelingToolkit, OrdinaryDiffEq

@parameters t σ ρ β
@variables x(t) y(t) z(t)
D = Differential(t)

eqs = [D(x) ~ σ*(y-x),
       D(y) ~ x*(ρ-z)-y,
       D(z) ~ x*y - β*z]

lorenz1 = ODESystem(eqs,name=:lorenz1)
lorenz2 = ODESystem(eqs,name=:lorenz2)

@variables a
@parameters γ
connections = [0 ~ lorenz1.x + lorenz2.y + a*γ]
connected = ODESystem(connections,t,[a],[γ],systems=[lorenz1,lorenz2])

u0 = [lorenz1.x => 1.0,
      lorenz1.y => 0.0,
      lorenz1.z => 0.0,
      lorenz2.x => 0.0,
      lorenz2.y => 1.0,
      lorenz2.z => 0.0,
      a => 2.0]

p  = [lorenz1.σ => 10.0,
      lorenz1.ρ => 28.0,
      lorenz1.β => 8/3,
      lorenz2.σ => 10.0,
      lorenz2.ρ => 28.0,
      lorenz2.β => 8/3,
      γ => 2.0]

tspan = (0.0,100.0)
prob = ODEProblem(connected,u0,tspan,p)
sol = solve(prob,Rodas4())

using Plots; plot(sol,vars=(a,lorenz1.x,lorenz2.z))

Citation

If you use ModelingToolkit.jl in your research, please cite this paper:

@misc{ma2021modelingtoolkit,
      title={ModelingToolkit: A Composable Graph Transformation System For Equation-Based Modeling},
      author={Yingbo Ma and Shashi Gowda and Ranjan Anantharaman and Chris Laughman and Viral Shah and Chris Rackauckas},
      year={2021},
      eprint={2103.05244},
      archivePrefix={arXiv},
      primaryClass={cs.MS}
}
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].