Skip to content

Commit 26eb892

Browse files
authored
Example of constructing DiffEqArray
1 parent 4d2b5b0 commit 26eb892

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ DiffEqArray(u::AbstractVector,t::AbstractVector)
5050
This is a `VectorOfArray` which stores `A.t` which matches `A.u`. This will plot
5151
`(A.t[i],A[i,:])`. The function `tuples(diffeq_arr)` returns tuples of `(t,u)`.
5252

53+
To construct a DiffEqArray
54+
```julia
55+
t = 0.0:0.1:10.0
56+
f(t) = t - 1
57+
f2(t) = t^2
58+
vals = [[f(tval) f2(tval)] for tval in t]
59+
A = DiffEqArray(vals, t)
60+
A[1,:] # all time periods for f(t)
61+
A.t
62+
```
63+
5364
#### ArrayPartition
5465

5566
```julia

0 commit comments

Comments
 (0)