spine-tools / SpineOpt.jl

A highly adaptable modelling framework for multi-energy systems
https://www.tools-for-energy-system-modelling.org/
GNU General Public License v3.0
58 stars 14 forks source link

PTDF and LODF based load flow, slack penalties, group balance - [merged] #236

Closed spine-o-bot closed 3 years ago

spine-o-bot commented 3 years ago

In GitLab by @DillonJ on Apr 10, 2020, 12:46

_Merges jd_loadflow -> dev

A test input db for this merge is available here:

https://drive.google.com/open?id=1PtCgokfFop9vfbV6HeYCQE4zKxQ9hWVr

spine-o-bot commented 3 years ago

In GitLab by @DillonJ on Apr 14, 2020, 06:41

changed the description

spine-o-bot commented 3 years ago

In GitLab by @DillonJ on Apr 14, 2020, 06:42

changed the description

spine-o-bot commented 3 years ago

In GitLab by @DillonJ on Apr 14, 2020, 07:15

added 1 commit

Compare with previous version

spine-o-bot commented 3 years ago

In GitLab by @manuelma on Apr 15, 2020, 16:48

I suggest if commodity_physics(commodity=c) in (:commodity_physics_lodf, :commodity_physics_ptdf).

Also, please note that we don't put spaces around the equal sign when used to pass keyword arguments.

spine-o-bot commented 3 years ago

In GitLab by @manuelma on Apr 15, 2020, 16:54

This doesn't feel super efficient, I wonder if there's a better way to exclude nodes from the nodal balance...

spine-o-bot commented 3 years ago

In GitLab by @manuelma on Apr 15, 2020, 16:56

We avoid globals for both style and performance. Is it difficult to get rid of them?

spine-o-bot commented 3 years ago

In GitLab by @manuelma on Apr 15, 2020, 16:58

In general a see issues with style in this file. Please note that we put spaces after commas and around conditional operators, and also around the assignment operator.

spine-o-bot commented 3 years ago

In GitLab by @manuelma on Apr 15, 2020, 17:01

You always need to break after the first iteration? I suggest using c = first(indices(commodity_lodf_tolerance)) instead of a for loop.

spine-o-bot commented 3 years ago

In GitLab by @manuelma on Apr 15, 2020, 17:02

I suggest putting this in a function so run_spinemodel() stays as lean as possible. I'd like to be able to read along run_spinemodel rather quickly to get what's going on at a high level.

spine-o-bot commented 3 years ago

In GitLab by @DillonJ on Apr 15, 2020, 17:12

I agree that it's not particularly nice having this code at the start, but it's the most efficient way I could think of determining if a node is not in a node group with a certain parameter set, since it only has to check the node groups if it's in one to begin with...

What I wanted to avoid was having to set a parameter for each node which would be laborious for a user and would be depending on default values which I also wanted to avoid.

I am open to suggestion!

spine-o-bot commented 3 years ago

In GitLab by @DillonJ on Apr 15, 2020, 17:13

I can look into it, but it seemed awkward to me

spine-o-bot commented 3 years ago

In GitLab by @DillonJ on Apr 15, 2020, 17:13

Nice, this is the syntax I was looking for

spine-o-bot commented 3 years ago

In GitLab by @DillonJ on Apr 16, 2020, 07:25

changed this line in version 3 of the diff

spine-o-bot commented 3 years ago

In GitLab by @DillonJ on Apr 16, 2020, 07:25

changed this line in version 3 of the diff

spine-o-bot commented 3 years ago

In GitLab by @DillonJ on Apr 16, 2020, 07:25

changed this line in version 3 of the diff

spine-o-bot commented 3 years ago

In GitLab by @DillonJ on Apr 16, 2020, 07:25

changed this line in version 3 of the diff

spine-o-bot commented 3 years ago

In GitLab by @DillonJ on Apr 16, 2020, 07:25

added 1 commit

Compare with previous version

spine-o-bot commented 3 years ago

In GitLab by @DillonJ on Apr 16, 2020, 07:29

Globals removed in https://gitlab.vtt.fi/spine/model/-/commit/114d6b277302b93533db2aacb7eca06775d5c38c

spine-o-bot commented 3 years ago

In GitLab by @DillonJ on Apr 16, 2020, 07:29

Style issues corrected (I hope) in https://gitlab.vtt.fi/spine/model/-/commit/114d6b277302b93533db2aacb7eca06775d5c38c

spine-o-bot commented 3 years ago

In GitLab by @DillonJ on Apr 16, 2020, 07:30

Proposed changed adopted in: https://gitlab.vtt.fi/spine/model/-/commit/114d6b277302b93533db2aacb7eca06775d5c38c

spine-o-bot commented 3 years ago

In GitLab by @DillonJ on Apr 16, 2020, 07:30

Done in https://gitlab.vtt.fi/spine/model/-/commit/114d6b277302b93533db2aacb7eca06775d5c38c

spine-o-bot commented 3 years ago

In GitLab by @DillonJ on Apr 16, 2020, 07:31

This is the only issue I haven't addressed. While it does result in some code at the top of the constraint which, perhaps, isn't ideal, the code itself is efficient and means you only need to set a single parameter to activate group balance for a node group and I feel the trade-off is worth it.

spine-o-bot commented 3 years ago

In GitLab by @DillonJ on Apr 17, 2020, 05:46

added 7 commits

Compare with previous version

spine-o-bot commented 3 years ago

In GitLab by @DillonJ on Apr 17, 2020, 05:47

merged

spine-o-bot commented 3 years ago

In GitLab by @DillonJ on Apr 17, 2020, 05:47

mentioned in commit a5ba871b043aabdd1f2f2497ba2e0c94da869182