# PowerModels Timeseries Simulation

**URL:** <https://discourse.julialang.org/t/powermodels-timeseries-simulation/122615>\
**Category:** Optimization (Mathematical)\
**Tags:** question, package, power-flow\
**Created:** [November 14, 2024, 2:05am UTC](https://discourse.julialang.org/t/powermodels-timeseries-simulation/122615 "2024-11-14T02:05:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![PB-vines](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pb-vines/32/213401_2.png) [@PB-vines](https://discourse.julialang.org/u/PB-vines)\
**Post date:** [November 14, 2024, 2:05am UTC](https://discourse.julialang.org/t/powermodels-timeseries-simulation/122615/1 "2024-11-14T02:05:22Z")

</div>

Hello,

I am new to PowerModels and looking forward to learning more.  
I have a power network, along with generation data and renewable energy resource data. I want to run this grid for at least 1 day at hourly intervals using the load and generation data.  
Is there a feature I am missing that easily allows timeseries options, or will this be a more manual endeavor?

Thanks,  
Jasmine

---

<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:** [November 14, 2024, 2:23am UTC](https://discourse.julialang.org/t/powermodels-timeseries-simulation/122615/2 "2024-11-14T02:23:20Z")

</div>

Hi @PB-vines, welcome to the forum 😄

PowerModels.jl is intended for static single-period power flow problems.

There is some very limited support for “multi-networks” which could include time-series: [Multi Networks · PowerModels](https://lanl-ansi.github.io/PowerModels.jl/stable/multi-networks/)

The big question is whether you want to solve the problem is a single monolithic optimization problem with all 24 hourly intervals, or whether you want to implement some sort of decomposition approach, such as a rolling-horizon.

For rolling horizon problems, see: [Rolling horizon problems · JuMP](https://jump.dev/JuMP.jl/stable/tutorials/algorithms/rolling_horizon/)

PowerSimulations.jl is a package that builds upon PowerModels.jl to perform exactly the sort of simulations you want. See their documentation at [Welcome Page · PowerSimulations.jl](https://nrel-sienna.github.io/PowerSimulations.jl/latest/)

The correct approach depends quite heavily on your intended use-case. How big is the network? What format is the input data in? etc.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [November 15, 2024, 9:22am UTC](https://discourse.julialang.org/t/powermodels-timeseries-simulation/122615/3 "2024-11-15T09:22:45Z")

</div>

You might be looking for PowerSimulationsDynamics.jl which does the dynamic simulations?

[https://nrel-sienna.github.io/PowerSimulationsDynamics.jl/stable/quick\_start\_guide/](https://nrel-sienna.github.io/PowerSimulationsDynamics.jl/stable/quick_start_guide/)

---

<div class="post-metadata">

**Author:** ![PB-vines](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pb-vines/32/213401_2.png) [@PB-vines](https://discourse.julialang.org/u/PB-vines)\
**Post date:** [February 24, 2025, 9:19pm UTC](https://discourse.julialang.org/t/powermodels-timeseries-simulation/122615/4 "2025-02-24T21:19:12Z")

</div>

Is there a straightforward way to convert a powermodels network to a powersimulations network - or a matpower network to a powersimulations network? my network has 897 buses so looking for an automated way to do this. Thanks!

---

<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:** [February 24, 2025, 10:58pm UTC](https://discourse.julialang.org/t/powermodels-timeseries-simulation/122615/5 "2025-02-24T22:58:42Z")

</div>

See [...parse data from MATPOWER or PSS/e files · PowerSystems.jl](https://nrel-sienna.github.io/PowerSystems.jl/stable/how_to/parse_matpower_psse/)

---

<div class="post-metadata">

**Author:** ![PB-vines](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pb-vines/32/213401_2.png) [@PB-vines](https://discourse.julialang.org/u/PB-vines)\
**Post date:** [February 27, 2025, 5:55am UTC](https://discourse.julialang.org/t/powermodels-timeseries-simulation/122615/6 "2025-02-27T05:55:20Z")

</div>

That is great, thank you so much! I have managed to get the network imported and everything. I think my last question - I have tried a few ways below to import load and solar data from csv and add to my system. I have over 200 load buses, so I do not want to do this manually - the data is hourly for one year. Do you see off-hand what I am doing incorrectly?

load\_data = CSV.read(“load\_time\_series\_MW.csv”, DataFrame)

solar\_data = CSV.read(“renewable\_time\_series\_MW.csv”, DataFrame)

load\_buses = names(load\_data)[contains.(names(load\_data), “MW”)] # Find all MW columns for load  
solar\_buses = names(solar\_data)[contains.(names(solar\_data), “608”)] # Find all 608xxxx columns for solar

# Create time series dictionaries for loads and solar

# # For load timeseries

# load\_timeseries\_dict = Dict(

# bus =\> ActivePowerTimeSeriesParameter(load\_data[:, bus]) for bus in load\_buses

# )

# # For solar timeseries

# solar\_timeseries\_dict = Dict(

# bus =\> ActivePowerTimeSeriesParameter(solar\_data[:, bus]) for bus in solar\_buses

# )

# Now combine them into a container

# timeseries\_container = Dict(

# :load =\> load\_timeseries\_dict,

# :solar =\> solar\_timeseries\_dict

# )

timeseries\_container = Dict(  
:load =\> Dict(bus\_symbols[i] =\> load\_timeseries[:, i] for i in 1:length(bus\_symbols)),  
:solar =\> Dict(solar\_symbols[i] =\> solar\_timeseries[:, i] for i in 1:length(solar\_symbols))

)

bus\_symbols = [Symbol(replace(col, " " =\> “_", “#” =\> “”)) for col in load\_columns]  
solar\_symbols = [Symbol(replace(col, " " =\> "_”, “#” =\> “”)) for col in solar\_columns]

# Create the time series container mapping buses to their time series

timeseries\_container = Dict(  
:load =\> Dict(bus\_symbols[i] =\> load\_timeseries[:, i] for i in 1:length(bus\_symbols)),  
:solar =\> Dict(solar\_symbols[i] =\> solar\_timeseries[:, i] for i in 1:length(solar\_symbols))

)

# Now attach the time series to the system ‘sys’

set\_time\_series!(sys, timeseries\_container)
