Spores mode math¶
Pre-defined mode math to apply SPORES mode math on top of the base mathematical formulation.
This math is only applied when config.build.mode is set to "spores".
A guide to math documentation¶
If a math component's initial conditions are met (the first if statement), it will be applied to a model.
For each objective, constraint and global expression, a number of sub-conditions then apply (the subsequent, indented if statements) to decide on the specific expression to apply at a given iteration of the component dimensions.
In the expressions, terms in bold font are decision variables and terms in italic font are parameters.
The decision variables and parameters are listed at the end of the page; they also refer back to the global expressions / constraints in which they are used.
Those parameters which are defined over time (timesteps) in the expressions can be defined by a user as a single, time invariant value, or as a timeseries that is loaded from file or dataframe.
Note
For every math component in the documentation, we include the YAML snippet that was used to generate the math in a separate tab.
Download the spores mode math formulation as a YAML file
Objective¶
min_spores (inactive)¶
NEW SPORES score minimisation objective, activated for all iterations after the baseline optimisation. The SPORES scores are applied to flow capacity for each technology at each node.
description: "NEW\nSPORES score minimisation objective, activated for all iterations
after the baseline optimisation. The SPORES scores are applied to flow capacity
for each technology at each node."
equations:
- expression: sum(flow_cap * spores_score, over=[nodes, techs, carriers]) +
$unmet_demand
sub_expressions:
unmet_demand:
- expression: "sum(\n sum(unmet_demand - unused_supply, over=[carriers, nodes])\n\
\ * timestep_weights,\n over=timesteps\n) * bigM"
sense: minimise
Subject to¶
total_system_cost_max¶
NEW Limit total system cost in SPORES mode. Applies a maximum relaxation to the system cost compared to the least-cost objective function value.
description: "NEW\nLimit total system cost in SPORES mode. Applies a maximum relaxation
to the system cost compared to the least-cost objective function value.\n"
equations:
- where: any(cost, over=[nodes, techs, costs])
expression: "sum(\n sum(cost, over=[nodes, techs])\n * objective_cost_weights,\n\
\ over=costs\n) + $unmet_demand <= spores_baseline_cost * (1 + spores_slack)"
- where: NOT any(cost, over=[nodes, techs, costs])
expression: $unmet_demand <= spores_baseline_cost * (1 + spores_slack)
sub_expressions:
unmet_demand:
- expression: "sum(\n sum(unmet_demand - unused_supply, over=[carriers, nodes])\n\
\ * timestep_weights,\n over=timesteps\n) * bigM"
Postprocessed Statistics¶
spores_baseline_cost_tracked¶
NEW Track SPORES baseline cost to include in the model results
Uses
Unit: cost
Default: inf
spores_score_cumulative¶
NEW Track SPORES score to include in the model results
Uses
Unit: unitless
Default: 0
Parameters¶
bigM¶
BigM is a large value used to define certain optimisation problems. See https://en.wikipedia.org/wiki/Big_M_method for more information. This value should be larger than the largest values that any decision variables can take, but should not be too large (i.e., do not set it greater than 3 orders of magnitude above the numeric range of the model). If too large, numerical problems may arise in the optimisation.
Used in
Unit: unitless
Default: 1000000.0
objective_cost_weights¶
Weightings for cost classes to apply in the objective function.
Used in
Unit: unitless
Default: 1
spores_baseline_cost¶
The baseline optimal cost of the system used to set the maximum cost constraint when undertaking SPORES analysis. This usually only applies to monetary cost, but could be applied to other non-SPORES costs as necessary.
Unit: cost
Default: inf
spores_score¶
The per-tech & per-node SPORES score used to penalise technologies at nodes that have appeared in previous SPORES iterations.
Used in
Unit: unitless
Default: 0
spores_slack¶
The amount of slack in the maximum cost constraint applied in SPORES mode. This is a fraction that is applied to the baseline cost, e.g., 0.1 would be used to set a maximum cost constraint of spores_baseline_cost * 1.1
Used in
Unit: unitless
Default: 0
timestep_weights¶
Used in
Unit: unitless.
Default: 1