Skip to content

Commit 397298f

Browse files
committed
working on structural simplification
1 parent afc4689 commit 397298f

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

src/ModelingToolkit.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ abstract type AbstractTimeIndependentSystem <: AbstractSystem end
123123
abstract type AbstractODESystem <: AbstractTimeDependentSystem end
124124
abstract type AbstractMultivariateSystem <: AbstractSystem end
125125
abstract type AbstractOptimizationSystem <: AbstractTimeIndependentSystem end
126+
abstract type AbstractDiscreteSystem <: AbstractTimeDependentSystem end
126127

127128
function independent_variable end
128129

src/systems/discrete_system/discrete_system.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ eqs = [x(k+1) ~ σ*(y-x),
1717
@named de = DiscreteSystem(eqs)
1818
```
1919
"""
20-
struct DiscreteSystem <: AbstractTimeDependentSystem
20+
struct DiscreteSystem <: AbstractDiscreteSystem
2121
"""
2222
A tag for the system. If two systems have the same tag, then they are
2323
structurally identical.

src/systems/discrete_system/implicit_discrete_system.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ using ModelingToolkit: t_nounits as t
1010
@parameters σ=28.0 ρ=10.0 β=8/3 δt=0.1
1111
@variables x(t)=1.0 y(t)=0.0 z(t)=0.0
1212
k = ShiftIndex(t)
13-
eqs = [x ~ σ*(y(k-1)-x),
14-
y ~ x*(ρ-z(k-1))-y,
15-
z ~ x(k-1)*y - β*z]
13+
eqs = [x ~ σ*(y-x),
14+
y ~ x*(ρ-z)-y,
15+
z ~ x*y - β*z]
1616
@named ide = ImplicitDiscreteSystem(eqs,t,[x,y,z],[σ,ρ,β]; tspan = (0, 1000.0))
1717
```
1818
"""
19-
struct ImplicitDiscreteSystem <: AbstractTimeDependentSystem
19+
struct ImplicitDiscreteSystem <: AbstractDiscreteSystem
2020
"""
2121
A tag for the system. If two systems have the same tag, then they are
2222
structurally identical.

src/systems/systemstructure.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,9 @@ function TearingState(sys; quick_cancel = false, check = true)
430430

431431
ts = TearingState(sys, fullvars,
432432
SystemStructure(complete(var_to_diff), complete(eq_to_diff),
433-
complete(graph), nothing, var_types, sys isa DiscreteSystem),
433+
complete(graph), nothing, var_types, sys isa AbstractDiscreteSystem),
434434
Any[])
435-
if sys isa DiscreteSystem || sys isa ImplicitDiscreteSystem
435+
if sys isa AbstractDiscreteSystem
436436
ts = shift_discrete_system(ts)
437437
end
438438
return ts

0 commit comments

Comments
 (0)