File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -42,15 +42,31 @@ Suppose we also want to validate that `u1 + u2 >= 2.0`. We can do this via the a
4242```
4343
4444The assertions must be an iterable of pairs, where the first element is the symbolic condition and
45- the second is the message to be logged when the condition fails.
45+ the second is a message to be logged when the condition fails. All assertions are added to the
46+ generated code and will cause the solver to reject steps that fail the assertions. For systems such
47+ as the above where the assertion is guaranteed to eventually fail, the solver will likely exit
48+ with a ` dtmin ` failure..
49+
50+ ``` @example debug
51+ prob = ODEProblem(sys, [], (0.0, 10.0))
52+ sol = solve(prob, Tsit5())
53+ ```
54+
55+ We can use ` debug_system ` to log the failing assertions in each call to the RHS function.
4656
4757``` @repl debug
4858dsys = debug_system(sys; functions = []);
4959dprob = ODEProblem(dsys, [], (0.0, 10.0));
5060dsol = solve(dprob, Tsit5());
5161```
5262
53- Note the messages containing the failed assertion and corresponding message.
63+ Note the logs containing the failed assertion and corresponding message. To temporarily disable
64+ logging in a system returned from ` debug_system ` , use ` ModelingToolkit.ASSERTION_LOG_VARIABLE ` .
65+
66+ ``` @repl debug
67+ dprob[ModelingToolkit.ASSERTION_LOG_VARIABLE] = false;
68+ solve(drob, Tsit5());
69+ ```
5470
5571``` @docs
5672debug_system
You can’t perform that action at this time.
0 commit comments