Skip to content

Commit 854ef13

Browse files
refactor: remove all references to isdifferenceeq and DiscreteSystem
1 parent 838fcad commit 854ef13

File tree

7 files changed

+5
-53
lines changed

7 files changed

+5
-53
lines changed

docs/pages.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ pages = [
3232
"systems/JumpSystem.md",
3333
"systems/NonlinearSystem.md",
3434
"systems/OptimizationSystem.md",
35-
"systems/DiscreteSystem.md",
3635
"systems/PDESystem.md"],
3736
"comparison.md",
3837
"internals.md",

docs/src/systems/DiscreteSystem.md

Lines changed: 0 additions & 34 deletions
This file was deleted.

docs/src/systems/JumpSystem.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ structural_simplify
2424
## Problem Constructors
2525

2626
```@docs; canonical=false
27-
DiscreteProblem(sys::ModelingToolkit.DiscreteSystem, u0map, tspan)
27+
DiscreteProblem(sys::JumpSystem, u0map, tspan)
2828
```
2929

3030
```@docs

src/inputoutput.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ function generate_control_function(sys::AbstractODESystem, inputs = unbound_inpu
215215
end
216216
inputs = map(x -> time_varying_as_func(value(x), sys), inputs)
217217

218-
eqs = [eq for eq in full_equations(sys) if !isdifferenceeq(eq)]
218+
eqs = [eq for eq in full_equations(sys)]
219219
if disturbance_inputs !== nothing
220220
# Set all disturbance *inputs* to zero (we just want to keep the disturbance state)
221221
subs = Dict(disturbance_inputs .=> 0)

src/structural_transformation/codegen.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using LinearAlgebra
22

3-
using ModelingToolkit: isdifferenceeq, process_events, get_preprocess_constants
3+
using ModelingToolkit: process_events, get_preprocess_constants
44

55
const MAX_INLINE_NLSOLVE_SIZE = 8
66

src/systems/diffeqs/abstractodesystem.jl

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ function generate_function(sys::AbstractODESystem, dvs = unknowns(sys), ps = par
148148
if isdde
149149
eqs = delay_to_function(sys)
150150
else
151-
eqs = [eq for eq in equations(sys) if !isdifferenceeq(eq)]
151+
eqs = [eq for eq in equations(sys)]
152152
end
153153
if !implicit_dae
154154
check_operator_variables(eqs, Differential)
@@ -225,7 +225,7 @@ function delay_to_function(expr, iv, sts, ps, h)
225225
end
226226

227227
function calculate_massmatrix(sys::AbstractODESystem; simplify = false)
228-
eqs = [eq for eq in equations(sys) if !isdifferenceeq(eq)]
228+
eqs = [eq for eq in equations(sys)]
229229
dvs = unknowns(sys)
230230
M = zeros(length(eqs), length(eqs))
231231
unknown2idx = Dict(s => i for (i, s) in enumerate(dvs))
@@ -891,9 +891,6 @@ function DiffEqBase.ODEProblem{iip, specialize}(sys::AbstractODESystem, u0map =
891891
callback = nothing,
892892
check_length = true,
893893
kwargs...) where {iip, specialize}
894-
has_difference = any(isdifferenceeq, equations(sys))
895-
has_difference &&
896-
error("The operators Difference and DiscreteUpdate are deprecated. Use ShiftIndex instead.")
897894
f, u0, p = process_DEProblem(ODEFunction{iip, specialize}, sys, u0map, parammap;
898895
t = tspan !== nothing ? tspan[1] : tspan,
899896
check_length, kwargs...)
@@ -962,9 +959,6 @@ end
962959
function DiffEqBase.DAEProblem{iip}(sys::AbstractODESystem, du0map, u0map, tspan,
963960
parammap = DiffEqBase.NullParameters();
964961
check_length = true, kwargs...) where {iip}
965-
has_difference = any(isdifferenceeq, equations(sys))
966-
has_difference &&
967-
error("The operators Difference and DiscreteUpdate are deprecated. Use ShiftIndex instead.")
968962
f, du0, u0, p = process_DEProblem(DAEFunction{iip}, sys, u0map, parammap;
969963
implicit_dae = true, du0map = du0map, check_length,
970964
kwargs...)
@@ -990,9 +984,6 @@ function DiffEqBase.DDEProblem{iip}(sys::AbstractODESystem, u0map = [],
990984
callback = nothing,
991985
check_length = true,
992986
kwargs...) where {iip}
993-
has_difference = any(isdifferenceeq, equations(sys))
994-
has_difference &&
995-
error("The operators Difference and DiscreteUpdate are deprecated. Use ShiftIndex instead.")
996987
f, u0, p = process_DEProblem(DDEFunction{iip}, sys, u0map, parammap;
997988
t = tspan !== nothing ? tspan[1] : tspan,
998989
symbolic_u0 = true,
@@ -1051,9 +1042,6 @@ function DiffEqBase.SDDEProblem{iip}(sys::AbstractODESystem, u0map = [],
10511042
check_length = true,
10521043
sparsenoise = nothing,
10531044
kwargs...) where {iip}
1054-
has_difference = any(isdifferenceeq, equations(sys))
1055-
has_difference &&
1056-
error("The operators Difference and DiscreteUpdate are deprecated. Use ShiftIndex instead.")
10571045
f, u0, p = process_DEProblem(SDDEFunction{iip}, sys, u0map, parammap;
10581046
t = tspan !== nothing ? tspan[1] : tspan,
10591047
symbolic_u0 = true,

src/systems/systems.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ end
3636
function __structural_simplify(sys::AbstractSystem, io = nothing; simplify = false,
3737
kwargs...)
3838
sys = expand_connections(sys)
39-
sys isa DiscreteSystem && return sys
4039
state = TearingState(sys)
4140

4241
@unpack structure, fullvars = state

0 commit comments

Comments
 (0)