You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/systems/callbacks.jl
+15-14Lines changed: 15 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -1024,26 +1024,27 @@ function compile_user_affect(affect::MutatingFunctionalAffect, cb, sys, dvs, ps;
1024
1024
end
1025
1025
1026
1026
obs_exprs =observed(affect)
1027
-
for oexpr in obs_exprs
1028
-
invalid_vars =invalid_variables(sys, oexpr)
1029
-
iflength(invalid_vars) >0&&!affect.skip_checks
1030
-
error("Observed equation $(oexpr) in affect refers to missing variable(s) $(invalid_vars); the variables may not have been added (e.g. if a component is missing).")
1027
+
if!affect.skip_checks
1028
+
for oexpr in obs_exprs
1029
+
invalid_vars =invalid_variables(sys, oexpr)
1030
+
iflength(invalid_vars) >0
1031
+
error("Observed equation $(oexpr) in affect refers to missing variable(s) $(invalid_vars); the variables may not have been added (e.g. if a component is missing).")
@warn ("Expression $mexpr cannot be assigned to; currently only unknowns and parameters may be updated by an affect.")
1043
-
end
1044
-
invalid_vars =unassignable_variables(sys, mexpr)
1045
-
iflength(invalid_vars) >0&&!affect.skip_checks
1046
-
error("Modified equation $(mexpr) in affect refers to missing variable(s) $(invalid_vars); the variables may not have been added (e.g. if a component is missing) or they may have been reduced away.")
@warn ("Expression $mexpr cannot be assigned to; currently only unknowns and parameters may be updated by an affect.")
1043
+
end
1044
+
invalid_vars =unassignable_variables(sys, mexpr)
1045
+
iflength(invalid_vars) >0
1046
+
error("Modified equation $(mexpr) in affect refers to missing variable(s) $(invalid_vars); the variables may not have been added (e.g. if a component is missing) or they may have been reduced away.")
0 commit comments