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
42
42
```
43
43
44
44
The 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.
46
56
47
57
``` @repl debug
48
58
dsys = debug_system(sys; functions = []);
49
59
dprob = ODEProblem(dsys, [], (0.0, 10.0));
50
60
dsol = solve(dprob, Tsit5());
51
61
```
52
62
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
+ ```
54
70
55
71
``` @docs
56
72
debug_system
You can’t perform that action at this time.
0 commit comments