@@ -74,12 +74,28 @@ eqs = [y ~ src.output.u
74
74
@named sys = ODESystem (eqs, t, vars, []; systems = [int, src])
75
75
s = complete (sys)
76
76
sys = structural_simplify (sys)
77
- prob = ODEProblem (sys, [], (0.0 , t_end), [s. src. data => x])
77
+ prob = ODEProblem (sys, [], (0.0 , t_end), [s. src. data => x]; tofloat = false )
78
78
@test prob. p isa Tuple{Vector{Float64}, Vector{Int}, Vector{Vector{Float64}}}
79
79
sol = solve (prob, ImplicitEuler ());
80
80
@test sol. retcode == ReturnCode. Success
81
81
@test sol[y][end ] == x[end ]
82
82
83
+ # TODO : remake becomes more complicated now, how to improve?
84
+ defs = ModelingToolkit. defaults (sys)
85
+ defs[s. src. data] = 2 x
86
+ p′ = ModelingToolkit. varmap_to_vars (defs, parameters (sys); tofloat= false )
87
+ p′, = ModelingToolkit. split_parameters_by_type (p′) # NOTE: we need to ensure this is called now before calling remake()
88
+ prob′ = remake (prob; p= p′)
89
+ sol = solve (prob′, ImplicitEuler ());
90
+ @test sol. retcode == ReturnCode. Success
91
+ @test sol[y][end ] == 2 x[end ]
92
+
93
+ prob′′ = remake (prob; p= [s. src. data => x])
94
+ @test prob′′. p isa Tuple
95
+
96
+
97
+
98
+
83
99
# ------------------------ Mixed Type Converted to float (default behavior)
84
100
85
101
vars = @variables y (t)= 1 dy (t)= 0 ddy (t)= 0
0 commit comments