Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flesh out next steps after getting started docs #3091

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/comparison.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Comparison of ModelingToolkit vs Equation-Based and Block Modeling Languages
# [Comparison of ModelingToolkit vs Equation-Based and Block Modeling Languages](@id comparison)

## Comparison Against Modelica

Expand Down
2 changes: 1 addition & 1 deletion docs/src/examples/higher_order.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Automatic Transformation of Nth Order ODEs to 1st Order ODEs
# [Automatic Transformation of Nth Order ODEs to 1st Order ODEs](@id higher_order)

ModelingToolkit has a system for transformations of mathematical
systems. These transformations allow for symbolically changing
Expand Down
2 changes: 1 addition & 1 deletion docs/src/examples/modelingtoolkitize_index_reduction.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Automated Index Reduction of DAEs
# [Automated Index Reduction of DAEs](@id higher_index)

In many cases one may accidentally write down a DAE that is not easily solvable
by numerical methods. In this tutorial, we will walk through an example of a
Expand Down
2 changes: 1 addition & 1 deletion docs/src/examples/remake.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Optimizing through an ODE solve and re-creating MTK Problems
# [Optimizing through an ODE solve and re-creating MTK Problems](@id remake)

Solving an ODE as part of an `OptimizationProblem`'s loss function is a common scenario.
In this example, we will go through an efficient way to model such scenarios using
Expand Down
2 changes: 1 addition & 1 deletion docs/src/examples/sparse_jacobians.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Automated Sparse Analytical Jacobians
# [Automated Sparse Analytical Jacobians](@id modelingtoolkitize_sparse)

In many cases where you have large stiff differential equations, getting a
sparse Jacobian can be essential for performance. In this tutorial, we will show
Expand Down
2 changes: 1 addition & 1 deletion docs/src/examples/tearing_parallelism.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Exposing More Parallelism By Tearing Algebraic Equations in ODESystems
# [Exposing More Parallelism By Tearing Algebraic Equations in ODESystems](@id tearing)

Sometimes it can be very non-trivial to parallelize a system. In this tutorial,
we will demonstrate how to make use of `structural_simplify` to expose more
Expand Down
2 changes: 1 addition & 1 deletion docs/src/internals.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Internal Details
# [Internal Details](@id internals)

This is a page for detailing some of the inner workings to help future
contributors to the library.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorials/SampledData.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Clocks and Sampled-Data Systems
# [Clocks and Sampled-Data Systems](@id hybrid)

A sampled-data system contains both continuous-time and discrete-time components, such as a continuous-time plant model and a discrete-time control system. ModelingToolkit supports the modeling and simulation of sampled-data systems by means of *clocks*.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorials/discrete_system.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (Experimental) Modeling Discrete Systems
# [(Experimental) Modeling Discrete Systems](@id discrete)

In this example, we will use the new [`DiscreteSystem`](@ref) API
to create an SIR model.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorials/initialization.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Initialization of ODESystems
# [Initialization of ODESystems](@id initialization)

While for simple numerical ODEs choosing an initial condition can be an easy
affair, with ModelingToolkit's more general differential-algebraic equation
Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorials/modelingtoolkitize.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Modelingtoolkitize: Automatically Translating Numerical to Symbolic Code
# [Modelingtoolkitize: Automatically Translating Numerical to Symbolic Code](@id modelingtoolkitize)

## What is `modelingtoolkitize`?

Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorials/nonlinear.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Modeling Nonlinear Systems
# [Modeling Nonlinear Systems](@id nonlinear)

ModelingToolkit.jl is not only useful for generating initial value problems (`ODEProblem`).
The package can also build nonlinear systems.
Expand Down
65 changes: 48 additions & 17 deletions docs/src/tutorials/ode_modeling.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,24 +366,55 @@ exploiting the structural information. For more information, see the

## Notes and pointers how to go on

Here are some notes that may be helpful during your initial steps with MTK:
Now you know how to do basic ODE modeling with MTK, what's next is up to you.

- The `@mtkmodel` macro is for high-level usage of MTK. However, in many cases you
may need to programmatically generate `ODESystem`s. If that's the case, check out
the [Programmatically Generating and Scripting ODESystems Tutorial](@ref programmatically).
- Vector-valued parameters and variables are possible. A cleaner, more
consistent treatment of these is still a work in progress, however. Once finished,
this introductory tutorial will also cover this feature.
If ODEs are not your speed, MTK can represent many other systems:

