# Power Models Modification

**URL:** <https://discourse.julialang.org/t/power-models-modification/18874>\
**Category:** Optimization (Mathematical)\
**Created:** [December 21, 2018, 1:53am UTC](https://discourse.julialang.org/t/power-models-modification/18874 "2018-12-21T01:53:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rasoul](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@Rasoul](https://discourse.julialang.org/u/Rasoul)\
**Post date:** [December 21, 2018, 1:53am UTC](https://discourse.julialang.org/t/power-models-modification/18874/1 "2018-12-21T01:53:41Z")

</div>

Hi All,

I want to modify “buspair\_parameters” function in PowerModels.ji to store parameters of all lines (including parallel lines) in the “buspair” dictionary. In other words, I want to store the parameters of each line, including the parallel lines, in the “buspair” dictionary. I do know that some parameters such as bounds on angle differences are equal for parallel lines and not to be stored multiple times but I need them to be stored separately for a reason. Any help would be appreciated. Thanks in advance!

All the best,  
Rasoul

---

<div class="post-metadata">

**Author:** ![ccoffrin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ccoffrin/32/400_2.png) [@ccoffrin](https://discourse.julialang.org/u/ccoffrin)\
**Post date:** [December 21, 2018, 2:42am UTC](https://discourse.julialang.org/t/power-models-modification/18874/2 "2018-12-21T02:42:20Z")

</div>

I can’t see an easy way to extend the `buspair_parameters` function. What you can do is call your own function that adds extra data to `ref` after `build_ref` is called. The [PowerModelsACDC.jl](https://github.com/hakanergun/PowerModelsACDC.jl) package has a good example of such a solution, [PowerModelsACDC.jl/acdcopf.jl at master · hakanergun/PowerModelsACDC.jl · GitHub](https://github.com/hakanergun/PowerModelsACDC.jl/blob/master/src/prob/acdcopf.jl#L19)

You might also watch this this issue, [Extensions to build\_ref · Issue #263 · lanl-ansi/PowerModels.jl · GitHub](https://github.com/lanl-ansi/PowerModels.jl/issues/263), which at some point will provide a clean and standard way to extend `build_ref`.

---

<div class="post-metadata">

**Author:** ![Rasoul](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@Rasoul](https://discourse.julialang.org/u/Rasoul)\
**Post date:** [December 21, 2018, 4:12am UTC](https://discourse.julialang.org/t/power-models-modification/18874/3 "2018-12-21T04:12:55Z")

</div>

Thank you so much. I really appreciate it.
