@@ -18,22 +18,18 @@ sys = structural_simplify(sys)
18
18
19
19
This problem causes the ODE solver to crash:
20
20
21
- ``` @example debug
22
- prob = ODEProblem(sys, [], (0.0, 10.0), [])
23
- sol = solve(prob, Tsit5())
21
+ ``` @repl debug
22
+ prob = ODEProblem(sys, [], (0.0, 10.0), []);
23
+ sol = solve(prob, Tsit5());
24
24
```
25
25
26
26
This suggests * that* something went wrong, but not exactly * what* went wrong and * where* it did.
27
27
In such situations, the ` debug_system ` function is helpful:
28
28
29
- ``` @example debug
30
- try # workaround to show Documenter.jl error (https://github.com/JuliaDocs/Documenter.jl/issues/1420#issuecomment-770539595) # hide
31
- dsys = debug_system(sys; functions = [sqrt])
32
- dprob = ODEProblem(dsys, [], (0.0, 10.0), [])
33
- dsol = solve(dprob, Tsit5())
34
- catch err # hide
35
- showerror(stderr, err) # hide
36
- end # hide
29
+ ``` @repl debug
30
+ dsys = debug_system(sys; functions = [sqrt]);
31
+ dprob = ODEProblem(dsys, [], (0.0, 10.0), []);
32
+ dsol = solve(dprob, Tsit5());
37
33
```
38
34
39
35
Now we see that it crashed because ` u1 ` decreased so much that it became negative and outside the domain of the ` √ ` function.
0 commit comments