@@ -887,7 +887,8 @@ Compile an affect defined by a set of equations. Systems with algebraic equation
887
887
function compile_equational_affect (
888
888
aff:: Union{AffectSystem, Vector{Equation}} , sys; reset_jumps = false , kwargs... )
889
889
if aff isa AbstractVector
890
- aff = make_affect (aff; iv = get_iv (sys), alg_eqs = alg_equations (sys), warn_no_algebraic = false )
890
+ aff = make_affect (
891
+ aff; iv = get_iv (sys), alg_eqs = alg_equations (sys), warn_no_algebraic = false )
891
892
end
892
893
affsys = system (aff)
893
894
ps_to_update = discretes (aff)
@@ -925,7 +926,9 @@ function compile_equational_affect(
925
926
wrap_code = add_integrator_header (sys, integ, :p ),
926
927
expression = Val{false }, outputidxs = p_idxs, wrap_mtkparameters, cse = false )
927
928
928
- return let dvs_to_update = dvs_to_update, ps_to_update = ps_to_update, reset_jumps = reset_jumps, u_up! = u_up!, p_up! = p_up!
929
+ return let dvs_to_update = dvs_to_update, ps_to_update = ps_to_update,
930
+ reset_jumps = reset_jumps, u_up! = u_up!, p_up! = p_up!
931
+
929
932
function explicit_affect! (integ)
930
933
isempty (dvs_to_update) || u_up! (integ)
931
934
isempty (ps_to_update) || p_up! (integ)
@@ -935,7 +938,7 @@ function compile_equational_affect(
935
938
else
936
939
return let dvs_to_update = dvs_to_update, aff_map = aff_map, sys_map = sys_map,
937
940
affsys = affsys, ps_to_update = ps_to_update, aff = aff, sys = sys
938
-
941
+
939
942
dvs_to_access = unknowns (affsys)
940
943
ps_to_access = parameters (affsys)
941
944
@@ -946,12 +949,14 @@ function compile_equational_affect(
946
949
affu_getters = [getsym (affsys, sys_map[u]) for u in dvs_to_update]
947
950
affp_getters = [getsym (affsys, sys_map[p]) for p in ps_to_update]
948
951
949
- affprob = ImplicitDiscreteProblem (affsys, [dv => 0 for dv in dvs_to_access], (0 , 0 ), [p => 0 for p in ps_to_access];
952
+ affprob = ImplicitDiscreteProblem (affsys, [dv => 0 for dv in dvs_to_access],
953
+ (0 , 0 ), [p => 0 for p in ps_to_access];
950
954
build_initializeprob = false , check_length = false )
951
955
952
956
function implicit_affect! (integ)
953
957
pmap = Pair[p => getp (integ) for (p, getp) in zip (ps_to_access, p_getters)]
954
- u0map = Pair[u => getu (integ) for (u, getu) in zip (dvs_to_access, u_getters)]
958
+ u0map = Pair[u => getu (integ)
959
+ for (u, getu) in zip (dvs_to_access, u_getters)]
955
960
affprob = remake (affprob, u0 = u0map, p = pmap, tspan = (integ. t, integ. t))
956
961
affsol = init (affprob, IDSolve ())
957
962
(check_error (affsol) === ReturnCode. InitialFailure) &&
0 commit comments