# @ode\_def not defined

**URL:** <https://discourse.julialang.org/t/ode-def-not-defined/40042>\
**Category:** New to Julia\
**Created:** [May 23, 2020, 7:55pm UTC](https://discourse.julialang.org/t/ode-def-not-defined/40042 "2020-05-23T19:55:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Post date:** [May 23, 2020, 7:55pm UTC](https://discourse.julialang.org/t/ode-def-not-defined/40042/1 "2020-05-23T19:55:16Z")

</div>

I am using DifferentialEquations.jl in a Julia Notebook. The code starts as:

```julia
using DifferentalEquations
using ParameterizedFunctions

sir_ode = @ode_def SIRModel begin
     dS = -β*S*I
     dI = β*S*I-γ*I
     dR = γ*I
     end β γ

```

When executed, I get the error:

```julia
UndefVarError: @ode_def not defined

```

That does not seem possible. What can I do about it? Thanks.

---

<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:** [May 23, 2020, 8:30pm UTC](https://discourse.julialang.org/t/ode-def-not-defined/40042/2 "2020-05-23T20:30:27Z")

</div>

That doesn’t seem possible. uhh, what versions?

---

<div class="post-metadata">

**Author:** ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Post date:** [May 23, 2020, 9:01pm UTC](https://discourse.julialang.org/t/ode-def-not-defined/40042/3 "2020-05-23T21:01:28Z")

</div>

You are correct, it does not seem possible. Here is a status list of precompiled binaries in Julia 1.4.

```julia
Status `~/.julia/environments/v1.4/Project.toml`
  [c52e3926] Atom v0.12.11
  [fbb218c0] BSON v0.2.6
  [aae01518] BandedMatrices v0.15.7
  [6e4b80f9] BenchmarkTools v0.5.0
  [0487d830] Bifurcations v0.0.1 #master (https://github.com/tkf/Bifurcations.jl.git)
  [2b5f629d] DiffEqBase v6.35.1
  [aae7a2af] DiffEqFlux v1.10.3
  [9fdde737] DiffEqOperators v4.10.0
  [0c46a032] DifferentialEquations v6.14.0
  [bbc10e6e] DynamicHMC v2.1.0
  [5789e2e9] FileIO v1.3.0
  [587475ba] Flux v0.10.4
  [7073ff75] IJulia v1.21.2
  [82e4d734] ImageIO v0.1.1
  [916415d5] Images v0.22.2
  [18b7da76] JuliaAcademyData v0.1.0 #master (https://github.com/JuliaComputing/JuliaAcademyData.jl)
  [e5e0dc1b] Juno v0.8.2
  [ee78f7c6] Makie v0.10.0
  [429524aa] Optim v0.21.0
  [65888b18] ParameterizedFunctions v5.3.0
  [d96e819e] Parameters v0.12.1
  [91a5bcdd] Plots v0.29.9
  [92933f4c] ProgressMeter v1.3.0
  [7186c646] PyDSTool v0.6.0
  [d330b81b] PyPlot v2.9.0
  [295af30f] Revise v2.6.7
  [efcf1570] Setfield v0.6.0
  [90137ffa] StaticArrays v0.12.3
  [37b6cedf] Traceur v0.3.1
  [37e2e46d] LinearAlgebra 

```

I just typed into my notebook (did the same in Atom):

```julia
MethodError: no method matching @ode_def(::LineNumberNode, ::Module)
Closest candidates are:
  @ode_def(::LineNumberNode, ::Module, !Matched::Any, !Matched::Any, !Matched::Any...) at /Users/erlebach/.julia/packages/ParameterizedFunctions/xErQf/src/macros.jl:2

```

which suggests that @ode\_def was found. So I will try to use it again. But I am sure that what I reported happened.

I exited Jupyter and started it up again. The problem went away. As usual: “rebooting” solves many issues. Not elegant though.

---

<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:** [May 23, 2020, 9:54pm UTC](https://discourse.julialang.org/t/ode-def-not-defined/40042/4 "2020-05-23T21:54:48Z")

</div>

Did your packages update mid-notebook? If you do that, you need a new Julia session to use the newer versions, so it could be something like that?

---

<div class="post-metadata">

**Author:** ![Vahid\_Hosseinzadeh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vahid_hosseinzadeh/32/33293_2.png) [@Vahid\_Hosseinzadeh](https://discourse.julialang.org/u/Vahid_Hosseinzadeh)\
**Post date:** [March 18, 2022, 8:03pm UTC](https://discourse.julialang.org/t/ode-def-not-defined/40042/5 "2022-03-18T20:03:15Z")

</div>

Hi, I get the same error which doesn’t disappear though. I tried Jupyter, Vscode, Pluto.  
It says UndefVarError. Any more help on this? I do not have problem with other functions though.

---

<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 19, 2022, 3:18pm UTC](https://discourse.julialang.org/t/ode-def-not-defined/40042/6 "2022-03-19T15:18:15Z")

</div>

Did you do `using ParameterizedFunctions`?

---

<div class="post-metadata">

**Author:** ![Vahid\_Hosseinzadeh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vahid_hosseinzadeh/32/33293_2.png) [@Vahid\_Hosseinzadeh](https://discourse.julialang.org/u/Vahid_Hosseinzadeh)\
**Post date:** [March 19, 2022, 9:38pm UTC](https://discourse.julialang.org/t/ode-def-not-defined/40042/7 "2022-03-19T21:38:08Z")

</div>

Hi Chris, yes, exactly. I am watching your video on YouTube on DifferentialEquations.jl. First really thanks for the package, huge work, really really appreciate it. But in your video because I follow your notebook and I did not see using ParameterizedFunctions (maybe I did not notice it) I got the problem. anyway thanks again for responding and for the excellent work.

---

<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 20, 2022, 11:33am UTC](https://discourse.julialang.org/t/ode-def-not-defined/40042/8 "2022-03-20T11:33:09Z")

</div>

Note that ode\_def was deprecated in 2020, and thus one needs to do `using ParameterizedFunctions` (and add that package) in order to use that functionality. This is already the reason why you will no longer find it in the DifferentialEquations.jl documentation. I added a comment to the video to hopefully help the next person who might run into this. Yeah, videos can’t easily be updated 😅, but it’s still almost all still relevant.

---

<div class="post-metadata">

**Author:** ![Vahid\_Hosseinzadeh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vahid_hosseinzadeh/32/33293_2.png) [@Vahid\_Hosseinzadeh](https://discourse.julialang.org/u/Vahid_Hosseinzadeh)\
**Post date:** [March 20, 2022, 12:42pm UTC](https://discourse.julialang.org/t/ode-def-not-defined/40042/9 "2022-03-20T12:42:03Z")

</div>

Yeah, I see. actually there are some other changes (like there is no more A\_mul\_B! function and instead we have mul! which is part of LinearAlgebra, or A + B + C works exactly like A .+ B .+ C and … ) but as you said it is hard to update videos and these all can be searched.  
thanks Chris again for the help
