-
-
Notifications
You must be signed in to change notification settings - Fork 215
/
Copy pathindex.html
43 lines (37 loc) · 19.3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html><HTML lang="en"><head><meta charset="UTF-8"/><meta content="width=device-width, initial-scale=1.0" name="viewport"/><title>Comparison of ModelingToolkit vs Equation-Based Modeling Languages · ModelingToolkit.jl</title><link href="https://mtk.sciml.ai/stable/comparison/" rel="canonical"/><link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script data-main="../assets/documenter.js" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link href="../assets/favicon.ico" rel="icon" type="image/x-icon"/><link class="docs-theme-link" data-theme-name="documenter-dark" href="../assets/themes/documenter-dark.css" rel="stylesheet" type="text/css"/><link class="docs-theme-link" data-theme-name="documenter-light" data-theme-primary="" href="../assets/themes/documenter-light.css" rel="stylesheet" type="text/css"/><script src="../assets/themeswap.js"></script><script data-outdated-warner="">function maybeAddWarning () {
const head = document.getElementsByTagName('head')[0];
// Add a noindex meta tag (unless one exists) so that search engines don't index this version of the docs.
if (document.body.querySelector('meta[name="robots"]') === null) {
const meta = document.createElement('meta');
meta.name = 'robots';
meta.content = 'noindex';
head.appendChild(meta);
};
// Add a stylesheet to avoid inline styling
const style = document.createElement('style');
style.type = 'text/css';
style.appendChild(document.createTextNode('.outdated-warning-overlay { position: fixed; top: 0; left: 0; right: 0; box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); z-index: 999; background-color: #ffaba7; color: rgba(0, 0, 0, 0.7); border-bottom: 3px solid #da0b00; padding: 10px 35px; text-align: center; font-size: 15px; } .outdated-warning-overlay .outdated-warning-closer { position: absolute; top: calc(50% - 10px); right: 18px; cursor: pointer; width: 12px; } .outdated-warning-overlay a { color: #2e63b8; } .outdated-warning-overlay a:hover { color: #363636; }'));
head.appendChild(style);
const div = document.createElement('div');
div.classList.add('outdated-warning-overlay');
const closer = document.createElement('div');
closer.classList.add('outdated-warning-closer');
// Icon by font-awesome (license: https://fontawesome.com/license, link: https://fontawesome.com/icons/times?style=solid)
closer.innerHTML = '<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="times" class="svg-inline--fa fa-times fa-w-11" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 352 512"><path fill="currentColor" d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"></path></svg>';
closer.addEventListener('click', function () {
document.body.removeChild(div);
});
let href = '/stable';
if (window.documenterBaseURL) {
href = window.documenterBaseURL + '/../stable';
}
div.innerHTML = 'This is an old version of the documentation. <br> <a href="' + href + '">Go to the newest version</a>.';
div.appendChild(closer);
document.body.appendChild(div);
};
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', maybeAddWarning);
} else {
maybeAddWarning();
};
</script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img alt="ModelingToolkit.jl logo" src="../assets/logo.png"/></a><div class="docs-package-name"><span class="docs-autofit">ModelingToolkit.jl</span></div><form action="../search/" class="docs-search"><input class="docs-search-query" id="documenter-search-query" name="q" placeholder="Search docs" type="text"/></form><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><span class="tocitem">Symbolic Modeling Tutorials</span><ul><li><a class="tocitem" href="../tutorials/ode_modeling/">Composing Ordinary Differential Equations</a></li><li><a class="tocitem" href="../tutorials/acausal_components/">Acausal Component-Based Modeling the RC Circuit</a></li><li><a class="tocitem" href="../tutorials/higher_order/">Automatic Transformation of Nth Order ODEs to 1st Order ODEs</a></li><li><a class="tocitem" href="../tutorials/tearing_parallelism/">Exposing More Parallelism By Tearing Algebraic Equations in ODESystems</a></li><li><a class="tocitem" href="../tutorials/nonlinear/">Modeling Nonlinear Systems</a></li><li><a class="tocitem" href="../tutorials/optimization/">Modeling Optimization Problems</a></li><li><a class="tocitem" href="../tutorials/stochastic_diffeq/">Modeling with Stochasticity</a></li><li><a class="tocitem" href="../tutorials/nonlinear_optimal_control/">Nonlinear Optimal Control</a></li></ul></li><li><span class="tocitem">ModelingToolkitize Tutorials</span><ul><li><a class="tocitem" href="../mtkitize_tutorials/modelingtoolkitize/">Automatically Accelerating ODEProblem Code</a></li><li><a class="tocitem" href="../mtkitize_tutorials/modelingtoolkitize_index_reduction/">Automated Index Reduction of DAEs</a></li></ul></li><li><span class="tocitem">Basics</span><ul><li><a class="tocitem" href="../basics/AbstractSystem/">The AbstractSystem Interface</a></li><li><a class="tocitem" href="../basics/ContextualVariables/">Contextual Variable Types</a></li><li><a class="tocitem" href="../basics/Composition/">Composing Models and Building Reusable Components</a></li><li><a class="tocitem" href="../basics/Validation/">Model Validation and Units</a></li><li><a class="tocitem" href="../basics/DependencyGraphs/">Dependency Graphs</a></li><li><a class="tocitem" href="../basics/FAQ/">Frequently Asked Questions</a></li></ul></li><li><span class="tocitem">System Types</span><ul><li><a class="tocitem" href="../systems/ODESystem/">ODESystem</a></li><li><a class="tocitem" href="../systems/SDESystem/">SDESystem</a></li><li><a class="tocitem" href="../systems/JumpSystem/">JumpSystem</a></li><li><a class="tocitem" href="../systems/NonlinearSystem/">NonlinearSystem</a></li><li><a class="tocitem" href="../systems/OptimizationSystem/">OptimizationSystem</a></li><li><a class="tocitem" href="../systems/ControlSystem/">ControlSystem</a></li><li><a class="tocitem" href="../systems/ReactionSystem/">ReactionSystem</a></li><li><a class="tocitem" href="../systems/PDESystem/">PDESystem</a></li></ul></li><li class="is-active"><a class="tocitem" href="">Comparison of ModelingToolkit vs Equation-Based Modeling Languages</a><ul class="internal"><li><a class="tocitem" href="#Comparison-Against-Modelica-1"><span>Comparison Against Modelica</span></a></li><li><a class="tocitem" href="#Comparison-Against-Simulink-1"><span>Comparison Against Simulink</span></a></li><li><a class="tocitem" href="#Comparison-Against-CASADI-1"><span>Comparison Against CASADI</span></a></li><li><a class="tocitem" href="#Comparison-Against-Modia.jl-1"><span>Comparison Against Modia.jl</span></a></li><li><a class="tocitem" href="#Comparison-Against-Causal.jl-1"><span>Comparison Against Causal.jl</span></a></li></ul></li><li><a class="tocitem" href="../internals/">Internal Details</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href="">Comparison of ModelingToolkit vs Equation-Based Modeling Languages</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="">Comparison of ModelingToolkit vs Equation-Based Modeling Languages</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/SciML/ModelingToolkit.jl/blob/master/docs/src/comparison.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" href="#" id="documenter-settings-button" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" href="#" id="documenter-sidebar-button"></a></div></header><article class="content" id="documenter-page"><h1 id="Comparison-of-ModelingToolkit-vs-Equation-Based-Modeling-Languages-1"><a class="docs-heading-anchor" href="#Comparison-of-ModelingToolkit-vs-Equation-Based-Modeling-Languages-1">Comparison of ModelingToolkit vs Equation-Based Modeling Languages</a><a class="docs-heading-anchor-permalink" href="#Comparison-of-ModelingToolkit-vs-Equation-Based-Modeling-Languages-1" title="Permalink"></a></h1><h2 id="Comparison-Against-Modelica-1"><a class="docs-heading-anchor" href="#Comparison-Against-Modelica-1">Comparison Against Modelica</a><a class="docs-heading-anchor-permalink" href="#Comparison-Against-Modelica-1" title="Permalink"></a></h2><ul><li>Both Modelica and ModelingToolkit.jl are acausal modeling languages.</li><li>Modelica is a language with many different implementations, such as <a href="https://www.3ds.com/products-services/catia/products/dymola/">Dymola</a> and <a href="https://openmodelica.org/">OpenModelica</a>, which have differing levels of performance and can give different results on the same model. Many of the commonly used Modelica compilers are not open source. ModelingToolkit.jl is a language with a single canonical open source implementation.</li><li>All current Modelica compiler implementations are fixed and not extendable by the users from the Modelica language itself. For example, the Dymola compiler <a href="https://www.claytex.com/tech-blog/model-translation-and-symbolic-manipulation/">shares its symbolic processing pipeline</a> which is roughly equivalent to the <code>dae_index_lowering</code> and <code>structural_simplify</code> of ModelingToolkit.jl. ModelingToolkit.jl is an open and hackable transformation system which allows users to add new non-standard transformations and control the order of application.</li><li>Modelica is a declarative programming language. ModelingToolkit.jl is a declarative symbolic modeling language used from within the Julia programming language. Its programming language semantics, such as loop constructs and conditionals, can be used to more easily generate models.</li><li>Modelica is an object-oriented single dispatch language. ModelingToolkit.jl, built on Julia, uses multiple dispatch extensively to simplify code.</li><li>Many Modelica compilers supply a GUI. ModelingToolkit.jl does not.</li><li>Modelica can be used to simulate ODE and DAE systems. ModelingToolkit.jl has a much more expansive set of system types, including nonlinear systems, SDEs, PDEs, and more.</li></ul><h2 id="Comparison-Against-Simulink-1"><a class="docs-heading-anchor" href="#Comparison-Against-Simulink-1">Comparison Against Simulink</a><a class="docs-heading-anchor-permalink" href="#Comparison-Against-Simulink-1" title="Permalink"></a></h2><ul><li>Simulink is a causal modeling environment, whereas ModelingToolkit.jl is an acausal modeling environment. For an overview of the differences, consult academic reviews such as <a href="https://arxiv.org/abs/1909.00484">this one</a>. In this sense, ModelingToolkit.jl is more similar to the Simscape sub-environment.</li><li>Simulink is used from MATLAB while ModelingToolkit.jl is used from Julia. Thus any user defined functions have the performance of their host language. For information on the performance differences between Julia and MATLAB, consult <a href="https://julialang.org/benchmarks/">open benchmarks</a> which demonstrate Julia as an order of magnitude or more faster in many cases due to its JIT compilation.</li><li>Simulink uses the MATLAB differential equation solvers while ModelingToolkit.jl uses <a href="https://diffeq.sciml.ai/dev/">DifferentialEquations.jl</a>. For a systematic comparison between the solvers, consult <a href="https://benchmarks.sciml.ai/html/MultiLanguage/wrapper_packages.html">open benchmarks</a> which demonstrate two orders of magnitude performance advantage for the native Julia solvers across many benchmark problems.</li><li>Simulink comes with a Graphical User Interface (GUI), ModelingToolkit.jl does not.</li><li>Simulink is a proprietary software, meaning users cannot actively modify or extend the software. ModelingToolkit.jl is built in Julia and used in Julia, where users can actively extend and modify the software interactively in the REPL and contribute to its open source repositories.</li><li>Simulink covers ODE and DAE systems. ModelingToolkit.jl has a much more expansive set of system types, including SDEs, PDEs, optimization problems, and more.</li></ul><h2 id="Comparison-Against-CASADI-1"><a class="docs-heading-anchor" href="#Comparison-Against-CASADI-1">Comparison Against CASADI</a><a class="docs-heading-anchor-permalink" href="#Comparison-Against-CASADI-1" title="Permalink"></a></h2><ul><li>CASADI is written in C++ but used from Python/MATLAB, meaning that it cannot be directly extended by users unless they are using the C++ interface and run a local build of CASADI. ModelingToolkit.jl is both written and used from Julia, meaning that users can easily extend the library on the fly, even interactively in the REPL.</li><li>CASADI includes limited support for Computer Algebra System (CAS) functionality, while ModelingToolkit.jl is built on the full <a href="https://github.com/JuliaSymbolics/Symbolics.jl">Symbolics.jl</a> CAS.</li><li>CASADI supports DAE and ODE problems via SUNDIALS IDAS and CVODES. ModelingToolkit.jl supports DAE and ODE problems via <a href="https://diffeq.sciml.ai/dev/">DifferentialEquations.jl</a>, of which Sundials.jl is <1% of the total available solvers and is outperformed by the native Julia solvers on the vast majority of the benchmark equations. In addition, the DifferentialEquations.jl interface is confederated, meaning that any user can dynamically extend the system to add new solvers to the interface by defining new dispatches of solve.</li><li>CASADI's DAEBuilder does not implement efficiency transformations like tearing which are standard in the ModelingToolkit.jl transformation pipeline.</li><li>CASADI supports special functionality for quadratic programming problems while ModelingToolkit only provides nonlinear programming via <code>OptimizationSystem</code>.</li><li>ModelingToolkit.jl integrates with its host language Julia, so Julia code can be automatically converted into ModelingToolkit expressions. Users of CASADI must explicitly create CASADI expressions.</li></ul><h2 id="Comparison-Against-Modia.jl-1"><a class="docs-heading-anchor" href="#Comparison-Against-Modia.jl-1">Comparison Against Modia.jl</a><a class="docs-heading-anchor-permalink" href="#Comparison-Against-Modia.jl-1" title="Permalink"></a></h2><ul><li>Modia.jl is a Modelica-like system built in pure Julia. As such, its syntax is a domain-specific language (DSL) specified by macros to mirror the Modelica syntax.</li><li>Modia's compilation pipeline is similar to the <a href="https://www.claytex.com/tech-blog/model-translation-and-symbolic-manipulation/">Dymola symbolic processing pipeline</a> with some improvements. ModelingToolkit.jl has an open transformation pipeline that allows for users to extend and reorder transformation passes, where <code>structural_simplify</code> is an adaptation of the Modia.jl-improved alias elimination and tearing algorithms.</li><li>Modia supports DAE problems via SUNDIALS IDAS. ModelingToolkit.jl supports DAE and ODE problems via <a href="https://diffeq.sciml.ai/dev/">DifferentialEquations.jl</a>, of which Sundials.jl is <1% of the total available solvers and is outperformed by the native Julia solvers on the vast majority of the benchmark equations. In addition, the DifferentialEquations.jl interface is confederated, meaning that any user can dynamically extend the system to add new solvers to the interface by defining new dispatches of solve.</li><li>ModelingToolkit.jl integrates with its host language Julia, so Julia code can be automatically converted into ModelingToolkit expressions. Users of Modia must explicitly create Modia expressions within its macro.</li><li>Modia covers DAE systems. ModelingToolkit.jl has a much more expansive set of system types, including SDEs, PDEs, optimization problems, and more.</li></ul><h2 id="Comparison-Against-Causal.jl-1"><a class="docs-heading-anchor" href="#Comparison-Against-Causal.jl-1">Comparison Against Causal.jl</a><a class="docs-heading-anchor-permalink" href="#Comparison-Against-Causal.jl-1" title="Permalink"></a></h2><ul><li>Causal.jl is a causal modeling environment, whereas ModelingToolkit.jl is an acausal modeling environment. For an overview of the differences, consult academic reviews such as <a href="https://arxiv.org/abs/1909.00484">this one</a>.</li><li>Both ModelingToolkit.jl and Causal.jl use <a href="https://diffeq.sciml.ai/stable/">DifferentialEquations.jl</a> as the backend solver library.</li><li>Causal.jl lets one add arbitrary equation systems to a given node, and allow the output to effect the next node. This means an SDE may drive an ODE. These two portions are solved with different solver methods in tandem. In ModelingToolkit.jl, such connections promote the whole system to an SDE. This results in better accuracy and stability, though in some cases it can be less performant.</li><li>Causal.jl, similar to Simulink, breaks algebraic loops via inexact heuristics. ModelingToolkit.jl treats algebraic loops exactly through algebraic equations in the generated model.</li></ul></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../systems/PDESystem/">« PDESystem</a><a class="docs-footer-nextpage" href="../internals/">Internal Details »</a></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label></p><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div><p></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> on <span class="colophon-date" title="Friday 28 May 2021 22:23">Friday 28 May 2021</span>. Using Julia version 1.6.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></HTML>