# Meaning of Incidence matrix?

**URL:** https://discourse.julialang.org/t/meaning-of-incidence-matrix/100141
**Category:** Modelling & Simulations
**Tags:** question, modelingtoolkit
**Created:** [June 10, 2023, 3:01pm UTC](https://discourse.julialang.org/t/meaning-of-incidence-matrix/100141 "2023-06-10T15:01:35Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [June 10, 2023, 3:01pm UTC](https://discourse.julialang.org/t/meaning-of-incidence-matrix/100141/1 "2023-06-10T15:01:35Z")

</div>

I defined a nonlinear model and linearized it. I get the following result:

```julia
julia> simplified_sys
Model sys with 3 equations
States (3):
  ω(t) [defaults to 1.04286]
  Uest(t) [defaults to 9.0]
  Pgc(t) [defaults to 2.46048e6]
Parameters (9):
  J [defaults to 4.047e7]
  Ku [defaults to 2.25e-7]
  λnom [defaults to 7.3]
⋮
Incidence matrix:3×6 SparseArrays.SparseMatrixCSC{Num, Int64} with 12 stored entries:
 × ⋅ × × ⋅ ⋅
 × × × ⋅ × ⋅
 × × × × ⋅ ×

```

What is the meaning and the relevance of the Incidence matrix?

---

<div class="post-metadata">

### Author: ![Dan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dan/32/42581_2.png) [@Dan](https://discourse.julialang.org/u/Dan)
#### Post date: [June 10, 2023, 8:52pm UTC](https://discourse.julialang.org/t/meaning-of-incidence-matrix/100141/2 "2023-06-10T20:52:52Z")

</div>

If any of the actual developers of this code choose to respond, they probably know better. But if-I-understand-correctly, the sparse incidence matrix shows how the new simplified state variables depend on the original state variables. So in the example above `ω(t)` would depend on 3 variables of the pre-simplified formulation. And the same applies to the other new variables.

---

<div class="post-metadata">

### Author: ![Keno](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/keno/32/285_2.png) [@Keno](https://discourse.julialang.org/u/Keno)
#### Post date: [June 11, 2023, 1:42am UTC](https://discourse.julialang.org/t/meaning-of-incidence-matrix/100141/3 "2023-06-11T01:42:52Z")

</div>

The incidence matrix a structural representation of which variables occur in which equations. The rows are the equations of the system, the columns are the variables.

---

<div class="post-metadata">

### Author: ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)
#### Post date: [June 11, 2023, 5:05am UTC](https://discourse.julialang.org/t/meaning-of-incidence-matrix/100141/4 "2023-06-11T05:05:45Z")

</div>

Thank you!
