# NetworkDynamics.jl with Neural Networks

**URL:** <https://discourse.julialang.org/t/networkdynamics-jl-with-neural-networks/134918>\
**Category:** General Usage\
**Tags:** question, package\
**Created:** [January 6, 2026, 8:31pm UTC](https://discourse.julialang.org/t/networkdynamics-jl-with-neural-networks/134918 "2026-01-06T20:31:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lear](https://avatars.discourse-cdn.com/v4/letter/l/9f8e36/32.png) [@lear](https://discourse.julialang.org/u/lear)\
**Post date:** [January 6, 2026, 8:31pm UTC](https://discourse.julialang.org/t/networkdynamics-jl-with-neural-networks/134918/1 "2026-01-06T20:31:06Z")

</div>

Hi, I am working on integrating Neural ODEs into network simulations using NetworkDynamics.jl and ModelingToolkitNeuralNets.jl. The Problem is `NetworkDynamics.jl` appears to generate duplicate symbol names when processing vector symbols.

```julia-auto
ERROR: ArgumentError: Symbol names must be unique. There are clashes in sym, psym, outsym, obssym and insym.
Stacktrace:
 [1] _fill_defaults(T::Type, kwargs::Any)
   @ NetworkDynamics ~/.julia/packages/NetworkDynamics/Fl0Oh/src/component_functions.jl:1005
 [2] _construct_comp(::Type{VertexModel}, kwargs::Any)
   @ NetworkDynamics ~/.julia/packages/NetworkDynamics/Fl0Oh/src/component_functions.jl:589
 [3] #VertexModel#33
   @ ~/.julia/packages/NetworkDynamics/Fl0Oh/src/component_functions.jl:302 [inlined]
 [4] VertexModel(sys::System, inputs::Vector{…}, outputs::Vector{…}; verbose::Bool, name::Symbol, ff_to_constraint::Bool, extin::Nothing, kwargs::@Kwargs{})
   @ NetworkDynamicsMTKExt ~/.julia/packages/NetworkDynamics/Fl0Oh/ext/NetworkDynamicsMTKExt.jl:85

```

I wonder if there are any other way to create symbolic neural networks?

---

<div class="post-metadata">

**Author:** ![hexaeder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hexaeder/32/24403_2.png) [@hexaeder](https://discourse.julialang.org/u/hexaeder)\
**Post date:** [January 6, 2026, 10:12pm UTC](https://discourse.julialang.org/t/networkdynamics-jl-with-neural-networks/134918/2 "2026-01-06T22:12:43Z")

</div>

NetworkDynamics.jl uses custom codegen to generate the dynamical functions for the components from MTK Systems. This pipeline does not support vector variables (they are also quite fragile in pure MTK pre v11). Unfortunately, it’s not trivial to implement this. Offen, it is possible to work around that issue. What is it what you‘re trying to achieve? Do you want to put a neural net in the rhs function of a vertex or edge model? Or do you want to model the neural net itself using ND.jl

---

<div class="post-metadata">

**Author:** ![lear](https://avatars.discourse-cdn.com/v4/letter/l/9f8e36/32.png) [@lear](https://discourse.julialang.org/u/lear)\
**Post date:** [January 6, 2026, 10:56pm UTC](https://discourse.julialang.org/t/networkdynamics-jl-with-neural-networks/134918/3 "2026-01-06T22:56:05Z")

</div>

Thanks for your answer. I want to use a neural net to replace a vertex model. I am attempting to build a simple neural network directly in mtkmodel without relying on ModelingToolkitNeuralNets.jl.
