Skip to contents

A conversion process: every slot, every column, and how draw() shows them

PDF, A4, 2 pages · energyRt 0.91.5.9015 (dev) · 2026-11-29
Build one
ECHP <- newTechnology(
  name = "ECHP", desc = "Coal CHP, biomass co-firing",
  input = list(comm = c("COA", "BIO"),
               group = c("i", "i")),
  output = list(comm = c("ELC", "HEAT"),
                group = c("o", "o")),
  aux = list(acomm = c("SOX", "NOX", "WAT")),
  group = list(group = c("i", "o"),
               desc = c("fuels", "products")),
  geff = list(group = "i", ginp2use = 1),
  ceff = list(comm = c("COA", "BIO", "ELC", "HEAT"),
              cinp2ginp = c(1, 1, NA, NA),
              use2cact = c(NA, NA, 0.35, 0.5),
              grp.share.up = c(NA, 0.3, NA, NA)),
  aeff = list(
    acomm = c("SOX", "NOX", "NOX", "WAT", "WAT"),
    comm = c("COA", "COA", "BIO", NA, NA),
    cinp2aout = c(0.5, 0.2, 0.15, NA, NA),
    act2ainp = c(NA, NA, NA, 1.5, NA),
    act2aout = c(NA, NA, NA, NA, 1.4)),
  af = list(af.up = 0.9),
  cap2act = 31.536,  # GW -> PJ/year
  invcost = list(invcost = 1800),
  fixom = list(fixom = 40),
  capacity = list(year = 2025, stock = 2),
  olife = 30
)
A slot takes a list() or a data.frame; list columns must have equal length, absent ones are NA.
Anatomy: draw(ECHP)
Schematic of the ECHP technology drawn by draw()

Stages left to right: inp → ginp (input groups, here i) → use → act → out (output groups, here o). Each edge shows the coefficient between stages; [lo,up] are share bounds. Aux flows (blue) hang off inputs, outputs, activity or capacity.

The identities
use = inp·cinp2use each ungrouped input
use = ginp2use·Σc∈g inp·cinp2ginp each input group
out = use·use2cact·cact2cout each ungrouped output
use = Σc∈g out/(use2cact·cact2cout) each output group: free split
act = out/cact2cout each ungrouped output
act = Σc∈g out/cact2cout each output group
act ≤ af.up·cap2act·cap·share(t) also af.lo, af.fx; × weather waf.*
Σt′⊂t act ≤ afs.up·cap2act·cap·share(t) over a parent timeslice
out ≤ afc.up·cact2cout·cap2act·cap·share(t) per commodity; inputs alike
aux = Σ coef·driver drivers: see Auxiliary flows

Ungrouped outputs move in fixed proportion (one act): give them one use2cact and split with cact2cout, or group them for a free split. share(t) is the timeslice share of the year. inp, out, act, cap = vTechInp, vTechOut, vTechAct, vTechCap.

Constructor & conventions
newTechnology(name, desc, input, output, group, aux, units, cap2act, geff, ceff, aeff, af, afs, weather, capacity, invcost, fixom, varom, cluster, vintage, olife, geoframe, region, start, end, timeframe, fullYear, optimizeRetirement, misc, ...)
One argument per slot, plus the olife, start, end shortcuts that fill @vintage.
update(object, ...)
Replaces each named slot whole (rows are not appended); other slots stay.
v c r y t key columns a slot is indexed by: vintage, cluster, region, year, timeslice
NA key applies to every value of that key
x.lo/up/fx lower, upper, fixed; fx overrides lo and up
default used where a row is missing; – = not set, ∞ = unbounded
years interpolated between given years (rule per parameter)
units cap, act, cur, comm, grp = units of capacity, activity, currency, commodity, group
tech@ceff read a slot: every slot is a plain data.frame
Overrides & extras
defVal df per-object default, e.g. defVal$af.up <- 1
interpolation df per-object rule, e.g. interpolation$af.up <- "inter"
misc list free list: sources, misc$image, misc$icon
Flows
input df main inputs, tied to capacity and activity
comm input commodity
unit unit of the flow
group input group it belongs to
combustion share burnt, for emission accounting 1 frac
output df main outputs
comm output commodity
unit unit of the flow
group output group it belongs to
aux df auxiliary commodities: emissions, water, land, materials
acomm auxiliary commodity
unit unit of the flow
group df declares the groups used in input / output
group group name
desc description
unit unit of the group flow
units df units of the process, for reference and reports
capacity capacity unit
use unit of use (grouped input)
activity activity unit
currency currency of costs
Identity & scope
name chr set name, used everywhere in the model
desc chr description for reports
region chr regions where it exists or can be built; empty = all
geoframe chr geoscale level its regions are given at
timeframe chr time level it operates at; default = finest of its commodities
fullYear lgl timeslice cycle closes over the year (ramping)
Efficiencies
ceff df vcryt per-commodity conversion and shares
comm input or output commodity
cinp2use input → use (ungrouped input) 1 comm/use
use2cact use → commodity activity 1 use/act
cact2cout commodity activity → output 1 act/comm
cinp2ginp input → group input 1 comm/grp
grp.share.lo/up/fx share of the commodity within its group 0/1/– frac
afc.lo/up/fx flow bound per unit of cap·cap2act 0/∞/– comm
geff df vcryt group input → use
group group name
ginp2use group input → use 1 grp/use
Drawing
draw(tech, vintage = NULL, cluster = NULL, cluster_style = "rail", ghost = ghost_options())
Schematic of any process: technology, storage, supply, demand, trade, import, export.
  • vintage: one to draw in full (default the newest); others fade behind as ghosts. "all" lays every vintage side by side.
  • cluster: one to draw (default the first declared); the cluster axis shows as a "rail", a "deck", or "none".
