When I tried ModelingToolkit.jl package with the tutorial example
using ModelingToolkit
@variables t
@derivatives D'~t
z = t + t^2
expand_derivatives(D(z))
I had a wrong answer. Instead of having 1+2t
, I had 2t
.
This strange thing occurred when I used the environment @v1.5 (when I installed Julia, there was a message saying that the path length is greater than 50 characters, so I shortened the path to just "v1.5"). If I use the environment @JuliaPro_v1.5.2-1, however, I have correct answer 1 + (2 * t)
.
Is it a bug or is my system missing some other packages? The version of ModelingToolkit.jl I am using is 3.14.2.
Thank you.
This is fine on MTK v4 (and a lot of earlier versions, but at least any v4.x is recommended these days anyways) so it could be a bug of an earlier version. The suggestion is to just use a newer version, which all downstream packages do, so for the most part this shouldn't be an issue.