About sol.retcode

Here I will expect code to print Success but its not doing so. can anyone tell why even when I get solution by ODE system?

if sol.retcode == :Success
    print("Success")
end

about a year ago, this was turned to sol.retcode == ReturnCode.Success (i.e. an enum)

1 Like

I used this and it works.

if Symbol(sol.retcode) == :Success
    print("Success")
end

See the documentation:

https://docs.sciml.ai/SciMLBase/stable/interfaces/Solutions/#retcodes

The recommended form is SciMLBase.successful_retcode(sol.retcode) since that covers more than just ReturnCode.Success.

2 Likes