# DifferentialEquations.jl - solve not defined

**URL:** <https://discourse.julialang.org/t/differentialequations-jl-solve-not-defined/7485>\
**Category:** New to Julia\
**Tags:** diffeq\
**Created:** [December 3, 2017, 10:58pm UTC](https://discourse.julialang.org/t/differentialequations-jl-solve-not-defined/7485 "2017-12-03T22:58:15Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kavitha](https://avatars.discourse-cdn.com/v4/letter/k/edb3f5/32.png) [@Kavitha](https://discourse.julialang.org/u/Kavitha)\
**Post date:** [December 3, 2017, 10:58pm UTC](https://discourse.julialang.org/t/differentialequations-jl-solve-not-defined/7485/1 "2017-12-03T22:58:15Z")

</div>

Hi,

I am relatively new to Julia, have been trying to solve a system of differential equations using Julia, but it always returns the error ’  
LoadError: UndefVarError: solve not defined’. I am not able to figure out why. Could anyone please help me. I have included a simple example code here.

using DifferentialEquations  
U₀ₙₑₔ = 0.1635  
dₚ = 100e-6  
a = 315\*(dₚ^0.64/U₀ₙₑₔ)  
f(z,c) = a\*c  
cₛ₀ = 0.5  
tspan = (0.6,1.2)  
prob = ODEProblem(f,cₛ₀,tspan)  
sol = solve(prob,Tsit5(),reltol=1e-8,abstol=1e-8)

---

<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:** [December 3, 2017, 11:21pm UTC](https://discourse.julialang.org/t/differentialequations-jl-solve-not-defined/7485/2 "2017-12-03T23:21:10Z")

</div>

> [@Kavitha](#):
>
> have included a simple example code here.

What does `Pkg.status("DifferentialEquations"); Pkg.status("OrdinaryDiffEq")` say?

---

<div class="post-metadata">

**Author:** ![Kavitha](https://avatars.discourse-cdn.com/v4/letter/k/edb3f5/32.png) [@Kavitha](https://discourse.julialang.org/u/Kavitha)\
**Post date:** [December 3, 2017, 11:27pm UTC](https://discourse.julialang.org/t/differentialequations-jl-solve-not-defined/7485/3 "2017-12-03T23:27:23Z")

</div>

> [@ChrisRackauckas](#):
>
> Pkg.status(“OrdinaryDiffEq”)

Pkg.status(“DifferentialEquations”)

- DifferentialEquations 3.0.2

Pkg.status(“OrdinaryDiffEq”)

- OrdinaryDiffEq 2.26.0

---

<div class="post-metadata">

**Author:** ![Kavitha](https://avatars.discourse-cdn.com/v4/letter/k/edb3f5/32.png) [@Kavitha](https://discourse.julialang.org/u/Kavitha)\
**Post date:** [December 3, 2017, 11:31pm UTC](https://discourse.julialang.org/t/differentialequations-jl-solve-not-defined/7485/4 "2017-12-03T23:31:25Z")

</div>

Initially, when I first tried this in the older version of julia, I got the same error, so I tried updating to latest version, but still I get the same error everytime.

---

<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:** [December 3, 2017, 11:47pm UTC](https://discourse.julialang.org/t/differentialequations-jl-solve-not-defined/7485/5 "2017-12-03T23:47:52Z")

</div>

> [@Kavitha](#):
>
> Initially, when I first tried this in the older version of julia, I got the same error, so I tried updating to latest version, but still I get the same error everytime.

Weird. You’re on the latest versions of the packages. Did it not say anything during precompile or build stages? No error messages at all?

Replace `using DifferentialEquations` with `using OrdinaryDiffEq` and see if it works.

---

<div class="post-metadata">

**Author:** ![Kavitha](https://avatars.discourse-cdn.com/v4/letter/k/edb3f5/32.png) [@Kavitha](https://discourse.julialang.org/u/Kavitha)\
**Post date:** [December 4, 2017, 12:10am UTC](https://discourse.julialang.org/t/differentialequations-jl-solve-not-defined/7485/6 "2017-12-04T00:10:28Z")

</div>

> [@ChrisRackauckas](#):
>
> OrdinaryDiffEq

It gives me the same error, with OrdinaryDiffEq

LoadError: UndefVarError: solve not defined  
while loading untitled-217b70b82c9a0ba6d911c4b161998771, in expression starting on line 9  
include\_string(::String, ::String) at loading.jl:522  
include\_string(::Module, ::String, ::String) at Compat.jl:174  
(::Atom.##57#60{String,String})() at eval.jl:74  
withpath(::Atom.##57#60{String,String}, ::Void) at utils.jl:30  
withpath(::Function, ::String) at eval.jl:38  
macro expansion at eval.jl:72 [inlined]  
(::Atom.##56#59{Dict{String,Any}})() at task.jl:80

---

<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:** [December 4, 2017, 12:20am UTC](https://discourse.julialang.org/t/differentialequations-jl-solve-not-defined/7485/7 "2017-12-04T00:20:08Z")

</div>

And there are no other errors or warnings? If so, bizarre. Try prefacing it with the package name:

```julia
sol = OrdinaryDiffEq.solve(prob,Tsit5(),reltol=1e-8,abstol=1e-8)

```

What does `Pkg.status("DiffEqBase")` say?

---

<div class="post-metadata">

**Author:** ![Kavitha](https://avatars.discourse-cdn.com/v4/letter/k/edb3f5/32.png) [@Kavitha](https://discourse.julialang.org/u/Kavitha)\
**Post date:** [December 4, 2017, 12:32am UTC](https://discourse.julialang.org/t/differentialequations-jl-solve-not-defined/7485/8 "2017-12-04T00:32:51Z")

</div>

> [@ChrisRackauckas](#):
>
> Pkg.status(“DiffEqBase”)

- DiffEqBase 2.6.1  
There are no other errors or warnings, just that solve is not defined

---

<div class="post-metadata">

**Author:** ![Kavitha](https://avatars.discourse-cdn.com/v4/letter/k/edb3f5/32.png) [@Kavitha](https://discourse.julialang.org/u/Kavitha)\
**Post date:** [December 4, 2017, 12:33am UTC](https://discourse.julialang.org/t/differentialequations-jl-solve-not-defined/7485/9 "2017-12-04T00:33:15Z")

</div>

And, it worked, when prefaced with the package name.  
sol = OrdinaryDiffEq.solve(prob,Tsit5(),reltol=1e-8,abstol=1e-8)

---

<div class="post-metadata">

**Author:** ![Kavitha](https://avatars.discourse-cdn.com/v4/letter/k/edb3f5/32.png) [@Kavitha](https://discourse.julialang.org/u/Kavitha)\
**Post date:** [December 4, 2017, 12:35am UTC](https://discourse.julialang.org/t/differentialequations-jl-solve-not-defined/7485/10 "2017-12-04T00:35:36Z")

</div>

Thank you so much.

But what could be the issue, why didn’t it work with the usual procedure? I’m wondering because I frequently update the packages and have no idea what could have possibly gone wrong

---

<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:** [December 4, 2017, 12:39am UTC](https://discourse.julialang.org/t/differentialequations-jl-solve-not-defined/7485/11 "2017-12-04T00:39:11Z")

</div>

> [@Kavitha](#):
>
> But what could be the issue, why didn’t it work with the usual procedure? I’m wondering because I frequently update the packages and have no idea what could have possibly gone wrong

You have some other package exporting `solve`, and it will throw a warning when `using DifferentialEquations` or `using OrdinaryDiffEq` is done. That warning will tell you what other package is using without extending `solve`.

---

<div class="post-metadata">

**Author:** ![Kavitha](https://avatars.discourse-cdn.com/v4/letter/k/edb3f5/32.png) [@Kavitha](https://discourse.julialang.org/u/Kavitha)\
**Post date:** [December 4, 2017, 12:59am UTC](https://discourse.julialang.org/t/differentialequations-jl-solve-not-defined/7485/12 "2017-12-04T00:59:12Z")

</div>

Okay, Thank you.

But, I didn’t get any warning, just the error

---

<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:** [December 4, 2017, 1:13am UTC](https://discourse.julialang.org/t/differentialequations-jl-solve-not-defined/7485/13 "2017-12-04T01:13:46Z")

</div>

> [@Kavitha](#):
>
> But, I didn’t get any warning, just the error

Is this a standard Julia installation?

---

<div class="post-metadata">

**Author:** ![Kavitha](https://avatars.discourse-cdn.com/v4/letter/k/edb3f5/32.png) [@Kavitha](https://discourse.julialang.org/u/Kavitha)\
**Post date:** [December 4, 2017, 2:42am UTC](https://discourse.julialang.org/t/differentialequations-jl-solve-not-defined/7485/14 "2017-12-04T02:42:35Z")

</div>

Yes, of course!

---

<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:** [December 4, 2017, 2:48am UTC](https://discourse.julialang.org/t/differentialequations-jl-solve-not-defined/7485/15 "2017-12-04T02:48:56Z")

</div>

> [@Kavitha](#):
>
> Yes, of course!

Well then I’m baffled as to why you don’t get a warning that tells you what other package is exporting solve, but at least I could identify the issue 🙂

---

<div class="post-metadata">

**Author:** ![pkofod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pkofod/32/2179_2.png) [@pkofod](https://discourse.julialang.org/u/pkofod)\
**Post date:** [December 4, 2017, 6:57am UTC](https://discourse.julialang.org/t/differentialequations-jl-solve-not-defined/7485/16 "2017-12-04T06:57:17Z")

</div>

Please try to simplify what you’re doing as much as possible and post everything from the REPL in a gist ([gist.github.com](http://gist.github.com)). It seems very weird that you’re not getting a warning as Chris mentions.

---

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [December 4, 2017, 9:22am UTC](https://discourse.julialang.org/t/differentialequations-jl-solve-not-defined/7485/17 "2017-12-04T09:22:02Z")

</div>

Maybe he got the warning way back when he started the session, and all of this is done in a “old” session?

---

<div class="post-metadata">

**Author:** ![pkofod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pkofod/32/2179_2.png) [@pkofod](https://discourse.julialang.org/u/pkofod)\
**Post date:** [December 4, 2017, 1:54pm UTC](https://discourse.julialang.org/t/differentialequations-jl-solve-not-defined/7485/18 "2017-12-04T13:54:40Z")

</div>

Indeed. Maybe I should have emphasized that I meant “everything!!!” when I said “everything” 🙂 Let’s see the splash screen! 🙂

---

<div class="post-metadata">

**Author:** ![Kavitha](https://avatars.discourse-cdn.com/v4/letter/k/edb3f5/32.png) [@Kavitha](https://discourse.julialang.org/u/Kavitha)\
**Post date:** [December 4, 2017, 7:27pm UTC](https://discourse.julialang.org/t/differentialequations-jl-solve-not-defined/7485/19 "2017-12-04T19:27:29Z")

</div>

Sorry, it was my mistake.

@yakir12 was right. To check that, I restarted Julia and solved one of my files using solve and then when I came back and tried to solve this again, it gave me a warning:

WARNING: using JuMP.solve in module Main conflicts with an existing identifier.

I guess, it might have displayed the warning way back and I kept running different modules, didn’t notice the warning in the old session.

@ChrisRackauckas Thank you 🙂

---

<div class="post-metadata">

**Author:** ![pkofod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pkofod/32/2179_2.png) [@pkofod](https://discourse.julialang.org/u/pkofod)\
**Post date:** [December 4, 2017, 8:03pm UTC](https://discourse.julialang.org/t/differentialequations-jl-solve-not-defined/7485/20 "2017-12-04T20:03:12Z")

</div>

You can mark the answer as a solution, that way this topic will be marked as solved 🙂

[Next page](https://discourse.julialang.org/t/differentialequations-jl-solve-not-defined/7485.md?page=2)
