# Error with ModelingToolkit documentation example

**URL:** <https://discourse.julialang.org/t/error-with-modelingtoolkit-documentation-example/113946>\
**Category:** Modelling & Simulations\
**Tags:** differentialequation\
**Created:** [May 7, 2024, 1:47pm UTC](https://discourse.julialang.org/t/error-with-modelingtoolkit-documentation-example/113946 "2024-05-07T13:47:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![amytmoody](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@amytmoody](https://discourse.julialang.org/u/amytmoody)\
**Post date:** [May 7, 2024, 1:47pm UTC](https://discourse.julialang.org/t/error-with-modelingtoolkit-documentation-example/113946/1 "2024-05-07T13:47:49Z")

</div>

I’m getting the following error from the first example in the [Getting Started with ModelingToolkit](https://docs.sciml.ai/ModelingToolkit/dev/tutorials/ode_modeling/) example.

```julia
WARNING: could not import ModelingToolkit.t_nounits into Main

UndefVarError: `D` not defined

```

I found a workaround following instructions from earlier versions of the package by adding this before the example code:

```julia
@parameters t
D = Differential(t)

```

What is the best practices solution? It seems not the best to define these outside of @mtkmodel?

---

<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 7, 2024, 2:10pm UTC](https://discourse.julialang.org/t/error-with-modelingtoolkit-documentation-example/113946/2 "2024-05-07T14:10:15Z")

</div>

Are you on ModelingToolkit v9? Show `]st`.

---

<div class="post-metadata">

**Author:** ![amytmoody](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@amytmoody](https://discourse.julialang.org/u/amytmoody)\
**Post date:** [May 7, 2024, 2:39pm UTC](https://discourse.julialang.org/t/error-with-modelingtoolkit-documentation-example/113946/3 "2024-05-07T14:39:05Z")

</div>

Thank you. I had updated all packages but missed that ModelingToolkit was prevented from updating due to Catalyst. Updating from 8.75 to 9.12 fixed the issue.
