# DC load flow constraint

**URL:** <https://discourse.julialang.org/t/dc-load-flow-constraint/80564>\
**Category:** Optimization (Mathematical)\
**Created:** [May 5, 2022, 7:53pm UTC](https://discourse.julialang.org/t/dc-load-flow-constraint/80564 "2022-05-05T19:53:02Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [May 5, 2022, 8:31pm UTC](https://discourse.julialang.org/t/dc-load-flow-constraint/80564/2 "2022-05-05T20:31:15Z")

</div>

I’m going to suggest the same things as your other question [Renewable generation constraint](https://discourse.julialang.org/t/renewable-generation-constraint/80526).

```julia
incidence = [1 -1 0 0; 0 1 -1 0; 0 1 0 -1; 1 0 0 -1]

```

This is a Matrix. You index it as `incidence[row, column]`.

> `sum(incidence[z][l] * vVoltag`

But here you indexed it as `incidence[z][l]`. It should probably be `incidence[z, l]`.

Since both questions have been small typos, you should carefully checking each part of what you write.

---

_[View the full topic](https://discourse.julialang.org/t/dc-load-flow-constraint/80564)._
