Skip to content

Commit a98397c

Browse files
committed
remove Next and Prev
1 parent 2d4bf5d commit a98397c

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

src/discretedomain.jl

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,6 @@ Base.literal_pow(f::typeof(^), D::Shift, ::Val{n}) where {n} = Shift(D.t, D.step
7070

7171
hasshift(eq::Equation) = hasshift(eq.lhs) || hasshift(eq.rhs)
7272

73-
"""
74-
Next(x)
75-
76-
An alias for Shift(t, 1)(x).
77-
"""
78-
Next(x) = Shift(t, 1)(x)
79-
"""
80-
Prev(x)
81-
82-
An alias for Shift(t, -1)(x).
83-
"""
84-
Prev(x) = Shift(t, -1)(x)
85-
8673
"""
8774
hasshift(O)
8875

src/systems/discrete_system/implicit_discrete_system.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,17 +268,17 @@ function generate_function(
268268
iv = get_iv(sys)
269269
# Algebraic equations get shifted forward 1, to match with differential equations
270270
exprs = map(equations(sys)) do eq
271-
_iszero(eq.lhs) ? distribute_shift(Next(eq.rhs)) : (eq.rhs - eq.lhs)
271+
_iszero(eq.lhs) ? distribute_shift(Shift(iv, 1)(eq.rhs)) : (eq.rhs - eq.lhs)
272272
end
273273

274274
# Handle observables in algebraic equations, since they are shifted
275275
obs = observed(sys)
276-
shifted_obs = Symbolics.Equation[distribute_shift(Next(eq)) for eq in obs]
276+
shifted_obs = Symbolics.Equation[distribute_shift(Shift(iv, 1)(eq)) for eq in obs]
277277
obsidxs = observed_equations_used_by(sys, exprs; obs = shifted_obs)
278278
extra_assignments = [Assignment(shifted_obs[i].lhs, shifted_obs[i].rhs)
279279
for i in obsidxs]
280280

281-
u_next = map(Next, dvs)
281+
u_next = map(Shift(iv, 1), dvs)
282282
u = dvs
283283
build_function_wrapper(
284284
sys, exprs, u_next, u, ps..., iv; p_start = 3, extra_assignments, kwargs...)

0 commit comments

Comments
 (0)