# PowerModels/PowerModelsDistribution lack of documentation for storage models

**URL:** <https://discourse.julialang.org/t/powermodels-powermodelsdistribution-lack-of-documentation-for-storage-models/85358>\
**Category:** Optimization (Mathematical)\
**Tags:** package\
**Created:** [August 5, 2022, 5:15pm UTC](https://discourse.julialang.org/t/powermodels-powermodelsdistribution-lack-of-documentation-for-storage-models/85358 "2022-08-05T17:15:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![apigott](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/apigott/32/38583_2.png) [@apigott](https://discourse.julialang.org/u/apigott)\
**Post date:** [August 5, 2022, 5:15pm UTC](https://discourse.julialang.org/t/powermodels-powermodelsdistribution-lack-of-documentation-for-storage-models/85358/1 "2022-08-05T17:15:43Z")

</div>

Hi! New to PM/PMD and currently trying to figure out the OPF with a storage model, unfortunately I’m getting pretty stumped by the results dictionary.

I attempted adding storage with the following:

```julia
case_file = "../PowerModelsDistribution.jl/examples/resources/lvtestcase_notrans.dss"
data_eng = PMD.parse_file(case_file, transformations=[PMD.remove_all_bounds!])
data_eng["storage"][string(e)] = Dict{String, Any}(
			"status"=>PMD.ENABLED,
			"bus"=>bus_e[e],
			"connections"=>[phase_e[e], 4],
			"configurations"=>PMD.WYE,
			"energy"=>50,
			"qs_ub"=>10,
			"qs_lb"=>-10,
			"energy_ub"=>100,
			"charge_ub"=>20,
			"discharge_ub"=>20,
			"charge_efficiency"=>0.97,
			"discharge_efficiency"=>0.95,
			"rs"=>1,
			"xs"=>1,
			"pex"=>0.1,
			"qex"=>0.1,
			"cm_ub"=>10,
			"sm_ub"=>20,
			"dispatchable"=>Dispatchable
		  )
res = solve_mc_opf(data_eng, ACPUPowerModel, Ipopt.Optimizer, setting=Dict("output"=>Dict("duals"=>true)))

```

However the output I’m getting from `res["solution"]["storage"][string(e)]` doesn’t make sense to me. I can guess that ps is the real power from the storage device, qs the reactive power but I have no idea how to parse se, sd, sc, qsc, etc. My guess was originally that se was stored energy but in that case the values (kWh) and (kW from ps) don’t align.

I would _greatly_ appreciate any pointers towards docs that cover this if they exist.

Tacking on another topic since we’re here: any documentation on the connections? I assume it’s [phase,neutral]?

---

<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:** [August 5, 2022, 10:01pm UTC](https://discourse.julialang.org/t/powermodels-powermodelsdistribution-lack-of-documentation-for-storage-models/85358/2 "2022-08-05T22:01:17Z")

</div>

This is a question for @ccoffrin

---

<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:** [August 6, 2022, 12:06am UTC](https://discourse.julialang.org/t/powermodels-powermodelsdistribution-lack-of-documentation-for-storage-models/85358/3 "2022-08-06T00:06:23Z")

</div>

Hi @apigott nice to hear from you!

I can only comment on PowerModels and I will leave it to @pseudocubic to comment on PowerModelsDistribution.

At a high level the storage model we implement is discussed in this report, [[2004.14768] A Flexible Storage Model for Power Network Optimization](https://arxiv.org/abs/2004.14768)

For single phase networks the details of the model are documented here, [Storage Model · PowerModels](https://lanl-ansi.github.io/PowerModels.jl/stable/storage/)

The code that generates the results from the paper is archived here, [GitHub - lanl-ansi/energy-storage-example: An example of energy storage optimization using PowerModels](https://github.com/lanl-ansi/energy-storage-example)

but this code may not have not been updated to the latest version of the packages, but should work with the versions specified in the `toml` files.

---

<div class="post-metadata">

**Author:** ![apigott](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/apigott/32/38583_2.png) [@apigott](https://discourse.julialang.org/u/apigott)\
**Post date:** [August 8, 2022, 4:58pm UTC](https://discourse.julialang.org/t/powermodels-powermodelsdistribution-lack-of-documentation-for-storage-models/85358/4 "2022-08-08T16:58:32Z")

</div>

Thanks so much for the detailed response. I must be going blind because I missed the params and description for storage devices in PMD [here](https://lanl-ansi.github.io/PowerModelsDistribution.jl/stable/manual/eng-data-model.html#Storage-(storage)).

Thanks
