Skip to content

Commit f9e447d

Browse files
Fix DEIM system construction by completing system before return
Co-authored-by: Aayush Sabharwal <aayush.sabharwal@gmail.com>
1 parent 97aa0bc commit f9e447d

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/deim.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,11 @@ function deim(sys::ODESystem, snapshot::AbstractMatrix, pod_dim::Integer;
172172

173173
inv_dict = Dict(Symbolics.scalarize(ŷ .=> V' * dvs)) # reduced vars to original vars
174174
@set! sys.defaults = merge(ModelingToolkit.defaults(sys), inv_dict)
175+
176+
# CRITICAL: Call complete() on the system before returning to ensure all subsystems,
177+
# variables, and parameters are properly registered and namespaced. Without this,
178+
# attempting to create an ODEProblem from the DEIM system will fail with errors about
179+
# missing initial conditions for variables that should exist in the system.
180+
# This is required due to changes in ModelingToolkit.jl's internal structure handling.
181+
return complete(sys)
175182
end

0 commit comments

Comments
 (0)