No more DomainErrors in Julia
Use JuliaMath/NaNMath.jl.
sqrt(x), log(x), and pow(x) will throw DomainError exceptions with negative x, interrupting differential equation solvers. One can use these functions' counterparts in JuliaMath/NaNMath.jl, returning NaN instead of throwing a DomainError. Then, the solvers will reject the solution and retry with a smaller time step.