calliope-project / calliope

A multi-scale energy systems modelling framework
https://www.callio.pe
Apache License 2.0
287 stars 93 forks source link

Wrong "in domain" symbol #652

Closed sstroemer closed 1 week ago

sstroemer commented 1 month ago

Description

domain: integer is rendered as $\forall \mathbb{Z}$, instead of, e.g., $\in \mathbb{Z}$, similar for the variables not having an explicit domain, which show $\forall \mathbb{R}$.

Related links

Version

latest (48148b814a8ba0cd64fa9b48decff4b5b60eb0d7)

Proposed change

No response

brynpickering commented 1 month ago

Thanks, yeah this was the wrong notation. Is there an agreed notation for domains in defining decision variables in optimisation problems? If it is e.g., ∈ Z, happy to go with that.

sstroemer commented 1 month ago

Some references:


In the end it does not really matter as long as it's clear, alternative ways that I can think of right now are:

Most of them however do not explicitly state what's happening, e.g., $x$ may be complex valued, and $foo \in X$ is immediately clear for any $X$ (and also allows more complex formulations, like conic programming, etc.).

brynpickering commented 1 month ago

Maybe $\in \mathbb{Z}$ and $\in \mathbb{R}$? We don't have binary variables, only integer ones that can be limited to a maximum of 1 using a parameter. So it'll only be "in set of integers" or "in set of all reals".

sstroemer commented 1 month ago

Maybe ∈ Z and ∈ R ? We don't have binary variables, only integer ones that can be limited to a maximum of 1 using a parameter. So it'll only be "in set of integers" or "in set of all reals".

Sounds great! Maybe (don't know if that is possible) adding the variable before that helps with readability?

For example (async_flow_switch) instead of:

\begin{aligned}
& \forall \text{node} \in \text{nodes}, \text{tech} \in \text{techs}, \text{timesteps} \in \text{timesteps} \\
& \in \mathbb{Z}: \\
& \\
& \dots \quad \text{actual content} \quad \dots
\end{aligned}

is the following (or something similar) possible?

\begin{aligned}
& \forall \text{node} \in \text{nodes}, \text{tech} \in \text{techs}, \text{timesteps} \in \text{timesteps}: \\
& \\
& async\_flow\_switch_{\text{node},\text{tech},\text{timestep}} \in \mathbb{Z} \\
& \\
& \dots \quad \text{actual content} \quad \dots
\end{aligned}