Skip to content

Commit b75336e

Browse files
committed
fix the tests and docstring
1 parent 1d74f6f commit b75336e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/core/trajectory.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ to the last valid point.
2222
* `save_idxs::AbstractVector`: Which variables to output in `X`. It can be
2323
any type of index that can be given to [`observe_state`](@ref).
2424
Defaults to `1:dimension(ds)` (all dynamic variables).
25+
Note: if you mix integer and symbolic indexing be sure to initialize the array
26+
as `Any` so that integers `1, 2, ...` are not converted to symbolic expressions.
2527
"""
2628
function trajectory(ds::DynamicalSystem, T, u0 = initial_state(ds);
2729
save_idxs = nothing, t0 = initial_time(ds), kwargs...

test/mtk_integration.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ sys = structural_simplify(sys; split = false)
182182
prob = ODEProblem(sys)
183183
ds = CoupledODEs(prob)
184184

185-
X, tvec = trajectory(ds, 10.0; Δt = 0.1, save_idxs = [1, 2, η1])
185+
X, tvec = trajectory(ds, 10.0; Δt = 0.1, save_idxs = Any[1, 2, η1])
186186

187-
@test all(diff(X[:, 1]) .> 0.001)
187+
@test all(abs.(diff(X[:, 1])) .> 1e-8)
188188
@test all(diff(X[:, 3]) .≈ 0.001)
189189

0 commit comments

Comments
 (0)