Skip to content

Commit 0c3066d

Browse files
author
Lucas Morton
committed
Merge branch 'master' into uniting, with fixed conflicts.
# Conflicts: # src/ModelingToolkit.jl # src/systems/diffeqs/odesystem.jl # src/systems/pde/pdesystem.jl # src/systems/reaction/reactionsystem.jl
2 parents 3b334ae + c3b902d commit 0c3066d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+620
-879
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ModelingToolkit"
22
uuid = "961ee093-0014-501f-94e3-6117800e7a78"
33
authors = ["Chris Rackauckas <[email protected]>"]
4-
version = "5.26.0"
4+
version = "6.2.2"
55

66
[deps]
77
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
@@ -73,7 +73,7 @@ Setfield = "0.7"
7373
SpecialFunctions = "0.7, 0.8, 0.9, 0.10, 1.0"
7474
StaticArrays = "0.10, 0.11, 0.12, 1.0"
7575
SymbolicUtils = "0.12, 0.13"
76-
Symbolics = "1.4.1"
76+
Symbolics = "3.0"
7777
UnPack = "0.1, 1.0"
7878
Unitful = "1.1"
7979
julia = "1.2"

docs/make.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ makedocs(
4040
"systems/NonlinearSystem.md",
4141
"systems/OptimizationSystem.md",
4242
"systems/ControlSystem.md",
43-
"systems/ReactionSystem.md",
4443
"systems/PDESystem.md",
4544
],
4645
"comparison.md",

docs/src/basics/AbstractSystem.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@
44

55
The `AbstractSystem` interface is the core of the system level of ModelingToolkit.jl.
66
It establishes a common set of functionality that is used between systems
7-
from ODEs and chemical reactions, allowing users to have a common framework for
7+
representing ODEs, PDEs, SDEs and more, allowing users to have a common framework for
88
model manipulation and compilation.
99

10+
### Subtypes
11+
12+
There are three immediate subtypes of `AbstractSystem`, classified by how many independent variables each type has:
13+
* `AbstractTimeIndependentSystem`: has no independent variable (eg: `NonlinearSystem`)
14+
* `AbstractTimeDependentSystem`: has a single independent variable (eg: `ODESystem`)
15+
* `AbstractMultivariateSystem`: may have multiple independent variables (eg: `PDESystem`)
16+
1017
## Constructors and Naming
1118

1219
The `AbstractSystem` interface has a consistent method for constructing systems.
@@ -50,12 +57,11 @@ Optionally, a system could have:
5057
- `observed(sys)`: All observed equations of the system and its subsystems.
5158
- `get_observed(sys)`: Observed equations of the current-level system.
5259
- `get_defaults(sys)`: A `Dict` that maps variables into their default values.
53-
- `independent_variable(sys)`: The independent variable of a system.
60+
- `independent_variables(sys)`: The independent variables of a system.
5461
- `get_noiseeqs(sys)`: Noise equations of the current-level system.
5562

56-
Note that there's `get_iv(sys)`, but it is not advised to use, since it errors
57-
when the system has no field `iv`. `independent_variable(sys)` returns `nothing`
58-
for `NonlinearSystem`s.
63+
Note that if you know a system is an `AbstractTimeDependentSystem` you could use `get_iv` to get the
64+
unique independent variable directly, rather than using `independenent_variables(sys)[1]`, which is clunky and may cause problems if `sys` is an `AbstractMultivariateSystem` because there may be more than one independent variable. `AbstractTimeIndependentSystem`s do not have a method `get_iv`, and `independent_variables(sys)` will return a size-zero result for such. For an `AbstractMultivariateSystem`, `get_ivs` is equivalent.
5965

6066
A system could also have caches:
6167

docs/src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ is built on, consult the
7272
- Nonlinear systems
7373
- Optimization problems
7474
- Continuous-Time Markov Chains
75-
- Chemical Reactions
75+
- Chemical Reactions (via [Catalyst.jl](https://github.com/SciML/Catalyst.jl))
7676
- Nonlinear Optimal Control
7777

7878
## Model Import Formats

docs/src/systems/JumpSystem.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ JumpSystem
1111
- `get_eqs(sys)` or `equations(sys)`: The equations that define the jump system.
1212
- `get_states(sys)` or `states(sys)`: The set of states in the jump system.
1313
- `get_ps(sys)` or `parameters(sys)`: The parameters of the jump system.
14-
- `independent_variable(sys)`: The independent variable of the jump system.
14+
- `get_iv(sys)`: The independent variable of the jump system.
1515

1616
## Transformations
1717

docs/src/systems/ODESystem.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ODESystem
1111
- `get_eqs(sys)` or `equations(sys)`: The equations that define the ODE.
1212
- `get_states(sys)` or `states(sys)`: The set of states in the ODE.
1313
- `get_ps(sys)` or `parameters(sys)`: The parameters of the ODE.
14-
- `independent_variable(sys)`: The independent variable of the ODE.
14+
- `get_iv(sys)`: The independent variable of the ODE.
1515

1616
## Transformations
1717

docs/src/systems/ReactionSystem.md

Lines changed: 0 additions & 69 deletions
This file was deleted.

docs/src/systems/SDESystem.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ sde = SDESystem(ode, noiseeqs)
1717
- `get_eqs(sys)` or `equations(sys)`: The equations that define the SDE.
1818
- `get_states(sys)` or `states(sys)`: The set of states in the SDE.
1919
- `get_ps(sys)` or `parameters(sys)`: The parameters of the SDE.
20-
- `independent_variable(sys)`: The independent variable of the SDE.
20+
- `get_iv(sys)`: The independent variable of the SDE.
2121

2222
## Transformations
2323

docs/src/tutorials/acausal_components.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ equalities before solving. Let's see this in action.
1414
```julia
1515
using ModelingToolkit, Plots, DifferentialEquations
1616

17-
@parameters t
17+
@variables t
1818
@connector function Pin(;name)
1919
sts = @variables v(t)=1.0 i(t)=1.0
2020
ODESystem(Equation[], t, sts, []; name=name)
@@ -95,7 +95,8 @@ rc_eqs = [
9595
connect(capacitor.n, source.n, ground.g)
9696
]
9797

98-
@named rc_model = compose(ODESystem(rc_eqs, t),
98+
@named _rc_model = ODESystem(rc_eqs, t)
99+
@named rc_model = compose(_rc_model,
99100
[resistor, capacitor, source, ground])
100101
sys = structural_simplify(rc_model)
101102
u0 = [
@@ -288,7 +289,8 @@ rc_eqs = [
288289
Finally we build our four component model with these connection rules:
289290

290291
```julia
291-
@named rc_model = compose(ODESystem(rc_eqs, t)
292+
@named _rc_model = ODESystem(rc_eqs, t)
293+
@named rc_model = compose(_rc_model,
292294
[resistor, capacitor, source, ground])
293295
```
294296

docs/src/tutorials/higher_order.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ We utilize the derivative operator twice here to define the second order:
1313
```julia
1414
using ModelingToolkit, OrdinaryDiffEq
1515

16-
@parameters t σ ρ β
17-
@variables x(t) y(t) z(t)
16+
@parameters σ ρ β
17+
@variables t x(t) y(t) z(t)
1818
D = Differential(t)
1919

2020
eqs = [D(D(x)) ~ σ*(y-x),
2121
D(y) ~ x*-z)-y,
2222
D(z) ~ x*y - β*z]
2323

24-
sys = ODESystem(eqs)
24+
@named sys = ODESystem(eqs)
2525
```
2626

2727
Note that we could've used an alternative syntax for 2nd order, i.e.

0 commit comments

Comments
 (0)