ghost_options(alpha, alpha_min, scale, drift, rise, stamp)
Opacity and geometry of the ghost stack.
object_image(object, which = …)
Resolve misc$image / misc$icon and check it exists.
Auxiliary flows
aeff df vcryt aux flow = coefficient × driver; grouped by driver
acomm auxiliary commodity
comm main commodity of cinp2* / cout2*
per main flow — SOX, NOX per COA (ECHP); CO2 per COKE, SLAG per HMT (IBF)
cinp2ainp per main input → aux input 0 comm/acomm
cinp2aout per main input → aux output 0 comm/acomm
cout2ainp per main output → aux input 0 comm/acomm
cout2aout per main output → aux output 0 comm/acomm
per activity — WAT in and out (ECHP); ELC (IBF)
act2ainp per activity → aux input 0 act/acomm
act2aout per activity → aux output 0 act/acomm
per capacity, every year — LAND (EWIN)
cap2ainp per capacity → aux input 0 cap/acomm
cap2aout per capacity → aux output 0 cap/acomm
per new capacity, once — STEEL to build (TCAR)
ncap2ainp per new capacity → aux input 0 cap/acomm
ncap2aout per new capacity → aux output 0 cap/acomm
at end of life / early retirement — SCRAP (TCAR)
pho2ainp per capacity at end of life → aux input 0 cap/acomm
pho2aout per capacity at end of life → aux output 0 cap/acomm
ret2ainp per capacity retired early → aux input 0 cap/acomm
ret2aout per capacity retired early → aux output 0 cap/acomm
Availability
cap2act num 1 act/cap activity per unit of capacity per year at full load
af df vcryt availability per timeslice, act / (cap·cap2act·share)
af.lo/up/fx bounds on the availability factor 0/1/– frac
rampup hours from zero to full output ∞ hours
rampdown hours from full output to zero ∞ hours
afs df vcryt availability summed over a parent timeslice (month, year)
afs.lo/up/fx bounds over the parent timeslice; up unbounded by default 0/∞/– frac
weather df vc scales availability by a weather series
weather name of the weather object
unit unit the process expects from the series
transform derived series from weather@misc$transform
comm commodity for wafc.*
wafc.lo/up/fx multiplier on afc.* 1/1/– factor
waf.lo/up/fx multiplier on af.* 1/1/– factor
wafs.lo/up/fx multiplier on afs.* 1/1/– factor
Costs
invcost df vcry investment and its annuity
invcost overnight cost per unit of capacity 0 cur/cap
wacc cost of capital, overrides the model's 0 1/year
payback annuity period, replaces olife 0 years
eac annual cost given directly, wins over invcost 0 cur/cap
retcost cost of early retirement 0 cur/cap
fixom df vcry fixed O&M per unit of capacity per year
fixom cost per capacity per year 0 cur/cap
varom df vcryt variable O&M
varom per unit of activity 0 cur/act
comm commodity for cvarom
cvarom per unit of commodity flow 0 cur/comm
acomm aux commodity for avarom
avarom per unit of aux flow 0 cur/acomm
Recipes
# must-run: 60-90% of capacity, each slice
ECHP <- update(ECHP, af = list(
  af.lo = 0.6, af.up = 0.9))
# cost path, interpolated between years
ECHP <- update(ECHP, invcost = list(
  year = c(2025, 2050),
  invcost = c(1800, 1500)))
# a build floor and a ceiling on the total
ECHP <- update(ECHP, capacity = list(
  year = c(2030, 2050), ncap.lo = c(1, 2),
  cap.up = c(50, 80)))
# emissions = commodity emis x burnt share;
# biomass is not counted
ECHP <- update(ECHP, input = list(
  comm = c("COA", "BIO"),
  group = c("i", "i"),
  combustion = c(1, 0)))
