The rows of the LP: the objective, the core equations in full, and every equation of the model by the brick that generates it
PDF, A4, 2 pages · energyRt 0.91.5.9019 (dev) · 2026-12-05eqObjective the discounted total cost, minimised
vTotalCost |
the cost of a region in a milestone year, undiscounted: eqCost adds every cost variable into it |
pPeriodLen |
the years the milestone stands for |
pDiscountFactor |
the discount factor of the year |
pObjWeight |
the weight of the region, 1 by default |
Every other equation is a constraint. "Equation" is used here for any row of the model, equality or inequality, as in the eq… names; elsewhere such rows are called constraints. The terms of eqCost are written out on the Variables sheet.
eqTechAfUp Technology availability factor upper bound for h, r, y, t in meqTechAfUp
\(\psi_{2} := \texttt{mWeatherRegionAt}_{\texttt{weather},\texttt{region},\texttt{regionp}}\)
\(\psi_{3} := \texttt{mTimesliceParentChildE}_{\texttt{timeslicepp},\texttt{timeslice}}\)
eqTechAfUp |
the name: eq + the brick + its role; …Lo, …Up, …Fx are bounds |
for h, r, y, t |
one row of the LP per technology, region, year and timeslice |
in meqTechAfUp |
only for the combinations the map lists: without a map row there is no equation |
| bold | a variable (a column of the LP); sans is a parameter, mono a map |
| ψ | a condition on a term or a sum, written separately; the equations below are shown without conditions |
Indices: h technology, s storage, c commodity, r region, y year, t timeslice, w weather; a p marks a second index of the same set (yp, tp).
The equations are fixed; the data determine which rows exist. A brick adds members to the sets and rows to the maps, and each equation is written only where its map has a row.
| technology | eqTech… |
conversion, availability, capacity, costs |
| storage | eqStorage… |
level, charge and discharge, three capacities |
| trade |
eqTrade…, eq…Ir…
|
flows, line capacity, costs |
| supply, demand |
eqSup…, eqDemInp
|
availability, reserve, demand met |
| import, export | eq…Row… |
limits and costs with the rest of the world |
| commodity |
eqBal…, eq…Tot
|
the balance and its totals |
| model |
eqCost, eqObjective
|
costs summed and discounted |
A wind farm without af.lo has no eqTechAfLo row; a model without storage has no eqStorage… equations. Custom constraints (newConstraint()) add equations of their own, per scenario.
eqTechActSng activity to output: the efficiency for h, c, r, y, t in meqTechActSng
eqTechAfUp activity within the available capacity for h, r, y, t in meqTechAfUp
eqTechCap capacity = stock + new capacity still in operation for h, r, y in mTechSpan
eqTechNewCapUp new capacity and its bound: both per year for h, r, y in mTechNewCapUp
eqTechFixom Technology fixed costs for h, r, y in mTechFixom
eqTechRampUp Technology ramp up for h, r, y, t, tp in mTechRampUp
eqStorageLevel the level, from one timeslice to the next for s, c, r, y, tp, t in meqStorageLevel
eqStorageOutLevel Storage output limited by the level for s, c, r, y, t in mvStorageLevel
eqStorageDurationUp energy capacity against power capacity for s, r, y in mStorageDurationUp
eqStorageOutCap discharge capacity; charging and energy capacity alike for s, r, y in mStorageOutCap
library(multimod)
mm <- multimod_from_energyRt(scen)
eq <- mm$equations$eqTechCap
cat(as_latex(eq, model = mm))
write_latex(mm, "model.tex")
scen is an interpolated scenario. as_latex() typesets one equation; write_latex() writes the whole model, with sets, parameters, variables and conditions.eqSupAvaUp Supply availability upper bound for u, c, r, y, t in mSupAvaUp
eqDemInp demand is met for c, r, y, t in mvDemInp
eqTradeIrAfUp flow within the line capacity for z, c, rs, rd, y, t in meqTradeIrAfUp
eqSupReserve Cumulative supply (use of reserve) for u, c, r in mvSupReserve
eqSupCost Supply costs for u, r, y in mvSupCost
eqTradeCapFlow Trade capacity to activity for z, c, y, t in meqTradeCapFlow
eqBal Commodity balance for c, r, y, t in mvBalance
eqOutTot everything that supplies a commodity; eqInpTot everything that takes it for c, r, y, t in mvOutTot
eqBalFx no excess, no deficit (…Lo: excess allowed, …Up: deficit allowed) for c, r, y, t in meqBalFx
eqEmsFuelTot emissions from fuels used for c, r, y, t in mEmsFuelTot
eqDummyImportCost |
Dummy import costs (weighted) |
eqDummyExportCost |
Dummy export costs (weighted) |
eqTaxCost |
Levy taxes (weighted) |
eqSubsCost |
Levy subsidy (weighted) |
eqCost |
Total costs (weighted) |
eqObjective |
Objective equation NPV of total costs |
eqTotalUserCosts |
total user-defined costs |
eqTechSng2Sng |
Input to output |
eqTechGrp2Sng |
Group input to output |
eqTechSng2Grp |
Input to group output |
eqTechGrp2Grp |
Group input to group output |
eqTechShareInpLo/Fx/Up |
Bound on input share |
eqTechShareOutLo/Fx/Up |
Bound on output share |
eqTechAInp |
Auxiliary commodity input |
eqTechAOut |
Auxiliary commodity output |
eqTechAfLo/Up/Fx |
Availability factor bounds |
eqTechAfsLo/Fx/Up |
Availability factor for sum of timeslices bounds |
eqTechRampUp |
Ramp up |
eqTechRampDown |
Ramp down |
eqTechActSng |
Activity to commodity output |
eqTechActGrp |
Activity to group output |
eqTechAfcOutLo/Fx/Up |
Commodity availability factor bounds |
eqTechAfcInpLo/Fx/Up |
Commodity availability factor bounds |
eqTechCap |
Capacity |
eqTechCapLo/Fx/Up |
Capacity bounds |
eqTechNewCapLo/Fx/Up |
Bound on new capacity |
eqTechStockCap |
Recursive balance of the legacy fleet |
eqTechStockPhaseOut |
Legacy capacity leaving on the exogenous schedule |
eqTechRetiredNewCap |
Retirement of new capacity |
eqTechRetLo/Fx/Up |
Bound on economic retirement of capacity |
eqTechEac |
Equivalent Annual Cost (EAC) |
eqTechInv |
Overnight investment costs |
eqTechFixom |
Fixed costs |
eqTechVarom |
Variable costs |
eqTechRetCost |
Costs of retired capacity of technology |
eqTechPhaseOut |
Capacity reaching the end of its operational life |
eqTechInpTot |
Total input |
eqTechOutTot |
Total output |
eqStoragePhaseOut |
Capacity reaching the end of its operational life |
eqStorageStockPhaseOut |
Exogenous storage capacity leaving on the schedule |
eqStorageOutStockCap |
Recursive balance of the exogenous (legacy) fleet |
eqStorageOutRetiredNewCap |
Retirement of new storage Out capacity |
eqStorageOutRetUp/Lo/Fx |
Bound on retirement of storage Out capacity |
eqStorageInpStockCap |
Recursive balance of the exogenous (legacy) fleet |
eqStorageInpRetiredNewCap |
Retirement of new storage Inp capacity |
eqStorageInpRetUp/Lo/Fx |
Bound on retirement of storage Inp capacity |
eqStorageStgStockCap |
Recursive balance of the exogenous (legacy) fleet |
eqStorageStgRetiredNewCap |
Retirement of new storage Stg capacity |
eqStorageStgRetUp/Lo/Fx |
Bound on retirement of storage Stg capacity |
eqStorageRetCost |
Costs of retired storage capacity |
eqStorageLevel |
Level |
eqStorageAfLo/Fx/Up |
Availability factor |
eqStorageTarget |
Level target (soft floor) |
eqStorageOutLevel |
Output limited by the level |
eqStorageAInp |
Aux-commodity input |
eqStorageAOut |
Aux-commodity output |
eqStorageInpUp/Lo/Fx |
Input constraints |
eqStorageOutUp/Lo/Fx |
Output constraints |
eqStorageOutCap |
Capacity |
eqStorageInpCap |
Charging capacity accounting |
eqStorageInpCapLo/Fx/Up |
Charging capacity bounds |
eqStorageInpNewCapLo/Fx/Up |
New charging capacity bounds |
eqStorageInp2outLo/Fx/Up |
Charge-to-discharge ratio bounds |
eqStorageInp2stgLo/Fx/Up |
Charging C-rate bounds |
eqStorageStgCap |
Energy capacity accounting |
eqStorageStgCapLo/Fx/Up |
Energy capacity bounds |
eqStorageStgNewCapLo/Fx/Up |
New energy capacity bounds |
eqStorageDurationLo/Fx/Up |
Energy-to-power ratio bounds |
eqStorageOutCapLo/Fx/Up |
Capacity bounds |
eqStorageOutNewCapLo/Fx/Up |
New capacity bounds |
eqStorageInv |
Overnight investment costs |
eqStorageEac |
Equivalent annual cost |
eqStorageFixom |
Fixed costs |
eqStorageVarom |
Variable costs |
eqStorageShortCost |
Level shortfall costs |
eqStorageInpTot |
Total input |
eqStorageOutTot |
Total output |
eqTradeStockCap |
Recursive balance of the exogenous (legacy) fleet |
eqTradePhaseOut |
Trade capacity reaching the end of its operational life |
eqTradeStockPhaseOut |
Exogenous trade capacity leaving on the schedule |
eqTradeRetiredNewCap |
Retirement of new trade capacity |
eqTradeRetUp/Lo/Fx |
Bound on retirement of trade capacity |
eqTradeRetCost |
Costs of retired trade capacity |
eqImportTot |
Import equation (Ir & ROW) |
eqExportTot |
Export equation (Ir & ROW) |
eqTradeFlowUp/Lo/Fx |
Trade bounds |
eqTradeIrAfUp/Lo/Fx |
Trade bound relative to capacity |
eqTradeIrAfsUp/Lo/Fx |
Trade bound over a timeframe relative to capacity |
eqExportRowUp/Lo/Fx |
Export to the ROW constraints |
eqExportRowCum |
Cumulative export to the ROW |
eqExportRowResUp |
Cumulative export to the ROW upper constraint |
eqExportRowCost |
Export to the ROW costs equation |
eqImportRowUp/Lo/Fx |
Import from the ROW constraints |
eqImportRowCum |
Cumulative import from the ROW |
eqImportRowResUp |
Cumulative import from the ROW upper constraint |
eqImportRowCost |
Import from the ROW costs equation |
eqTradeCap |
Trade capacity |
eqTradeCapLo/Fx/Up |
Trade capacity bounds |
eqTradeNewCapLo/Fx/Up |
Trade new capacity bounds |
eqTradeCapFlow |
Trade capacity to activity |
eqTradeInv |
Trade overnight investment costs |
eqTradeEac |
Trade equivalent annual costs |
eqTradeFixom |
Trade fixed costs |
eqImportIrCost |
Interregional trade import costs |
eqExportIrCost |
Interregional trade export costs |
eqTradeIrAInp |
Trade auxiliary commodity input |
eqTradeIrAOut |
Trade auxiliary commodity output |
eqTradeIrAInpTot |
Trade auxiliary commodity input |
eqTradeIrAOutTot |
Trade auxiliary commodity output |
eqSupAvaUp/Lo/Fx |
Supply availability bounds |
eqSupReserve |
Cumulative supply (use of reserve) |
eqSupReserveUp/Lo/Fx |
Cumulative supply constraints |
eqSupCost |
Supply costs |
eqDemInp |
Demand equation |
eqAggOutTot |
Aggregating-commodity output (weighted) |
eqEmsFuelTot |
Total emissions from commodity consumption (weighted) |
eqBalUp/Lo/Fx |
Balance sign: deficit allowed (Up), excess allowed (Lo), neither (Fx) |
eqBal |
Commodity balance |
eqOutTot |
Total commodity output |
eqInpTot |
Total commodity input |
eqSupOutTot |
Supply total output |
- The typeset equations omit their conditions;
maps = "where"orwrite_latex()shows them. - An equation with no row in its map is absent from the LP: the cause is in the data.
- A folded scenario has fewer indices on some parameters; the equations are the same.
- Custom constraints and costs are per scenario: see Custom constraints.
