Time Series #2504
Unanswered
RaymondYogo
asked this question in
Q&A
Time Series
#2504
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to get help with the time series. While the code is running successfully, I can't get the time series results in the specified folder. What could be the issue? Any assistance with this problem will be highly appreciated and noted with a lot of gratitude. The code is as written below. Thank you.
import os
import numpy as np
import pandas as pd
import tempfile
import random
import pandapower as pp
import matplotlib.pyplot as plt
import matplotlib_inline
from pandapower.timeseries import DFData
from pandapower.timeseries import OutputWriter
from pandapower.timeseries.run_time_series import run_timeseries
from pandapower.control import ConstControl
random.seed(10)
def simple_test_net():
def create_data_source(n_timesteps=24):
profiles = pd.DataFrame()
def create_controllers(net, ds):
ConstControl(net, element='load', variable='p_mw', element_index=[0],
data_source=ds, profile_name=["load1_p"])
ConstControl(net, element='sgen', variable='p_mw', element_index=[0],
data_source=ds, profile_name=["sgen1_p"])
def create_output_writer(net, time_steps, output_dir):
ow = OutputWriter(net, time_steps, output_path=output_dir, output_file_type=".xlsx", log_variables=list())
# these variables are saved to the harddisk after / during the time series loop
ow.log_variable('res_load', 'p_mw')
ow.log_variable('res_bus', 'vm_pu')
ow.log_variable('res_line', 'loading_percent')
ow.log_variable('res_line', 'i_ka')
return ow
output_dir = os.path.join(tempfile.gettempdir(), "results")
print("Results can be found in your local temp folder: {}".format(output_dir))
if not os.path.exists(output_dir):
os.mkdir(output_dir)
results(output_dir)
Beta Was this translation helpful? Give feedback.
All reactions