update() replaces a slot whole: restate every row.
Stock & life
capacity df vcry existing stock and capacity bounds by year
stock pre-existing capacity (its decline = retirement schedule) 0 cap
cap.lo/up/fx bounds on total capacity 0/∞/– cap
ncap.lo/up/fx bounds on new capacity 0/∞/– cap
ret.lo/up/fx bounds on age-based retirement 0/∞/– cap
vintage df cr investment windows and lifetimes (see the Clusters & vintages sheet)
vintage label, usually the build year
start first year it can be built – year
end last year it can be built – year
olife operational life, years 1 years
cluster df r parallel sub-processes (see the Clusters & vintages sheet)
cluster cluster label
desc description
cap.share.fx fixed share of the family's capacity –
act.share.lo/up/fx bounds on the share of the family's throughput –/–/–
order display and ranking order –
optimizeRetirement lgl let the model retire capacity early (also set on the model)
Wind: weather and land
Wind plant with a weather factor and land use
EWIN <- newTechnology(
  name = "EWIN", desc = "Onshore wind",
  output = list(comm = "ELC"),
  aux = list(acomm = "LAND"),
  aeff = list(acomm = "LAND",
              cap2ainp = 120),
  weather = list(weather = "WIND_CF",
                 waf.up = 1),
  afs = list(timeslice = "ANNUAL",
             afs.up = 0.35),
  cap2act = 31.536, olife = 25)
Output ≤ capacity × WIND_CF in each slice and ≤ 35% over the year; 120 km² of LAND per GW, every year.
Car: fuels, materials, scrap
Plug-in hybrid car with materials and scrap
TCAR <- newTechnology(
  name = "TCAR", desc = "Plug-in hybrid car",
  input = list(comm = c("GSL", "ELC"),
               group = c("i", "i")),
  output = list(comm = "VKM"),
  aux = list(acomm = c("CO2", "NOX",
                       "STEEL", "SCRAP")),
  group = list(group = "i", desc = "fuels"),
  geff = list(group = "i", ginp2use = 1),
  ceff = list(comm = c("GSL", "ELC", "VKM"),
    cinp2ginp = c(1, 2.8, NA),
    grp.share.up = c(NA, 0.6, NA)),
  aeff = list(
    acomm = c("CO2", "NOX",
              "STEEL", "SCRAP"),
    comm = c("GSL", "GSL", NA, NA),
    cinp2aout = c(73, 0.05, NA, NA),
    ncap2ainp = c(NA, NA, 1.2, NA),
    pho2aout = c(NA, NA, NA, 1.1)),
  cap2act = 15, olife = 15)
Capacity in vehicles, activity in vehicle-km; ELC counts 2.8× per unit, at most 60% of the fuel mix.
In the solution
vTechInv Overnight investment costs ry
vTechEac Annualized investment costs ry
vTechRetCost Early retirement costs ry
vTechFixom Fixed O&M costs ry
vTechVarom Variable O&M costs ry
vTechNewCap New capacity ry
vTechRetiredStock Early retired stock ry
vTechPhaseOut Capacity reaching the end of its life ry
vTechStockCap Surviving pre-existing capacity ry
vTechCap Total capacity of the technology ry
vTechAct Activity level of technology ryt
vTechInp Input level cryt
vTechOut Output of a main commodity cryt
vTechAInp Auxiliary commodity input cryt
vTechAOut Auxiliary commodity output cryt
getData(scen, name = "vTechOut",
        tech = "ECHP", merge = TRUE)
r y t c = region, year, timeslice, commodity.
Blast furnace: fixed by-product
Blast furnace with ore, reductants, hot metal and blast-furnace gas
IBF <- newTechnology(
  name = "IBF", desc = "Blast furnace",
  input = list(
    comm = c("ORE", "COKE", "PCI"),
    group = c(NA, "r", "r")),
  output = list(comm = c("HMT", "BFG")),
  aux = list(
    acomm = c("ELC", "CO2", "SLAG")),
  group = list(group = "r"),
  geff = list(group = "r", ginp2use = 2),
  ceff = list(
    comm = c("ORE", "COKE", "PCI", "BFG"),
    cinp2use = c(0.645, NA, NA, NA),
    cinp2ginp = c(NA, 1, 1, NA),
    cact2cout = c(NA, NA, NA, 1.3)),
  aeff = list(
    acomm = c("ELC", "CO2", "CO2", "SLAG"),
    comm = c(NA, "COKE", "PCI", "HMT"),
    act2ainp = c(0.1, NA, NA, NA),
    cinp2aout = c(NA, 3.1, 2.9, NA),
    cout2aout = c(NA, NA, NA, 0.28)),
  cap2act = 1, olife = 40)
Ungrouped HMT and BFG share one activity: 1.3 BFG per HMT. Ore and the reductant group r each fix use.
Specs, files and tools
process_from_spec(spec, strict = FALSE)
Build from a YAML/JSON techspec; examples in system.file("techspec/examples", package = "energyRt").
process_to_spec(object, file = NULL)
Write an object back to a techspec.
process_designer(spec = NULL, dir = NULL, …)
Interactive designer (Shiny).
read_technology_xlsx(path, sheet = NULL, …)
One sheet per slot, from Excel; write_technology_xlsx() writes back.
levcost(object, comm, name, ...)
Levelized cost of a technology, a-priori or from a solved scenario.
process_operability(object)
Can it run at all, given its bounds?