Skip to content

Commit

Permalink
test: test remake_buffer with array symbolics
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed May 22, 2024
1 parent 62a010f commit f5e96c6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/downstream/Project.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[deps]
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5"
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
11 changes: 11 additions & 0 deletions test/downstream/remake_arrayvars.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using ModelingToolkit
using ModelingToolkit: t_nounits as t
using SymbolicIndexingInterface

@variables x(t)[1:2] y(t)
@named sys = ODESystem(Equation[], t, [x, y], [])
sys = complete(sys)

u0 = [1.0, 2.0, 3.0]
newu0 = remake_buffer(sys, u0, Dict(x => [5.0, 6.0], y => 7.0))
@test newu0 == [5.0, 6.0, 7.0]

0 comments on commit f5e96c6

Please sign in to comment.