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

[FEATURE] Graphical Demonstration of Relative_Loading on dash_plot #304

Closed
batuhansanliii opened this issue Sep 18, 2022 · 2 comments
Closed
Assignees

Comments

@batuhansanliii
Copy link

The relative loading of lines on the graph is depicted based on the following calculation:

eDisGo/edisgo/tools/plots.py

Lines 1219 to 1226 in 9fae3ea

elif line_color == "relative_loading":
loading = s_res.loc[branch_name]
s_nom = edisgo_obj.topology.lines_df.s_nom.loc[branch_name]
color = color_map_color(
loading / s_nom * 0.9,
vmin=color_min,
vmax=color_max,
cmap_name=colorscale,

However, the calculation of relative_loading of the lines is done as follows:

def lines_relative_load(edisgo_obj, lines_allowed_load):
"""
Calculates relative line load based on specified allowed line load.
Parameters
----------
edisgo_obj : :class:`~.EDisGo`
lines_allowed_load : :pandas:`pandas.DataFrame<DataFrame>`
Dataframe containing the maximum allowed current per line and time step
in kA. Index of the dataframe are time steps of type
:pandas:`pandas.Timestamp<Timestamp>` and columns are line names.
Returns
--------
:pandas:`pandas.DataFrame<DataFrame>`
Dataframe containing the relative line load per line and time step.
Index and columns of the dataframe are the same as those of parameter
`lines_allowed_load`.
"""
# get line load from power flow analysis
i_lines_pfa = edisgo_obj.results.i_res.loc[
lines_allowed_load.index, lines_allowed_load.columns
]
return i_lines_pfa / lines_allowed_load

As you can see from the example in the attached ipynb. file, the relative loading of example branch is bigger than 1 but shown smaller than 1 on the graph

Relative loading_dash plot.ipynb.zip

@batuhansanliii batuhansanliii changed the title [BUG] Graphical Demonstration of Relative_Loading on dash_plot [FEATURE] Graphical Demonstration of Relative_Loading on dash_plot Sep 18, 2022
@birgits
Copy link
Collaborator

birgits commented Sep 19, 2022

I think you are still using an old branch, as the plotting function is now called plot_dash(). Please pull the current dev into your branch. But anyways, you are right, it is currently not quite consistent. In PR #290 I am working on this. However, your bug should be fixed already on dev.

@batuhansanliii
Copy link
Author

I updated the branch. Now it is better working.
Thank you

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

No branches or pull requests

3 participants