Computes the levelized cost of energy (LCOE) for a technology,
repository, model, or scenario object.
Usage
levcost(object, comm, name, ...)
# S4 method for class 'repository'
levcost(object, comm, name, ...)
# S4 method for class 'model'
levcost(object, comm, name, ...)
# S4 method for class 'scenario'
levcost(object, comm, name, ...)Arguments
- object
A
technology(or list thereof),repository,model, or solvedscenarioobject.- comm
Character vector or
NULL. Output commodity(ies) to use for LCOE normalisation.NULLuses all commodities in the resolved output group.- name
Character. For
technology, a name tag; forrepository/model/scenario, the name of the technology / process to price.- ...
Additional arguments passed to the underlying implementation. For
technologyobjects the most useful are:groupCharacter or
NULL. Output group name.repoA
repositoryor list of energyRt objects (supplies, commodities, weather) to supplement the mini-model.fuel_costsNamed numeric vector
[commodity -> cost]for input commodities not found inrepo.autocompleteLogical, default
FALSE(repository/modelmethods). WhenTRUE, input commodities without a supply in the container are auto-supplied (zero-cost, or priced viafuel_costs) instead of returningNULL.discountNumeric (0–1), default
0.05.base_yearInteger or
NULL.horizonA
horizonobject, numeric year vector, orNULL(derives from@olife).calendarA
calendarobject orNULL.timeframe"ANNUAL"(default) or"native"."ANNUAL"prices the technology on a single annual time-slice: any weather profile is collapsed to an annual capacity factor (applied as the technology's annual availability), so capacity is sized to serve unit annual demand at that factor (textbook LCOE)."native"keeps the supplied (sub-annual) calendar and normalises by total generation – useful when the technology is analysed together with storage or transmission, where sub-annual dispatch matters.backstopLogical, default
TRUE. Enables a very expensive dummy-import slack on the output commodity balance so the mini-model always solves even when the technology cannot serve a slice on its own; the slack cost is excluded from the LCOE.regionCharacter or
NULL.weatherA
weatherobject, list of weather objects, orNULL.frontierLogical, default
FALSE. WhenTRUEadditional solves are performed to map the production frontier for technologies with multi-commodity grouped output and share constraints.solverSolver spec list, default
solver_options$glpk.as_scenarioLogical, default
FALSE. WhenTRUEthe full solvedscenariois returned with LCOE tables attached toscenario@misc.verboseLogical, default
TRUE.
Value
For technology input: a list of class "levcost" with fields:
$levcostdata.frame – total levelized cost by year.
$levcost_npvNamed numeric – NPV-weighted average LCOE.
$cost_breakdowndata.frame – tidy cost components by year. Components:
eac,fixom,varom,supply,import,export(negative, a credit).$cost_breakdown_npvdata.frame – NPV-weighted component breakdown.
$cost_yearlydata.frame – wide undiscounted cost table with activity, capacity, per-commodity outputs and inputs.
$levcost_per_actdata.frame or
NULL.$frontierdata.frame or
NULL(requiresfrontier = TRUEand multi-commodity grouped output).$scenarioThe solved
scenarioobject.
For a list of technology objects: a named list of class
"levcost_list".
Details
technologya minimal single-technology energyRt model is built around the technology, solved, and the LCOE derived from the resulting cost and production variables.
repository/modelgive the technology
name; the method selects the related commodity and supply objects from the container and prices the named technology as above. If an input commodity has no supply in the container, it returnsNULLwith a message unlessautocomplete = TRUE(which adds a zero-cost /fuel_costssupply). Themodelmethod also takes the calendar, region, horizon and discount rate from the model's configuration (each overridable).scenarioan ex-post cost of the named process in the solved scenario: the discounted sum of its own costs (annualised investment
vTechEac,vTechFixom,vTechVarom, plus attributed fuel cost) divided by its discounted output. Fuel is attributed fromvTechInp; a technology with a grouped input (whose per-commodity consumption is not a solution variable) therefore reports no fuel component.
Examples
if (FALSE) { # \dontrun{
lc <- levcost(my_tech, discount = 0.07, base_year = 2025)
lc$levcost_npv
lc$cost_breakdown
autoplot(lc)
autoplot(lc, type = "npv")
# List of technologies (each solved independently):
lc_list <- levcost(list(tech1, tech2), discount = 0.07)
autoplot(lc_list, type = "npv")
} # }
