# New to Julia, using it for dynamic systems simulations

**URL:** <https://discourse.julialang.org/t/new-to-julia-using-it-for-dynamic-systems-simulations/55285>\
**Category:** Modelling & Simulations\
**Tags:** diffeq, physics\
**Created:** [February 15, 2021, 12:37am UTC](https://discourse.julialang.org/t/new-to-julia-using-it-for-dynamic-systems-simulations/55285 "2021-02-15T00:37:57Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Babou](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/babou/32/22003_2.png) [@Babou](https://discourse.julialang.org/u/Babou)\
**Post date:** [February 15, 2021, 12:37am UTC](https://discourse.julialang.org/t/new-to-julia-using-it-for-dynamic-systems-simulations/55285/1 "2021-02-15T00:37:57Z")

</div>

Hi all,

I am a new Julia user. I am going to be using it to run some toy simulations of biologically realistic neural networks. If you aren’t familiar with this topic have a peak [here](https://neuronaldynamics.epfl.ch/online/Ch17.S2.html).I saw [DifferentialEquations.jl](https://diffeq.sciml.ai/v2.0/index.html) and I am going to start using that but a lot of the links on the website are deprecated also the last commit on the github was 2017. I am worried it’s not being maintained as is not worth my time learning. Are there other libraries that are useful for my needs? Would julia code written with poor optimization still be faster than python, as in if I just wrote my code “raw”, without any help from specific packages for differential equations?

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [February 15, 2021, 1:05am UTC](https://discourse.julialang.org/t/new-to-julia-using-it-for-dynamic-systems-simulations/55285/2 "2021-02-15T01:05:12Z")

</div>

That is probably the library you need, it is one major package of Julia, and it is great. The latest release is of Dec/2020:

> **[Release v6.16.0 · SciML/DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl/releases/tag/v6.16.0)**
>
> DifferentialEquations v6.16.0
> Diff since v6.15.0
> Closed issues:
> 
> Automated PDE solving fit for DifferentialEquations.jl (#469)
> Add new option to DAE solvers to never initialize DAE (#549)
> type unst...

If you write Julia code taking care of the [performance tips](https://docs.julialang.org/en/v1/manual/performance-tips/) it will be much faster than pure python, yes.

Edit: I have scrolled the performance tips now, and the list is becoming too long in my opinion, perhaps scary for a new user. Start avoiding non-constant global variables and you will be fine to start (first tip), and other tips one learns with practice.

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [February 15, 2021, 1:07am UTC](https://discourse.julialang.org/t/new-to-julia-using-it-for-dynamic-systems-simulations/55285/3 "2021-02-15T01:07:11Z")

</div>

Also, if you write your code in a vectorized/numpy style, you will probably get numpy like performance or better. Also, getting from there to full performance will be pretty easy later.

---

<div class="post-metadata">

**Author:** ![Babou](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/babou/32/22003_2.png) [@Babou](https://discourse.julialang.org/u/Babou)\
**Post date:** [February 15, 2021, 3:40am UTC](https://discourse.julialang.org/t/new-to-julia-using-it-for-dynamic-systems-simulations/55285/4 "2021-02-15T03:40:50Z")

</div>

I just tried to load dynamic equations. I’m using vscode and it was taking forever (more than a minute) then I got a very strange error message:

```julia
julia> using DifferentialEquations
[Info: Precompiling DifferentialEquations [0c46a032-eb83-5123-abaf-570d42b7fbaa]
WARNING: Method definition integer2float(Type{Float32}, Int32) in module SLEEFPirates at C:\Users\angus\.julia\packages\SLEEFPirates\tWxX3\src\utils.jl:28 overwritten at C:\Users\angus\.julia\packages\SLEEFPirates\tWxX3\src\utils.jl:30.
  **incremental compilation may be fatally broken for this module**

```

---

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [February 15, 2021, 9:52am UTC](https://discourse.julialang.org/t/new-to-julia-using-it-for-dynamic-systems-simulations/55285/5 "2021-02-15T09:52:54Z")

</div>

What versions do you have? Please display a full list of the installed software and their versions with doing `pkg> st`.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [February 15, 2021, 9:57am UTC](https://discourse.julialang.org/t/new-to-julia-using-it-for-dynamic-systems-simulations/55285/6 "2021-02-15T09:57:23Z")

</div>

@Elrod are you familiar with that warning?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [February 15, 2021, 9:58am UTC](https://discourse.julialang.org/t/new-to-julia-using-it-for-dynamic-systems-simulations/55285/7 "2021-02-15T09:58:28Z")

</div>

> [@Babou](#):
>
> I am going to start using that but a lot of the links on the website are deprecated also the last commit on the github was 2017

You were looking at the documentation from 2017, not the documentation from 2021.

---

<div class="post-metadata">

**Author:** ![Babou](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/babou/32/22003_2.png) [@Babou](https://discourse.julialang.org/u/Babou)\
**Post date:** [February 15, 2021, 2:08pm UTC](https://discourse.julialang.org/t/new-to-julia-using-it-for-dynamic-systems-simulations/55285/8 "2021-02-15T14:08:42Z")

</div>

I see that now thank you.

---

<div class="post-metadata">

**Author:** ![Babou](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/babou/32/22003_2.png) [@Babou](https://discourse.julialang.org/u/Babou)\
**Post date:** [February 15, 2021, 5:12pm UTC](https://discourse.julialang.org/t/new-to-julia-using-it-for-dynamic-systems-simulations/55285/9 "2021-02-15T17:12:35Z")

</div>

`C:\Users\angus\.julia\environments\v1.5\Project.toml`  
[a93c6f00] DataFrames v0.22.5  
[0c46a032] DifferentialEquations v6.16.0  
[e30172f5] Documenter v0.26.1  
[35a29f4d] DocumenterTools v0.1.9  
[61744808] DynamicalSystems v1.7.1  
[c91e804a] Gadfly v1.3.1  
[438e738f] PyCall v1.92.2  
[d330b81b] PyPlot v2.9.0  
[c5292f4c] ResumableFunctions v0.5.2  
[428bdadb] SimJulia v0.8.0

---

<div class="post-metadata">

**Author:** ![Babou](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/babou/32/22003_2.png) [@Babou](https://discourse.julialang.org/u/Babou)\
**Post date:** [February 15, 2021, 5:14pm UTC](https://discourse.julialang.org/t/new-to-julia-using-it-for-dynamic-systems-simulations/55285/10 "2021-02-15T17:14:50Z")

</div>

I am worried there is something wrong with my julia instillation and I am considering uninstalling and reinstalling. I will post the full error message I got when calling DifferentialEquations. it takes my laptop around 4-5 minutes to produce a very complicated and long error message. May be it will be of some insight.

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [February 15, 2021, 5:20pm UTC](https://discourse.julialang.org/t/new-to-julia-using-it-for-dynamic-systems-simulations/55285/11 "2021-02-15T17:20:45Z")

</div>

> [@Babou](#):
>
> I am worried there is something wrong with my julia instillation

Here, the first `using DifferentialEquations` took 1 minute (with precompilation) and the second took 20s. I am using Julia 1.5.3 (in 1.6 I suppose that is faster).

So probably there is something broken in your installation, yes.

Edit: Unfortunatelly I was not able to install it on 1.6-rc1, the download gets stuck somewhere. I am not sure if this is a temporary problem on the server (edit: it is a bug fixed in 1.6-rc2, it seems). (on the nightly build the `using` takes 5 seconds here).

---

<div class="post-metadata">

**Author:** ![Babou](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/babou/32/22003_2.png) [@Babou](https://discourse.julialang.org/u/Babou)\
**Post date:** [February 15, 2021, 6:01pm UTC](https://discourse.julialang.org/t/new-to-julia-using-it-for-dynamic-systems-simulations/55285/12 "2021-02-15T18:01:50Z")

</div>

This is the full error message I am getting. The julia REPL gets stuck at the line Info Precompiling… then after ten or more minutes it starts to pump out those warnings before the loading fails altogether. It’s strange because 2 days ago I loaded and used DifferentialEquations just fine. I have school work to do but later today I will try reinstalling julia. It also looks like I am missing some dependencies for some reason.

```julia
julia> using DifferentialEquations
[Info: Precompiling DifferentialEquations [0c46a032-eb83-5123-abaf-570d42b7fbaa]
┌ Warning: Module OrdinaryDiffEq with build ID 48339840974600 is missing from the cache.
│ This may mean OrdinaryDiffEq [1dea7af3-3e70-54e6-95c3-0bf5283fa5ed] does not support precompilation but is imported by a module that does.
└ @ Base loading.jl:1017
┌ Warning: Module OrdinaryDiffEq with build ID 48339840974600 is missing from the cache.
│ This may mean OrdinaryDiffEq [1dea7af3-3e70-54e6-95c3-0bf5283fa5ed] does not support precompilation but is imported by a module that does.
└ @ Base loading.jl:1017
┌ Warning: The call to compilecache failed to create a usable precompiled cache file for SymbolicUtils [d1185830-fcd6-423d-90d6-eec64667417b]
│ exception = Required dependency AbstractAlgebra [c3fe647b-3220-5bb0-a1ea-a7954cac585d] failed to load from a cache file.
└ @ Base loading.jl:1042
┌ Warning: The call to compilecache failed to create a usable precompiled cache file for ModelingToolkit [961ee093-0014-501f-94e3-6117800e7a78]
│ exception = Invalid input in module list: expected Unitful.
└ @ Base loading.jl:1042
┌ Warning: The call to compilecache failed to create a usable precompiled cache file for ModelingToolkit [961ee093-0014-501f-94e3-6117800e7a78]
│ exception = Required dependency Unitful [1986cc42-f94f-5a68-af5c-568840ba703d] failed to load from a cache file.
└ @ Base loading.jl:1042
┌ Warning: The call to compilecache failed to create a usable precompiled cache file for DifferentialEquations [0c46a032-eb83-5123-abaf-570d42b7fbaa]
│ exception = Required dependency ModelingToolkit [961ee093-0014-501f-94e3-6117800e7a78] failed to load from a cache file.
└ @ Base loading.jl:1042

```

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [February 15, 2021, 10:40pm UTC](https://discourse.julialang.org/t/new-to-julia-using-it-for-dynamic-systems-simulations/55285/13 "2021-02-15T22:40:43Z")

</div>

That happens sometimes, and it seems random. If you restart Julia it seems to go away.

---

<div class="post-metadata">

**Author:** ![willsharpless](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/willsharpless/32/36397_2.png) [@willsharpless](https://discourse.julialang.org/u/willsharpless)\
**Post date:** [March 24, 2021, 2:10pm UTC](https://discourse.julialang.org/t/new-to-julia-using-it-for-dynamic-systems-simulations/55285/14 "2021-03-24T14:10:08Z")

</div>

Hi all, having similar issues with DifferentialEquations in my new Julia installation (3 days ago?) in a mounted docker container in Visual Studio Code. Have tried restarting Julia and VSC, as well as pkg\>up. Here is the error produced after (frustratingly) 6 minutes,

[Info: Precompiling DifferentialEquations [0c46a032-eb83-5123-abaf-570d42b7fbaa]  
ERROR: LoadError: Failed to precompile Sundials [c3572dad-4567-51f8-b174-8c6c989267f4] to /root/.julia/compiled/v1.5/Sundials/j8Ppj\_nrrZo.ji.  
Stacktrace:  
[1] error(::String) at ./error.jl:33  
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1305  
[3] \_require(::Base.PkgId) at ./loading.jl:1030  
[4] require(::Base.PkgId) at ./loading.jl:928  
[5] require(::Module, ::Symbol) at ./loading.jl:923  
[6] include(::Function, ::Module, ::String) at ./Base.jl:380  
[7] include(::Module, ::String) at ./Base.jl:368  
[8] top-level scope at none:2  
[9] eval at ./boot.jl:347 [inlined]  
[10] eval(::Expr) at ./client.jl:467  
[11] top-level scope at ./none:3  
in expression starting at /root/.julia/packages/DifferentialEquations/HSWeG/src/DifferentialEquations.jl:13  
ERROR: LoadError: Failed to precompile DifferentialEquations [0c46a032-eb83-5123-abaf-570d42b7fbaa] to /root/.julia/compiled/v1.5/DifferentialEquations/UQdwS\_nrrZo.ji.  
Stacktrace:  
[1] error(::String) at ./error.jl:33  
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1305  
[3] \_require(::Base.PkgId) at ./loading.jl:1030  
[4] require(::Base.PkgId) at ./loading.jl:928  
[5] require(::Module, ::Symbol) at ./loading.jl:923  
[6] include\_string(::Function, ::Module, ::String, ::String) at ./loading.jl:1091  
[7] invokelatest(::Any, ::Any, ::Vararg{Any,N} where N; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at ./essentials.jl:710  
[8] invokelatest(::Any, ::Any, ::Vararg{Any,N} where N) at ./essentials.jl:709  
[9] inlineeval(::Module, ::String, ::Int64, ::Int64, ::String; softscope::Bool) at /root/.vscode-server/extensions/julialang.language-julia-1.1.37/scripts/packages/VSCodeServer/src/eval.jl:193  
[10] (::VSCodeServer.var"#65#69"{String,Int64,Int64,String,Module,Bool,VSCodeServer.ReplRunCodeRequestParams})() at /root/.vscode-server/extensions/julialang.language-julia-1.1.37/scripts/packages/VSCodeServer/src/eval.jl:151  
[11] withpath(::VSCodeServer.var"#65#69"{String,Int64,Int64,String,Module,Bool,VSCodeServer.ReplRunCodeRequestParams}, ::String) at /root/.vscode-server/extensions/julialang.language-julia-1.1.37/scripts/packages/VSCodeServer/src/repl.jl:142  
[12] (::VSCodeServer.var"#64#68"{String,Int64,Int64,String,Module,Bool,Bool,VSCodeServer.ReplRunCodeRequestParams})() at /root/.vscode-server/extensions/julialang.language-julia-1.1.37/scripts/packages/VSCodeServer/src/eval.jl:149  
[13] hideprompt(::VSCodeServer.var"#64#68"{String,Int64,Int64,String,Module,Bool,Bool,VSCodeServer.ReplRunCodeRequestParams}) at /root/.vscode-server/extensions/julialang.language-julia-1.1.37/scripts/packages/VSCodeServer/src/repl.jl:36  
[14] (::VSCodeServer.var"#63#67"{String,Int64,Int64,String,Module,Bool,Bool,VSCodeServer.ReplRunCodeRequestParams})() at /root/.vscode-server/extensions/julialang.language-julia-1.1.37/scripts/packages/VSCodeServer/src/eval.jl:117  
[15] with\_logstate(::Function, ::Any) at ./logging.jl:408  
[16] with\_logger at ./logging.jl:514 [inlined]  
[17] (::VSCodeServer.var"#62#66"{VSCodeServer.ReplRunCodeRequestParams})() at /root/.vscode-server/extensions/julialang.language-julia-1.1.37/scripts/packages/VSCodeServer/src/eval.jl:183  
[18] #invokelatest#1 at ./essentials.jl:710 [inlined]  
[19] invokelatest(::Any) at ./essentials.jl:709  
[20] macro expansion at /root/.vscode-server/extensions/julialang.language-julia-1.1.37/scripts/packages/VSCodeServer/src/eval.jl:34 [inlined]  
[21] (::VSCodeServer.var"#60#61")() at ./task.jl:356  
in expression starting at /home/julia/project/PostBin\_Analysis\_v1.jl:19

What’s bizarre is that I have seen 2 or 3 different errors that are all pretty similar to this but with different .jl files in /DifferentialEquations each time I reload Julia… Here is my pkg\>st information:

(@v1.5) pkg\> st  
Status `~/.julia/environments/v1.5/Project.toml`  
[49dc2e85] Calculus v0.5.1  
[479239e8] Catalyst v6.9.1  
[a93c6f00] DataFrames v0.22.5  
[0c46a032] DifferentialEquations v6.16.0  
[31c24e10] Distributions v0.24.15  
[91a5bcdd] Plots v1.11.0  
[276daf66] SpecialFunctions v1.3.0  
[2913bbd2] StatsBase v0.33.4  
[f3b207a7] StatsPlots v0.14.19  
[24249f21] SymPy v1.0.41  
[fce5fe82] Turing v0.15.12

Very new to Julia but I followed the docker installation and mounting instructions to a tee. While other precompiles are slow, DifferentialEquations is the only package giving me these issues.

Here is also a run of pkg\>up for more information, and my Julia version info  
(@v1.5) pkg\> up  
Updating registry at `~/.julia/registries/General`  
######################################################################## 100.0%  
No Changes to `~/.julia/environments/v1.5/Project.toml`  
No Changes to `~/.julia/environments/v1.5/Manifest.toml`

julia\> versioninfo()  
Julia Version 1.5.4  
Commit 69fcb5745b (2021-03-11 19:13 UTC)  
Platform Info:  
OS: Linux (x86\_64-pc-linux-gnu)  
CPU: Intel(R) Core™ i5-7360U CPU @ 2.30GHz  
WORD\_SIZE: 64  
LIBM: libopenlibm  
LLVM: libLLVM-9.0.1 (ORCJIT, skylake)  
Environment:  
JULIA\_GPG = 3673DF529D9049477F76B37566E3C7DC03D6E495  
JULIA\_PATH = /usr/local/julia  
JULIA\_VERSION = 1.5.4  
JULIA\_EDITOR = “/root/.vscode-server/bin/f30a9b73e8ffc278e71575118b6bf568f04587c8/bin/code”  
JULIA\_NUM\_THREADS =

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [March 24, 2021, 5:09pm UTC](https://discourse.julialang.org/t/new-to-julia-using-it-for-dynamic-systems-simulations/55285/15 "2021-03-24T17:09:02Z")

</div>

Does it have internet access? It seems like it couldn’t download the Sundials binary.
