@@ -18,22 +18,18 @@ sys = structural_simplify(sys)
1818
1919This problem causes the ODE solver to crash:
2020
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());  
2424``` 
2525
2626This suggests * that*  something went wrong, but not exactly * what*  went wrong and * where*  it did.
2727In such situations, the ` debug_system `  function is helpful:
2828
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()); 
3733``` 
3834
3935Now we see that it crashed because ` u1 `  decreased so much that it became negative and outside the domain of the ` √ `  function.
0 commit comments