Hi, I am new to Julia and BifurcationKit. I am trying to perform a bifurcation analysis for a kinetic model I am using to model a chemical plant. The plant’s nonlinear algebraic system of equation is quite large with 67 variables and 67 equations. I am using ModelingToolkit to build this model through @mtkmodel. As a part of the model I have some stoichiometric values which rely on other input parameter values. For example:
x1 = 1 - f_SI
where x1 is the stoichiometric coefficient and f_SI is a input parameter. Passing this model after giving initial guess for state variables and input parameter to BifurcationProblem:
ERROR: Found symbolic value 1.0 - f_SI for variable reactor1₊x1. You may be missing an initial condition or have cyclic initial conditions. If this is intended, pass `symbolic_u0 = true`. In case the initial conditions are not cyclic but require more substitutions to resolve, increase `substitution_limit`. To report cycles in initial conditions of unknowns/parameters, pass `warn_cyclic_dependency = true`. If the cycles are still not reported, you may need to pass a larger value for `circular_dependency_max_cycle_length` or `circular_dependency_max_cycles`.
This x1 = 1 - f_SI is just one of many other cases. I have plenty of these dependencies in my model. I tried to pass symbolic_u0 = true to the BifurcationProblem but nothing happened:
I’d suggest trying to make a complete, minimal example that demonstrates the problem you are having, and then opening an issue on ModelingToolkit.jl. It may be that the ModelingToolkit BifurcationKit extension needs some updates.
There was a relatively recent large MTK update (v10) which changed a bunch of stuff. I haven’t tried MTK v10 + BifurcationKit. However, if it is easy, a first quick check might be to try using MTK v9.
This set of errors means that you have an underconditioned initialization system due to picking initial conditions that are redundant. For example, take the system:
D(x) ~ 1
D(y) ~ y
x ~ z
There are two differential equations, so you need two initial conditions. But notice that if you choose x = 0, z = 0, while you technically satisfy the “correct number of equations” condition, because x = z giving an initial condition on x and z is redundant, so in practice you only gave 1 condition and thus it’s underconditioned.
So what’s going on here is that you probably have a redundant equation, and then you are missing a condition. And the missing condition is some kind of cycle, like:
D(x) ~ 1
x ~ y
y ~ z
z ~ x
but are then missing an initial condition. It’s trying to resolve the cycle: it knows that x, y, z all should have the same value, but it’s searching through and saying “well you didn’t give a condition on x, so go check y”, “well you didn’t give a condition on y, so go check z”, “well you didn’t give a condition on z, so go check x”, and it cycles for a bit until it gives this error. To resolve this circle, you need to make sure an initial condition is given to something in the cycle to break it, and then they will all be uniquely defined.
Without seeing your model it would be hard to give you more information, but that should put you in the right ballpark.