@@ -139,7 +139,11 @@ struct SDESystem <: AbstractODESystem
139
139
"""
140
140
gui_metadata:: Union{Nothing, GUIMetadata}
141
141
"""
142
- If a model `sys` is complete, then `sys.x` no longer performs namespacing.
142
+ If false, then `sys.x` no longer performs namespacing.
143
+ """
144
+ namespacing:: Bool
145
+ """
146
+ If true, denotes the model will not be modified any further.
143
147
"""
144
148
complete:: Bool
145
149
"""
@@ -166,7 +170,7 @@ struct SDESystem <: AbstractODESystem
166
170
guesses, initializesystem, initialization_eqs, connector_type,
167
171
cevents, devents, parameter_dependencies, assertions = Dict{
168
172
BasicSymbolic, Nothing},
169
- metadata = nothing , gui_metadata = nothing ,
173
+ metadata = nothing , gui_metadata = nothing , namespacing = true ,
170
174
complete = false , index_cache = nothing , parent = nothing , is_scalar_noise = false ,
171
175
is_dde = false ,
172
176
isscheduled = false ;
@@ -184,6 +188,7 @@ struct SDESystem <: AbstractODESystem
184
188
if is_scalar_noise && neqs isa AbstractMatrix
185
189
throw (ArgumentError (" Noise equations ill-formed. Received a matrix of noise equations of size $(size (neqs)) , but `is_scalar_noise` was set to `true`. Scalar noise is only compatible with an `AbstractVector` of noise equations." ))
186
190
end
191
+ check_subsystems (systems)
187
192
end
188
193
if checks == true || (checks & CheckUnits) > 0
189
194
u = __get_unit_type (dvs, ps, iv)
@@ -192,8 +197,8 @@ struct SDESystem <: AbstractODESystem
192
197
new (tag, deqs, neqs, iv, dvs, ps, tspan, var_to_name, ctrls, observed, tgrad, jac,
193
198
ctrl_jac, Wfact, Wfact_t, name, description, systems,
194
199
defaults, guesses, initializesystem, initialization_eqs, connector_type, cevents,
195
- devents, parameter_dependencies, assertions, metadata, gui_metadata, complete ,
196
- index_cache, parent, is_scalar_noise, is_dde, isscheduled)
200
+ devents, parameter_dependencies, assertions, metadata, gui_metadata, namespacing ,
201
+ complete, index_cache, parent, is_scalar_noise, is_dde, isscheduled)
197
202
end
198
203
end
199
204
@@ -218,7 +223,6 @@ function SDESystem(deqs::AbstractVector{<:Equation}, neqs::AbstractArray, iv, dv
218
223
assertions = Dict {BasicSymbolic, String} (),
219
224
metadata = nothing ,
220
225
gui_metadata = nothing ,
221
- complete = false ,
222
226
index_cache = nothing ,
223
227
parent = nothing ,
224
228
is_scalar_noise = false ,
@@ -274,7 +278,7 @@ function SDESystem(deqs::AbstractVector{<:Equation}, neqs::AbstractArray, iv, dv
274
278
ctrl_jac, Wfact, Wfact_t, name, description, systems, defaults, guesses,
275
279
initializesystem, initialization_eqs, connector_type,
276
280
cont_callbacks, disc_callbacks, parameter_dependencies, assertions, metadata, gui_metadata,
277
- complete , index_cache, parent, is_scalar_noise, is_dde; checks = checks)
281
+ true , false , index_cache, parent, is_scalar_noise, is_dde; checks = checks)
278
282
end
279
283
280
284
function SDESystem (sys:: ODESystem , neqs; kwargs... )
@@ -321,9 +325,8 @@ function SDESystem(eqs::Vector{Equation}, noiseeqs::AbstractArray, iv; kwargs...
321
325
throw (ArgumentError (" Variable $dv in noise equations is not an unknown of the system." ))
322
326
end
323
327
algevars = setdiff (allunknowns, diffvars)
324
-
325
328
return SDESystem (eqs, noiseeqs, iv, Iterators. flatten ((diffvars, algevars)),
326
- [ps ; collect (noiseps)]; kwargs... )
329
+ [collect (ps) ; collect (noiseps)]; kwargs... )
327
330
end
328
331
329
332
function SDESystem (eq:: Equation , noiseeqs:: AbstractArray , args... ; kwargs... )
0 commit comments