Skip to content

Instantly share code, notes, and snippets.

@lucassm
Last active March 21, 2024 13:59
Show Gist options
  • Save lucassm/00b61585936efa67a4447f52b5f3279f to your computer and use it in GitHub Desktop.
Save lucassm/00b61585936efa67a4447f52b5f3279f to your computer and use it in GitHub Desktop.
Execução de fluxo de carga e criação de data-frame com valores absolutos aplicados para cada passo de tempo
# In this case the p_mw load parameter will be stored for all time steps
# Another data can be stored too, because the power flow is been runned
# for every time step
absolute_values_dict = sb.get_absolute_values(net, profiles_instead_of_study_cases=True)
time_steps = range(96)
# run the time series and store load p_mw parameter
# into the time_results DataFrame
time_results = pd.DataFrame([],
index = time_steps,
columns = net.load.name[:]) # columns = net.load.index
for time_step in tqdm(time_steps):
apply_absolute_values(net, absolute_values_dict, time_step)
pp.runpp(net)
time_results.loc[time_step, :] = net.res_load.p_mw.values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment