Skip to content

Commit ec2bca2

Browse files
committed
More tests
1 parent 7205307 commit ec2bca2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/odesystem.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ ps = @parameters p[1:3] = [1, 2, 3]
392392
D = Differential(t)
393393
eqs = [
394394
collect(D.(x) .~ x)
395-
D(y) ~ norm(x)*y - x[1]
395+
D(y) ~ norm(collect(x))*y - x[1]
396396
]
397397
@named sys = ODESystem(eqs, t, [sts...;], [ps...;])
398398
sys = structural_simplify(sys)
@@ -403,6 +403,10 @@ sys = structural_simplify(sys)
403403
@test all(x->x isa Symbolics.Arr, (sys.x, sys.p))
404404
@test all(x->x isa Symbolics.Arr, @nonamespace (sys.x, sys.p))
405405
@test ModelingToolkit.isvariable(Symbolics.unwrap(x[1]))
406+
prob = ODEProblem(sys, [], (0, 1.0))
407+
sol = solve(prob, Tsit5())
408+
@test sol[2x[1] + 3x[3] + norm(x)] 2sol[x[1]] + 3sol[x[3]] + vec(mapslices(norm, hcat(sol[x]...), dims=2))
409+
@test sol[x + [y, 2y, 3y]] sol[x] + [sol[y], 2sol[y], 3sol[y]]
406410

407411
# Mixed Difference Differential equations
408412
@parameters t a b c d

0 commit comments

Comments
 (0)