# UndefVarError: ODESystem not defined when running DynamicalSystems.jl example

**URL:** <https://discourse.julialang.org/t/undefvarerror-odesystem-not-defined-when-running-dynamicalsystems-jl-example/129514>\
**Category:** General Usage\
**Tags:** question\
**Created:** [June 1, 2025, 2:38am UTC](https://discourse.julialang.org/t/undefvarerror-odesystem-not-defined-when-running-dynamicalsystems-jl-example/129514 "2025-06-01T02:38:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cristian\_marin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cristian_marin/32/217088_2.png) [@cristian\_marin](https://discourse.julialang.org/u/cristian_marin)\
**Post date:** [June 1, 2025, 2:38am UTC](https://discourse.julialang.org/t/undefvarerror-odesystem-not-defined-when-running-dynamicalsystems-jl-example/129514/1 "2025-06-01T02:38:27Z")

</div>

UndefVarError: `ODESystem` not defined in `Main`  
Stacktrace:  
[1] top-level scope  
@ C:\Users\marin.julia\packages\ModelingToolkit\DSTHC\src\systems\abstractsystem.jl:2191

I’m trying to run a example from DynamicalSystems.jl docs. My code is identical, but `ODESystem` isn’t found despite importing ModelingToolkit.

Is this a version conflict? How should I properly define ODESystem in recent MTK versions?

---

<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:** [June 1, 2025, 10:20am UTC](https://discourse.julialang.org/t/undefvarerror-odesystem-not-defined-when-running-dynamicalsystems-jl-example/129514/2 "2025-06-01T10:20:15Z")

</div>

> [@cristian\_marin](#):
>
> Is this a version conflict? How should I properly define ODESystem in recent MTK versions?

MTK v10 just came out on Friday, and one major change was going from having all of the XSystem types to just having a single `System`. Try using System? You might have the v10 and DynamicalSystems.jl likely hasn’t updated its docs because it just came out.

This is supposed to have a deprecation path on it but my guess is that something happened there… @cryptic.ax

---

<div class="post-metadata">

**Author:** ![cristian\_marin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cristian_marin/32/217088_2.png) [@cristian\_marin](https://discourse.julialang.org/u/cristian_marin)\
**Post date:** [June 1, 2025, 2:48pm UTC](https://discourse.julialang.org/t/undefvarerror-odesystem-not-defined-when-running-dynamicalsystems-jl-example/129514/3 "2025-06-01T14:48:48Z")

</div>

Great, it works now! Thanks a lot for your help

---

<div class="post-metadata">

**Author:** ![cryptic.ax](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cryptic.ax/32/220540_2.png) [@cryptic.ax](https://discourse.julialang.org/u/cryptic.ax)\
**Post date:** [June 2, 2025, 11:43am UTC](https://discourse.julialang.org/t/undefvarerror-odesystem-not-defined-when-running-dynamicalsystems-jl-example/129514/4 "2025-06-02T11:43:21Z")

</div>

[refactor: add depwarns for old system and problem constructors by AayushSabharwal · Pull Request #3682 · SciML/ModelingToolkit.jl · GitHub](https://github.com/SciML/ModelingToolkit.jl/pull/3682) adds a bunch of fallback deprecations.
