You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,13 @@
1
1
# ModelingToolkit.jl
2
2
3
-
4
3
[](https://julialang.zulipchat.com/#narrow/stream/279055-sciml-bridged)
[](https://github.com/SciML/ColPrac)
10
+
[](https://github.com/SciML/ColPrac)
Copy file name to clipboardExpand all lines: docs/src/basics/AbstractSystem.md
+34-33Lines changed: 34 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,65 +10,66 @@ model manipulation and compilation.
10
10
### Subtypes
11
11
12
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`)
13
+
14
+
-`AbstractTimeIndependentSystem`: has no independent variable (e.g.: `NonlinearSystem`)
15
+
-`AbstractTimeDependentSystem`: has a single independent variable (e.g.: `ODESystem`)
16
+
-`AbstractMultivariateSystem`: may have multiple independent variables (e.g.: `PDESystem`)
16
17
17
18
## Constructors and Naming
18
19
19
20
The `AbstractSystem` interface has a consistent method for constructing systems.
20
-
Generally it follows the order of:
21
+
Generally, it follows the order of:
21
22
22
-
1. Equations
23
-
2. Independent Variables
24
-
3. Dependent Variables (or States)
25
-
4. Parameters
23
+
1. Equations
24
+
2. Independent Variables
25
+
3. Dependent Variables (or States)
26
+
4. Parameters
26
27
27
28
All other pieces are handled via keyword arguments. `AbstractSystem`s share the
28
29
same keyword arguments, which are:
29
30
30
-
-`system`: This is used for specifying subsystems for hierarchical modeling with
31
-
reusable components. For more information, see the [components page](@ref components)
32
-
- Defaults: Keyword arguments like `defaults` are used for specifying default
33
-
values which are used. If a value is not given at the `SciMLProblem` construction
34
-
time, its numerical value will be the default.
31
+
-`system`: This is used for specifying subsystems for hierarchical modeling with
32
+
reusable components. For more information, see the [components page](@ref components).
33
+
- Defaults: Keyword arguments like `defaults` are used for specifying default
34
+
values which are used. If a value is not given at the `SciMLProblem` construction
35
+
time, its numerical value will be the default.
35
36
36
37
## Composition and Accessor Functions
37
38
38
39
Each `AbstractSystem` has lists of variables in context, such as distinguishing
39
-
parameters vs states. In addition, an `AbstractSystem`also can hold other
40
+
parameters vs states. In addition, an `AbstractSystem` can also hold other
40
41
`AbstractSystem` types. Direct accessing of the values, such as `sys.states`,
41
42
gives the immediate list, while the accessor functions `states(sys)` gives the
42
43
total set, which includes that of all systems held inside.
43
44
44
45
The values which are common to all `AbstractSystem`s are:
45
46
46
-
-`equations(sys)`: All equations that define the system and its subsystems.
47
-
-`states(sys)`: All the states in the system and its subsystems.
48
-
-`parameters(sys)`: All parameters of the system and its subsystems.
49
-
-`nameof(sys)`: The name of the current-level system.
50
-
-`get_eqs(sys)`: Equations that define the current-level system.
51
-
-`get_states(sys)`: States that are in the current-level system.
52
-
-`get_ps(sys)`: Parameters that are in the current-level system.
53
-
-`get_systems(sys)`: Subsystems of the current-level system.
47
+
-`equations(sys)`: All equations that define the system and its subsystems.
48
+
-`states(sys)`: All the states in the system and its subsystems.
49
+
-`parameters(sys)`: All parameters of the system and its subsystems.
50
+
-`nameof(sys)`: The name of the current-level system.
51
+
-`get_eqs(sys)`: Equations that define the current-level system.
52
+
-`get_states(sys)`: States that are in the current-level system.
53
+
-`get_ps(sys)`: Parameters that are in the current-level system.
54
+
-`get_systems(sys)`: Subsystems of the current-level system.
54
55
55
56
Optionally, a system could have:
56
57
57
-
-`observed(sys)`: All observed equations of the system and its subsystems.
58
-
-`get_observed(sys)`: Observed equations of the current-level system.
59
-
-`get_continuous_events(sys)`: `SymbolicContinuousCallback`s of the current-level system.
60
-
-`get_defaults(sys)`: A `Dict` that maps variables into their default values.
61
-
-`independent_variables(sys)`: The independent variables of a system.
62
-
-`get_noiseeqs(sys)`: Noise equations of the current-level system.
63
-
-`get_metadata(sys)`: Any metadata about the system or its origin to be used by downstream packages.
58
+
-`observed(sys)`: All observed equations of the system and its subsystems.
59
+
-`get_observed(sys)`: Observed equations of the current-level system.
60
+
-`get_continuous_events(sys)`: `SymbolicContinuousCallback`s of the current-level system.
61
+
-`get_defaults(sys)`: A `Dict` that maps variables into their default values.
62
+
-`independent_variables(sys)`: The independent variables of a system.
63
+
-`get_noiseeqs(sys)`: Noise equations of the current-level system.
64
+
-`get_metadata(sys)`: Any metadata about the system or its origin to be used by downstream packages.
64
65
65
-
Note that if you know a system is an `AbstractTimeDependentSystem` you could use `get_iv` to get the
66
+
Note that if you know a system is an `AbstractTimeDependentSystem` you could use `get_iv` to get the
66
67
unique independent variable directly, rather than using `independent_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.
67
68
68
69
A system could also have caches:
69
70
70
-
-`get_jac(sys)`: The Jacobian of a system.
71
-
-`get_tgrad(sys)`: The gradient with respect to time of a system.
71
+
-`get_jac(sys)`: The Jacobian of a system.
72
+
-`get_tgrad(sys)`: The gradient with respect to time of a system.
72
73
73
74
## Transformations
74
75
@@ -118,7 +119,7 @@ patterns via an abstract interpretation without requiring differentiation.
118
119
119
120
At the end, the system types have `DEProblem` constructors, like `ODEProblem`,
120
121
which allow for directly generating the problem types required for numerical
121
-
methods. The first argument is always the `AbstractSystem`, and the proceeding
122
+
methods. The first argument is always the `AbstractSystem`, and the proceding
122
123
arguments match the argument order of their original constructors. Whenever an
123
124
array would normally be provided, such as `u0` the initial condition of an
124
125
`ODEProblem`, it is instead replaced with a variable map, i.e., an array of
0 commit comments