# My system is overdetermined. Are there tools to find the culprit equation?

**URL:** https://discourse.julialang.org/t/my-system-is-overdetermined-are-there-tools-to-find-the-culprit-equation/119947
**Category:** Modelling & Simulations
**Tags:** question, modelingtoolkit
**Created:** [September 27, 2024, 10:31am UTC](https://discourse.julialang.org/t/my-system-is-overdetermined-are-there-tools-to-find-the-culprit-equation/119947 "2024-09-27T10:31:06Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)
#### Post date: [September 27, 2024, 10:31am UTC](https://discourse.julialang.org/t/my-system-is-overdetermined-are-there-tools-to-find-the-culprit-equation/119947/1 "2024-09-27T10:31:06Z")

</div>

Recently I’ve updated a very big project to the latest version of MTK. I now get this warning:

```julia
┌ Warning: Initialization system is overdetermined. 1 equations for 0 unknowns. 
Initialization will default to using least squares. To suppress this warning pass warn_initialize_determined = false. To make this warning into an error, pass fully_determined = true
└ @ ModelingToolkit C:\Users\datse\.julia\packages\ModelingToolkit\Vsl3C\src\systems\diffeqs\abstractodesystem.jl:1465

```

Are there tools to find the culprit equation somehow? My model is massive, with 50+ equations split over 5 files. Even though I am looking, it is very hard to find which one is overspecifying the system.

My code runs perfectly fine mind you - just like it used to run before I updated MTK. I am not really sure of the implications of this warning to be honest.

---

<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: [September 27, 2024, 3:18pm UTC](https://discourse.julialang.org/t/my-system-is-overdetermined-are-there-tools-to-find-the-culprit-equation/119947/2 "2024-09-27T15:18:37Z")

</div>

Check the initialization system, `equations(prob.f.initializationprob.f.sys)` and you’ll see what the extra equation is.

---

<div class="post-metadata">

### Author: ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)
#### Post date: [September 27, 2024, 4:27pm UTC](https://discourse.julialang.org/t/my-system-is-overdetermined-are-there-tools-to-find-the-culprit-equation/119947/3 "2024-09-27T16:27:05Z")

</div>

What’s `prob` supposed to be here? I am making an `ODESystem`, at which point I get the aforementioned warning, before making any `ODEProblem`. I can’t apply the code you cite for this system, it doesn’t have the fields.

If I then make `prob = ODEProblem(ssys, nothing, (0.0, Inf))`, I still can’t apply the code because I get

```julia
ODEProblem with uType Vector{Float64} and tType Float64. In-place: true
timespan: (0.0, Inf)
u0: 5-element Vector{Float64}:
  290.0
    1.0
 1200.0
  290.0
   11.0

julia> equations(prob.f.initializationprob.f.sys)
ERROR: type ODEFunction has no field initializationprob
Stacktrace:
 [1] getproperty(x::Function, f::Symbol)
   @ Base .\Base.jl:37
 [2] top-level scope
   @ REPL[15]:1

```

---

<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: [September 27, 2024, 4:36pm UTC](https://discourse.julialang.org/t/my-system-is-overdetermined-are-there-tools-to-find-the-culprit-equation/119947/4 "2024-09-27T16:36:27Z")

</div>

I’d need an MWE. If you aren’t creating the problem then it shouldn’t be creating the iniitalizaiton system.

---

<div class="post-metadata">

### Author: ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)
#### Post date: [October 1, 2024, 1:29pm UTC](https://discourse.julialang.org/t/my-system-is-overdetermined-are-there-tools-to-find-the-culprit-equation/119947/5 "2024-10-01T13:29:57Z")

</div>

Okay, I have found the solution. The answer is to use

```julia
equations(prob.f.initializeprob.f.sys)

```

on the created `ODEProblem` resulting from the `ODESystem`. Notice the typo `initializeprob` versus `initializationprob`.
