Questions about the values of @variables in Catalyst/ModelingToolkit

Those values are, as far as I am aware, solely used when creating an ODEProblem or such to specify the initial condition vector, u0, and the parameter value vector, p, – they aren’t used in the symbolic expressions at all.

If you want to substitute concrete values into a symbolic expression you can use Symbolics.substitute like

using ModelingToolkit, Symbolics
@parameters k
@variables t A(t)
ex = A^2 * k
val = substitute(ex, Dict(A => 2.0, k => 3.0))
1 Like