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/solution.md
+14-13Lines changed: 14 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# [Solution Handling](@id solution)
2
2
3
+
The solution is an `RecursiveArrayTools.AbstractDiffEqArray`.
4
+
[See RecursiveArrayTools.jl for more information on the interface](https://docs.sciml.ai/RecursiveArrayTools/stable/).
5
+
The following is a more DiffEq-centric explanation of the interface.
6
+
3
7
## Accessing the Values
4
8
5
9
The solution type has a lot of built-in functionality to help analysis. For example,
@@ -14,11 +18,10 @@ derivative at each timestep `du` or the spatial discretization `x`, `y`, etc.
14
18
15
19
## Array Interface
16
20
17
-
Instead of working on the `Vector{uType}` directly, we can use the provided
18
-
array interface.
21
+
The general operations are as follows. Use
19
22
20
23
```julia
21
-
sol[j]
24
+
sol.u[j]
22
25
```
23
26
24
27
to access the value at timestep `j` (if the timeseries was saved), and
@@ -34,7 +37,8 @@ will address first by component and lastly by time, and thus
34
37
sol[i, j]
35
38
```
36
39
37
-
will be the `i`th component at timestep `j`. Hence, `sol[j][i] == sol[i, j]`. This is done because Julia is column-major, so the leading dimension should be contiguous in memory. If the independent variables had shape
40
+
will be the `i`th component at timestep `j`. Hence, `sol[j][i] == sol[i, j]`. This is done because Julia is column-major,
41
+
so the leading dimension should be contiguous in memory. If the independent variables had shape
38
42
(for example, was a matrix), then `i` is the linear index. We can also access
39
43
solutions with shape:
40
44
@@ -87,7 +91,12 @@ at a time `t` using the command
87
91
sol(t)
88
92
```
89
93
90
-
Note that the interpolating function allows for `t` to be a vector and uses this to speed up the interpolation calculations. The full API for the interpolations is
94
+
Note that the interpolating function allows for `t` to be a vector and uses this to speed up the interpolation calculations. If `t` is an `AbstractVector`, then
95
+
the returned object is a `RecursiveArrayTools.DiffEqArray`, [see RecursiveArrayTools.jl for more information](https://docs.sciml.ai/RecursiveArrayTools/stable/).
96
+
Note that the differential equation solution object itself is an `AbstractDiffEqArray`, and this means that the returned object will have the same indexing
97
+
behavior as a solution type itself, thus see the indexing description above.
0 commit comments