Skip to content

Commit 75d87f1

Browse files
committed
format
1 parent ed947b7 commit 75d87f1

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

NEWS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
### Callbacks
44

55
Callback semantics have changed.
6-
- There is a new `Pre` operator that is used to specify which values are before the callback.
7-
For example, the affect `A ~ A + 1` should now be written as `A ~ Pre(A) + 1`. This is
6+
7+
- There is a new `Pre` operator that is used to specify which values are before the callback.
8+
For example, the affect `A ~ A + 1` should now be written as `A ~ Pre(A) + 1`. This is
89
**required** to be specified - `A ~ A + 1` will now be interpreted as an equation to be
910
satisfied after the callback (and will thus error since it is unsatisfiable).
1011

@@ -16,7 +17,6 @@ event = SymbolicDiscreteCallback(
1617
[t == 1] => [p ~ Pre(p) + 1], discrete_parameters = [p])
1718
```
1819

19-
2020
# ModelingToolkit v9 Release Notes
2121

2222
### Upgrade guide

src/systems/diffeqs/odesystem.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,10 @@ function ODESystem(deqs::AbstractVector{<:Equation}, iv, dvs, ps;
320320

321321
alg_eqs = filter(eq -> eq.lhs isa Union{Symbolic, Number} && !is_diff_equation(eq),
322322
deqs)
323-
cont_callbacks = to_cb_vector(continuous_events; CB_TYPE = SymbolicContinuousCallback, iv = iv, alg_eqs = alg_eqs, warn_no_algebraic = false)
324-
disc_callbacks = to_cb_vector(discrete_events; CB_TYPE = SymbolicDiscreteCallback, iv = iv, alg_eqs = alg_eqs, warn_no_algebraic = false)
323+
cont_callbacks = to_cb_vector(continuous_events; CB_TYPE = SymbolicContinuousCallback,
324+
iv = iv, alg_eqs = alg_eqs, warn_no_algebraic = false)
325+
disc_callbacks = to_cb_vector(discrete_events; CB_TYPE = SymbolicDiscreteCallback,
326+
iv = iv, alg_eqs = alg_eqs, warn_no_algebraic = false)
325327

326328
if is_dde === nothing
327329
is_dde = _check_if_dde(deqs, iv′, systems)

src/systems/diffeqs/sdesystem.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,10 @@ function SDESystem(deqs::AbstractVector{<:Equation}, neqs::AbstractArray, iv, dv
272272

273273
alg_eqs = filter(eq -> eq.lhs isa Union{Symbolic, Number} && !is_diff_equation(eq),
274274
deqs)
275-
cont_callbacks = to_cb_vector(continuous_events; CB_TYPE = SymbolicContinuousCallback, iv = iv, alg_eqs = alg_eqs, warn_no_algebraic = false)
276-
disc_callbacks = to_cb_vector(discrete_events; CB_TYPE = SymbolicDiscreteCallback, iv = iv, alg_eqs = alg_eqs, warn_no_algebraic = false)
275+
cont_callbacks = to_cb_vector(continuous_events; CB_TYPE = SymbolicContinuousCallback,
276+
iv = iv, alg_eqs = alg_eqs, warn_no_algebraic = false)
277+
disc_callbacks = to_cb_vector(discrete_events; CB_TYPE = SymbolicDiscreteCallback,
278+
iv = iv, alg_eqs = alg_eqs, warn_no_algebraic = false)
277279

278280
if is_dde === nothing
279281
is_dde = _check_if_dde(deqs, iv′, systems)

src/systems/jumps/jumpsystem.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,10 @@ function JumpSystem(eqs, iv, unknowns, ps;
212212
end
213213
end
214214

215-
cont_callbacks = to_cb_vector(continuous_events; CB_TYPE = SymbolicContinuousCallback, iv = iv, warn_no_algebraic = false)
216-
disc_callbacks = to_cb_vector(discrete_events; CB_TYPE = SymbolicDiscreteCallback, iv = iv, warn_no_algebraic = false)
215+
cont_callbacks = to_cb_vector(continuous_events; CB_TYPE = SymbolicContinuousCallback,
216+
iv = iv, warn_no_algebraic = false)
217+
disc_callbacks = to_cb_vector(discrete_events; CB_TYPE = SymbolicDiscreteCallback,
218+
iv = iv, warn_no_algebraic = false)
217219

218220
JumpSystem{typeof(ap)}(Threads.atomic_add!(SYSTEM_COUNT, UInt(1)),
219221
ap, iv′, us′, ps′, var_to_name, observed, name, description, systems,

0 commit comments

Comments
 (0)