Skip to content

Commit d14dfa6

Browse files
committed
Formatting and fix typo
1 parent 4f0b564 commit d14dfa6

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

src/inputoutput.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,7 @@ function generate_control_function(sys::AbstractODESystem, inputs = unbound_inpu
185185
error("No unbound inputs were found in system.")
186186
end
187187

188-
sys, diff_idxs, alge_idxs = io_preprocessing(sys, inputs, []; simplify,
189-
check_bound = false, kwargs...)
188+
sys, diff_idxs, alge_idxs = io_preprocessing(sys, inputs, []; simplify, kwargs...)
190189

191190
dvs = states(sys)
192191
ps = parameters(sys)

src/structural_transformation/symbolics_tearing.jl

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ function substitute_vars!(graph::BipartiteGraph, subs, cache = Int[], callback!
134134
graph
135135
end
136136

137-
function to_mass_matrix_form(neweqs, ieq, graph, fullvars, isdervar::F, var_to_diff) where F
137+
function to_mass_matrix_form(neweqs, ieq, graph, fullvars, isdervar::F,
138+
var_to_diff) where {F}
138139
eq = neweqs[ieq]
139140
if !(eq.lhs isa Number && eq.lhs == 0)
140141
eq = 0 ~ eq.rhs - eq.lhs
@@ -447,7 +448,8 @@ function tearing_reassemble(state::TearingState, var_eq_matching; simplify = fal
447448
# We cannot solve the differential variable like D(x)
448449
if isdervar(iv)
449450
# TODO: what if `to_mass_matrix_form(ieq)` returns `nothing`?
450-
eq, diffidx = to_mass_matrix_form(neweqs, ieq, graph, fullvars, isdervar, var_to_diff)
451+
eq, diffidx = to_mass_matrix_form(neweqs, ieq, graph, fullvars, isdervar,
452+
var_to_diff)
451453
push!(diff_eqs, eq)
452454
push!(diffeq_idxs, ieq)
453455
push!(diff_vars, diffidx)
@@ -472,7 +474,8 @@ function tearing_reassemble(state::TearingState, var_eq_matching; simplify = fal
472474
push!(solved_variables, iv)
473475
end
474476
else
475-
eq, diffidx = to_mass_matrix_form(neweqs, ieq, graph, fullvars, isdervar, var_to_diff)
477+
eq, diffidx = to_mass_matrix_form(neweqs, ieq, graph, fullvars, isdervar,
478+
var_to_diff)
476479
if diffidx === nothing
477480
push!(alge_eqs, eq)
478481
push!(algeeq_idxs, ieq)
@@ -494,7 +497,9 @@ function tearing_reassemble(state::TearingState, var_eq_matching; simplify = fal
494497
if length(diff_vars_set) != length(diff_vars)
495498
error("Tearing internal error: lowering DAE into semi-implicit ODE failed!")
496499
end
497-
invvarsperm = [diff_vars; setdiff!(setdiff(1:ndsts(graph), diff_vars_set), BitSet(solved_variables))]
500+
invvarsperm = [diff_vars;
501+
setdiff!(setdiff(1:ndsts(graph), diff_vars_set),
502+
BitSet(solved_variables))]
498503
varsperm = zeros(Int, ndsts(graph))
499504
for (i, v) in enumerate(invvarsperm)
500505
varsperm[v] = i
@@ -516,7 +521,8 @@ function tearing_reassemble(state::TearingState, var_eq_matching; simplify = fal
516521

517522
# Contract the vertices in the structure graph to make the structure match
518523
# the new reality of the system we've just created.
519-
graph = contract_variables(graph, var_eq_matching, varsperm, eqsperm, length(solved_variables))
524+
graph = contract_variables(graph, var_eq_matching, varsperm, eqsperm,
525+
length(solved_variables))
520526

521527
# Update system
522528
new_var_to_diff = complete(DiffGraph(length(invvarsperm)))

src/systems/abstractsystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ function io_preprocessing(sys::AbstractSystem, inputs,
982982
if alg_start_idx === nothing
983983
alg_start_idx = length(eqs) + 1
984984
end
985-
diff_idxs = 1:alg_start_idx - 1
985+
diff_idxs = 1:(alg_start_idx - 1)
986986
alge_idxs = alg_start_idx:length(eqs)
987987

988988
sys, diff_idxs, alge_idxs, input_idxs

0 commit comments

Comments
 (0)