Skip to content

Commit 01976b1

Browse files
author
Sathvik Bhagavan
committed
test: update lv tutorial
1 parent 970f8dc commit 01976b1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/lotka_volterra.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ function lotka_ude()
1616
@variables t x(t)=3.1 y(t)=1.5
1717
@parameters α=1.3 [tunable = false] δ=1.8 [tunable = false]
1818
Dt = ModelingToolkit.D_nounits
19-
@named nn_in = RealInput(nin = 2)
20-
@named nn_out = RealOutput(nout = 2)
19+
@named nn_in = RealInputArray(nin = 2)
20+
@named nn_out = RealOutputArray(nout = 2)
2121

2222
eqs = [
2323
Dt(x) ~ α * x + nn_in.u[1],
@@ -50,7 +50,8 @@ eqs = [connect(model.nn_in, nn.output)
5050
connect(model.nn_out, nn.input)]
5151

5252
ude_sys = complete(ODESystem(
53-
eqs, ModelingToolkit.t_nounits, systems = [model, nn], name = :ude_sys))
53+
eqs, ModelingToolkit.t_nounits, systems = [model, nn],
54+
name = :ude_sys, defaults = [nn.input.u => [0.0, 0.0]]))
5455

5556
sys = structural_simplify(ude_sys)
5657

0 commit comments

Comments
 (0)