@@ -2,10 +2,9 @@ using Test
22using JET
33using ModelingToolkitNeuralNets
44using ModelingToolkit
5- using ModelingToolkitStandardLibrary. Blocks
65using OrdinaryDiffEqVerner
76using SymbolicIndexingInterface
8- using Optimization
7+ using OptimizationBase
98using OptimizationOptimisers: Adam
109using SciMLStructures
1110using SciMLStructures: Tunable, canonicalize
@@ -19,7 +18,7 @@ using Lux
1918
2019function lotka_ude (chain)
2120 @variables t x (t)= 3.1 y (t)= 1.5
22- @parameters α= 1.3 [tunable= false ] δ= 1.8 [tunable= false ]
21+ @parameters α= 1.3 [tunable = false ] δ= 1.8 [tunable = false ]
2322 Dt = ModelingToolkit. D_nounits
2423
2524 @named nn = NeuralNetworkBlock (2 , 2 ; chain, rng = StableRNG (42 ))
3635
3736function lotka_true ()
3837 @variables t x (t)= 3.1 y (t)= 1.5
39- @parameters α= 1.3 [tunable= false ] β= 0.9 γ= 0.8 δ= 1.8 [tunable= false ]
38+ @parameters α= 1.3 [tunable = false ] β= 0.9 γ= 0.8 δ= 1.8 [tunable = false ]
4039 Dt = ModelingToolkit. D_nounits
4140
4241 eqs = [
@@ -133,7 +132,7 @@ res_sol = solve(res_prob, Vern9(), abstol = 1e-8, reltol = 1e-8, saveat = ts)
133132
134133function lotka_ude2 ()
135134 @variables t x (t)= 3.1 y (t)= 1.5 pred (t)[1 : 2 ]
136- @parameters α= 1.3 [tunable= false ] δ= 1.8 [tunable= false ]
135+ @parameters α= 1.3 [tunable = false ] δ= 1.8 [tunable = false ]
137136 chain = multi_layer_feed_forward (2 , 2 ; width = 5 , initial_scaling_factor = 1 )
138137 NN, p = SymbolicNeuralNetwork (; chain, n_input = 2 , n_output = 2 , rng = StableRNG (42 ))
139138 Dt = ModelingToolkit. D_nounits
0 commit comments