Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Energy Storage #16

Closed
Aliadavid opened this issue Sep 6, 2023 · 2 comments
Closed

Energy Storage #16

Aliadavid opened this issue Sep 6, 2023 · 2 comments

Comments

@Aliadavid
Copy link

How to add energy storage based time series OPF test

@juanjospina
Copy link
Collaborator

juanjospina commented Sep 6, 2023

Hi @Aliadavid,

This question has two main answers, a short one and a slightly longer one. I will start with the short answer.

Short Answer:

You can run time-series (in our terminology - multi-network) OPF problems with energy storage by:

  1. adding your energy storage normally to your distribution system in your opendss file, see example below:
!Battery System DEFINITIONS
! Parameters Info.: %charge and %discharge are relative to kwrated
! roundtrip eff =  %effcharge x %effdischarge
! Storage 1
New Storage.S1 phases=3 bus1=R1-12-47-3_meter_18.1.2.3 kV=0.48 conn=wye %charge=100 %discharge=100 kwhstored=0
~ kwrated=200 kwhrated=200 %effcharge=99 %effdischarge=99 %idlingkw=1

Note: Since PowerModelsITD is based on PowerModelsDistribution, you can check the parameters supported for the energy storage here and in the OpenDSS manual.

  1. Run a multinetwork case (as shown here). Essentially, you just need to add a .csv file(s) for load/solar profiles to your opendss files. The energy storage should be present in the model, however it will have a zero cost.

Slightly Longer Answer:

What happens if you want to add costs to the use of your energy storage?

Right, now vanilla PowerModelsITD does not supports this directly, but we are working on it and we have experimental code that implements it. If enough interest is gathered in the future, we will merge it to the main repository.

If you are interested in this, you can check out the experimental branch add-energystorage-costs: https://github.com/juanjospina/PowerModelsITD.jl/tree/add-energystorage-costs.

Using this branch, you only need to add the following code when setting up the problem.

pmitd_data = parse_files(pm_file, pmd_files, pmitd_file; multinetwork=true)

......


# cost of using the energy storage
# Units of this cost must be $/pu ($/pu x 1pu/Sbase(100MVA) = $/MWh)
strg_cost1 = 0.001 
# add cost to storages in PMD
for (nw_id, nw_data) in pmitd_data["it"]["pmd"]["nw"]
    for (st_name, st_data) in nw_data["storage"]
        if(st_name == "cktr13.s1")
            st_data["cost"] = strg_cost1
        end
    end
end

eng2math_passthrough = Dict("storage"=>["cost"])

......

result = solve_model(pmitd_data, NLPowerModelITD{ACRPowerModel, ACRUPowerModel}, ipopt, build_mn_opfitd_storage; multinetwork=true, eng2math_passthrough=eng2math_passthrough)

In this code, we are adding a cost to energy storage named s1 from distribution network cktr13. See how we added
(in this branch) a new method called: build_mn_opfitd_storage. This problem formulation has an objective function that takes into account when the energy storage is charged and discharged, and gives a cost when the energy storage is discharged.

@juanjospina
Copy link
Collaborator

closing Issue for inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants