https://github.com/avinashresearch1/modelingtoolkit.jl

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

https://github.com/avinashresearch1/modelingtoolkit.jl

Science Score: 28.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.7%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

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

Basic Info
  • Host: GitHub
  • Owner: avinashresearch1
  • License: other
  • Language: Julia
  • Default Branch: master
  • Homepage: https://mtk.sciml.ai/dev/
  • Size: 47.6 MB
Statistics
  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • Open Issues: 3
  • Releases: 0
Fork of SciML/ModelingToolkit.jl
Created almost 4 years ago · Last pushed almost 2 years ago
Metadata Files
Readme Contributing License Citation

README.md

ModelingToolkit.jl

Join the chat at https://julialang.zulipchat.com #sciml-bridged Global Docs

codecov Coverage Status Build Status

ColPrac: Contributor's Guide on Collaborative Practices for Community Packages SciML Code Style

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.

Standard Library

For a standard library of ModelingToolkit components and blocks, check out the ModelingToolkitStandardLibrary

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.

```julia using OrdinaryDiffEqDefault, ModelingToolkit using ModelingToolkit: tnounits as t, Dnounits as D

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

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

@mtkbuild sys = ODESystem(eqs, t)

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) using Plots plot(sol, idxs = (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):

```julia using DifferentialEquations, ModelingToolkit using ModelingToolkit: tnounits as t, Dnounits as D

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

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

@named lorenz1 = ODESystem(eqs, t) @named lorenz2 = ODESystem(eqs, t)

@variables a(t) @parameters γ connections = [0 ~ lorenz1.x + lorenz2.y + a * γ] @mtkbuild connected = ODESystem(connections, t, 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)

using Plots plot(sol, idxs = (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} }

Owner

  • Name: Avinash Subramanian
  • Login: avinashresearch1
  • Kind: user
  • Location: Trondheim, Norway
  • Company: JuliaHub

Simulation & Control at JuliaHub

Citation (CITATION.bib)

@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}
}

@article{DifferentialEquations.jl-2017,
 author = {Rackauckas, Christopher and Nie, Qing},
 doi = {10.5334/jors.151},
 journal = {The Journal of Open Research Software},
 keywords = {Applied Mathematics},
 note = {Exported from https://app.dimensions.ai on 2019/05/05},
 number = {1},
 pages = {},
 title = {DifferentialEquations.jl – A Performant and Feature-Rich Ecosystem for Solving Differential Equations in Julia},
 url = {https://app.dimensions.ai/details/publication/pub.1085583166 and http://openresearchsoftware.metajnl.com/articles/10.5334/jors.151/galley/245/download/},
 volume = {5},
 year = {2017}
}

GitHub Events

Total
  • Pull request event: 8
  • Create event: 11
Last Year
  • Pull request event: 8
  • Create event: 11