Where to go next?
- [Rootfinding for nonlinear systems of equations](@ref nonlinear)
- [Solving optimization problems](@ref optimization)
- [Stochastic Differential Equations](@ref SDE)
- Jump Systems
- [Discrete time systems](@ref discrete)
- [hybrid systems](@ref hybrid).

Numerical differential equation solvers require you to write your model in a very specific form.
However, these forms are often not the most human-readable.
MTK has symbolic transforms to translate your model into something your computer can simulate:

- [Automatically transform higher order ODEs to first order ones](@ref higher_order)
- [Automatically transform higher index DAEs to index one](@ref higher_index)

If you want some extra modeling goodies:

- [Validate your equations with units](@ref units)
- [Add discrete time controls to your continuous plant](@ref hybrid)
- [Add general discrete/continuous time events to your system](@ref events)

If the getting started tutorial is too high-level for you, do a deeper dive:

- [Learn everything there is to know about `@mtkmodel` blocks](@ref mtk_language)
- [Learn how to write your own components to use in `@mtkmodel`](@ref acausal)
- [Learn how to script the creation of `ODESystems` without the `@mtkmodel`](@ref programmatically)
- [Learn how to conserve certain quantities when connecting components using a domain](@ref domains)
- [Learn how MTK ensures that the initial state of your model is correct](@ref initialization)
- [Learn how MTK reduces the size of your model](@ref tearing)

If you liked the idea of the speedup symbolic Jacobians give you, but don't want to commit to writing your entire model in MTK:

- [modelingtoolkitize your `ODEProblem`](@ref modelingtoolkitize)
- [use modelingtoolkitize to calculate sparsity patterns](@ref modelingtoolkitize_sparse)

If you want to further investigate the properties of your ODE model:

- [Check if the parameters of your model are identifiable](@ref identifiability)
- [Check if your system exhibits any bifurcation](@ref bifurcation_diagrams)
- [Perform a perturbation analysis to see your system change as parameter values change](@ref perturb_diff)
- [Linearize your system](@ref linearization) and [turn it into an input-output system](@ref inputoutput) (useful for feedback control)
- [Use your MTK ODE model in an `OptimizationProblem`](@ref remake)

Still want to know more about MTK?
Comment on lines +373 to +415
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is too comprehensive and no longer is a simplified way into MTK. Things which are non-essential should be cut from this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, some of the more low level ones, like tearing, could be removed.
However, some of the higher level ones should then link to the tearing one to explain how MTK is able to simulate only 1 ODE even though you wrote down 100 equations.

Also, everything removed from this list is a prime target for being consolidated into another doc page.
The most obvious example is modelingtoolkitize, we don't need both a Rober and a Brusselator example, particularly not spread over two pages.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, all good points.


- Not sure how MTK relates to similar tools and packages? Read
[Comparison of ModelingToolkit vs Equation-Based and Block Modeling Languages](@ref).
- For a more detailed explanation of `@mtkmodel` checkout
[Defining components with `@mtkmodel` and connectors with `@connectors`](@ref mtk_language)
- Depending on what you want to do with MTK, have a look at some of the other
**Symbolic Modeling Tutorials**.
- If you want to automatically convert an existing function to a symbolic
representation, you might go through the **ModelingToolkitize Tutorials**.
- To learn more about the inner workings of MTK, consider the sections under
**Basics** and **System Types**.
[Comparison of ModelingToolkit vs Equation-Based and Block Modeling Languages](@ref comparison)
- Want to become a MTK dev? Read
[Internal Details](@ref internals)
2 changes: 1 addition & 1 deletion docs/src/tutorials/optimization.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Modeling Optimization Problems
# [Modeling Optimization Problems](@id optimization)

ModelingToolkit.jl is not only useful for generating initial value problems (`ODEProblem`).
The package can also build optimization systems.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorials/parameter_identifiability.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Parameter Identifiability in ODE Models
# [Parameter Identifiability in ODE Models](@id identifiability)

Ordinary differential equations are commonly used for modeling real-world processes. The problem of parameter identifiability is one of the key design challenges for mathematical models. A parameter is said to be _identifiable_ if one can recover its value from experimental data. _Structural_ identifiability is a theoretical property of a model that answers this question. In this tutorial, we will show how to use `StructuralIdentifiability.jl` with `ModelingToolkit.jl` to assess identifiability of parameters in ODE models. The theory behind `StructuralIdentifiability.jl` is presented in paper [^4].

Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorials/stochastic_diffeq.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Modeling with Stochasticity
# [Modeling with Stochasticity](@id SDE)

All models with `ODESystem` are deterministic. `SDESystem` adds another element
to the model: randomness. This is a
Expand Down
Loading