Skip to content

Commit 6a95699

Browse files
committed
Call deepcopy to avoid mutating the original system for safety
1 parent 5188268 commit 6a95699

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/deim.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ nonlinear expressions.
114114
function deim(sys::ODESystem, snapshot::AbstractMatrix, pod_dim::Integer;
115115
deim_dim::Integer = pod_dim, name::Symbol = Symbol(nameof(sys), :_deim),
116116
kwargs...)::ODESystem
117+
sys = deepcopy(sys)
117118
@set! sys.name = name
118119

119120
# handle ODESystem.substitutions

0 commit comments

Comments
 (0)