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: docs/src/basics/AbstractSystem.md
+10-4Lines changed: 10 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,13 @@ It establishes a common set of functionality that is used between systems
7
7
from ODEs and chemical reactions, allowing users to have a common framework for
8
8
model manipulation and compilation.
9
9
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
+
10
17
## Constructors and Naming
11
18
12
19
The `AbstractSystem` interface has a consistent method for constructing systems.
@@ -50,12 +57,11 @@ Optionally, a system could have:
50
57
-`observed(sys)`: All observed equations of the system and its subsystems.
51
58
-`get_observed(sys)`: Observed equations of the current-level system.
52
59
-`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.
54
61
-`get_noiseeqs(sys)`: Noise equations of the current-level system.
55
62
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.
0 commit comments