Skip to content

Commit a267e2d

Browse files
committed
Update checks and docs
1 parent b82421d commit a267e2d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/src/mtkitize_tutorials/modelingtoolkitize_index_reduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ p = [9.8, 1]
2929
tspan = (0, 10.0)
3030
pendulum_prob = ODEProblem(pendulum_fun!, u0, tspan, p)
3131
traced_sys = modelingtoolkitize(pendulum_prob)
32-
pendulum_sys = structural_simplify(traced_sys)
33-
prob = ODAEProblem(pendulum_sys, Pair[], tspan)
32+
pendulum_sys = structural_simplify(dae_index_lowering(traced_sys))
33+
prob = ODAEProblem(pendulum_sys, [], tspan)
3434
sol = solve(prob, Tsit5(),abstol=1e-8,reltol=1e-8)
3535
plot(sol, vars=states(traced_sys))
3636
```

src/systems/diffeqs/abstractodesystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ function generate_function(
106106
eqs = [eq for eq in equations(sys) if !isdifferenceeq(eq)]
107107
if !implicit_dae
108108
check_operator_variables(eqs, Differential)
109+
check_lhs(eqs, Differential, Set(dvs))
109110
end
110-
check_lhs(eqs, Differential, Set(dvs))
111111
# substitute x(t) by just x
112112
rhss = implicit_dae ? [_iszero(eq.lhs) ? eq.rhs : eq.rhs - eq.lhs for eq in eqs] :
113113
[eq.rhs for eq in eqs]

0 commit comments

Comments
 (0)