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

Variable Cost Refactor Part 2: PowerSimulations #1061

Merged
merged 6 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 28 additions & 13 deletions docs/src/formulation_library/General.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,38 +56,53 @@ No constraints are created for `DeviceModel(<:DeviceType, FixedOutput)`

---

## `VariableCost` Options
## `FunctionData` Options

PowerSimulations can represent variable costs using a variety of different methods depending on the data available in each device. The following describes the objective function terms that are populated for each variable cost option.

### Scalar `VariableCost`
### `LinearFunctionData`

`variable_cost <: Float64`: creates a fixed marginal cost term in the objective function
`variable_cost = LinearFunctionData(c)`: creates a fixed marginal cost term in the objective function

```math
\begin{aligned}
& \text{min} \sum_{t} C * G_t
& \text{min} \sum_{t} c * G_t
\end{aligned}
```

### Polynomial `VariableCost`
### `QuadraticFunctionData` and `PolynomialFunctionData`

`variable_cost <: Tuple{Float64, Float64}`: creates a polynomial cost term in the objective function where

- ``C_g``=`variable_cost[1]`
- ``C_g^\prime``=`variable_cost[2]`
`variable_cost::QuadraticFunctionData` and `variable_cost::PolynomialFunctionData`: create a polynomial cost term in the objective function

```math
\begin{aligned}
& \text{min} \sum_{t} C * G_t + C^\prime * G_t^2
& \text{min} \sum_{t} \sum_{n} C_n * G_t^n
\end{aligned}
```

### Piecewise Linear `VariableCost`
where

- For `QuadraticFunctionData`:
- ``C_0`` = `get_constant_term(variable_cost)`
- ``C_1`` = `get_proportional_term(variable_cost)`
- ``C_2`` = `get_quadratic_term(variable_cost)`
- For `PolynomialFunctionData`:
- ``C_n`` = `get_coefficients(variable_cost)[n]`

### `PiecewiseLinearPointData` and `PiecewiseLinearSlopeData`

`variable_cost::PiecewiseLinearPointData` and `variable_cost::PiecewiseLinearSlopeData`: create a piecewise linear cost term in the objective function

```math
\begin{aligned}
& \text{min} \sum_{t} f(G_t)
\end{aligned}
```

`variable_cost <: Vector{Tuple{Float64, Float64}}`: creates a piecewise linear cost term in the objective function
where

TODO: add formulation
- For `variable_cost::PiecewiseLinearPointData`, ``f(x)`` is the piecewise linear function obtained by connecting the `(x, y)` points `get_points(variable_cost)` in order.
- For `variable_cost = PiecewiseLinearSlopeData([x0, x1, x2, ...], y0, [s0, s1, s2, ...])`, ``f(x)`` is the piecewise linear function obtained by starting at `(x0, y0)`, drawing a segment at slope `s0` to `x=x1`, drawing a segment at slope `s1` to `x=x2`, etc.

___

Expand Down
4 changes: 2 additions & 2 deletions docs/src/formulation_library/Load.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ mdtable(combo_table, latex = false)

**Objective:**

Creates an objective function term based on the [`VariableCost` Options](@ref) where the quantity term is defined as ``Pg``.
Creates an objective function term based on the [`FunctionData` Options](@ref) where the quantity term is defined as ``Pg``.

**Expressions:**

Expand Down Expand Up @@ -143,7 +143,7 @@ mdtable(combo_table, latex = false)

**Objective:**

Creates an objective function term based on the [`VariableCost` Options](@ref) where the quantity term is defined as ``Pg``.
Creates an objective function term based on the [`FunctionData` Options](@ref) where the quantity term is defined as ``Pg``.

**Expressions:**

Expand Down
4 changes: 2 additions & 2 deletions docs/src/formulation_library/RenewableGen.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ mdtable(combo_table, latex = false)

**Objective:**

Creates an objective function term based on the [`VariableCost` Options](@ref) where the quantity term is defined as ``- Pg_t`` to incentivize generation from `RenewableGen` devices.
Creates an objective function term based on the [`FunctionData` Options](@ref) where the quantity term is defined as ``- Pg_t`` to incentivize generation from `RenewableGen` devices.

**Expressions:**

Expand Down Expand Up @@ -113,7 +113,7 @@ mdtable(combo_table, latex = false)

**Objective:**

Creates an objective function term based on the [`VariableCost` Options](@ref) where the quantity term is defined as ``- Pg_t`` to incentivize generation from `RenewableGen` devices.
Creates an objective function term based on the [`FunctionData` Options](@ref) where the quantity term is defined as ``- Pg_t`` to incentivize generation from `RenewableGen` devices.

**Expressions:**

Expand Down
Loading
Loading