ModelingToolkit.jl: '===' comparison on Operations(/Expressions)

Check here:
https://stackoverflow.com/questions/38601141/what-is-the-difference-between-and-comparison-operators-in-julia

Or here: Overload === for custom type

By executing D(x) two times you are creating two objects stored at different memory locations. So that behavior is expected.

Since == is overloaded, you can use isequal instead:

julia> isequal(D(x), D(x))
true
5 Likes