We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e636b2 commit 5e279ceCopy full SHA for 5e279ce
test/odesystem.jl
@@ -1194,3 +1194,23 @@ end
1194
@test_nowarn obsfn(buffer, [1.0], ps..., 3.0)
1195
@test buffer ≈ [2.0, 3.0, 4.0]
1196
end
1197
+
1198
+# https://github.com/SciML/ModelingToolkit.jl/issues/2859
1199
+@testset "Initialization with defaults from observed equations (edge case)" begin
1200
+ @variables x(t) y(t) z(t)
1201
+ eqs = [D(x) ~ 0, y ~ x, D(z) ~ 0]
1202
+ defaults = [x => 1, z => y]
1203
+ @named sys = ODESystem(eqs, t; defaults)
1204
+ ssys = structural_simplify(sys)
1205
+ prob = ODEProblem(ssys, [], (0.0, 1.0), [])
1206
+ @test prob[x] == prob[y] == prob[z] == 1.0
1207
1208
+ @parameters y0
1209
1210
+ eqs = [D(x) ~ 0, y ~ y0 / x, D(z) ~ y]
1211
+ defaults = [y0 => 1, x => 1, z => y]
1212
1213
1214
1215
1216
+end
0 commit comments