# How to extract the \*\*numerical differential equations\*\* from a model I built with ModelingToolkit.?

**URL:** <https://discourse.julialang.org/t/how-to-extract-the-numerical-differential-equations-from-a-model-i-built-with-modelingtoolkit/135221>\
**Category:** General Usage\
**Tags:** modelingtoolkit\
**Created:** [January 23, 2026, 12:33pm UTC](https://discourse.julialang.org/t/how-to-extract-the-numerical-differential-equations-from-a-model-i-built-with-modelingtoolkit/135221 "2026-01-23T12:33:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreas1](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@andreas1](https://discourse.julialang.org/u/andreas1)\
**Post date:** [January 23, 2026, 12:33pm UTC](https://discourse.julialang.org/t/how-to-extract-the-numerical-differential-equations-from-a-model-i-built-with-modelingtoolkit/135221/1 "2026-01-23T12:33:08Z")

</div>

hy,

I want to extract the **numerical differential equations** from a model I built with ModelingToolkit. For example:

@mtkbuild dgl = System(vcat(eqs\_1, eq2), t)

# Define problem

prob = ODEProblem(dgl, bcs, tspan)

Now I would like to obtain the **explicit ODE form with numerical parameter values substituted** , e.g.

dx˙= = 2x + 4x^2

Is there a way to do this in ModelingToolkit (i.e., to print or export the ODEs with parameters replaced by their numeric values)?

Thanks a lot in advance.  
Andreas

---

<div class="post-metadata">

**Author:** ![hersle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hersle/32/211689_2.png) [@hersle](https://discourse.julialang.org/u/hersle)\
**Post date:** [January 23, 2026, 1:44pm UTC](https://discourse.julialang.org/t/how-to-extract-the-numerical-differential-equations-from-a-model-i-built-with-modelingtoolkit/135221/2 "2026-01-23T13:44:54Z")

</div>

`eqs = equations(dgl)` gives the explicit equations. If you want the numerical parameters explicitly inserted, I suppose you could `substitute` them into `eqs` using the mapping in `bcs` or `prob.ps`.
