API Reference

This page groups the public API exported by Nosy. For a narrative introduction, see Modelling Concepts and Examples.

Simulation And Optimisation

Nosy.TimeMeshType
TimeMesh(w::Vector; circular::Bool=true)

Return a TimeMesh based on the timestep weight vector w. All weights must be positive rational or integer values, and their sum must be an integer. Time meshes are circular by default. Pass circular=false to make associated time series reject out-of-bounds indexing instead of wrapping around.

source
TimeMesh(; circular::Bool=true)

Return a TimeMesh based on the a 8760 1-hour timesteps. Time meshes are circular by default. Pass circular=false to make associated time series reject out-of-bounds indexing instead of wrapping around.

source
Nosy.SimType

Simulation data shared by all nodes, components, carriers, and snapshots.

source
Nosy.simFunction
sim(x)

Return the Sim associated with x.

The most common use is sim(snapshot), which gives access to the simulation object shared by the snapshot and its JuMP model.

source
Nosy.modelFunction
model(s::Sim)

Return the JuMP model of the simulation for a single-level problem.

source
model(c::Component)

Return the model built for component c.

source
Nosy.lowermodelFunction
lowermodel(s::Sim)

Return the lower model of a Bilevel problem or the model itself for a single-level problem.

source
Nosy.uppermodelFunction
uppermodel(s::Sim)

Return the upper model of a Bilevel problem or the model itself for a single-level problem.

source
Nosy.SnapshotType
Snapshot(sim::Sim, options::AbstractDict{Symbol,<:Any}=Dict{Symbol,Any}())

Create a Snapshot for simulation sim with options options. Options from sim are merged with options, and an error is thrown if there are duplicate keys.

source
Nosy.finalize!Function
finalize!(s::Snapshot)

Finalize the system:

  • add node losses
  • check all ports of connected components are connected
  • apply system and node constraints
  • fix variables with very low bounds
source
Nosy.optimize!Function
optimize!(snapshots, obj::Union{GenericAffExpr,Number})

Optimise snapshots sharing the same simulation. snapshots accepts either one Snapshot or an AbstractVector of Snapshots. This function modifies the underlying simulation model and does not return a Snapshot. Thresholds are read from sim(s).options.

source
optimize!(snapshots, lowerobj::Union{GenericAffExpr,Number}, upperobj::Union{GenericAffExpr,Number})

Optimise snapshots sharing the same simulation using bilevel optimisation. snapshots accepts either one Snapshot or an AbstractVector of Snapshots. This function modifies the underlying simulation model and does not return a Snapshot. Thresholds are read from sim(s).options.

source
Nosy.extractFunction
extract(s::Snapshot)

Return a Snapshot populated with values corresponding to the optimised system.

source
Nosy.conflictsFunction
conflicts(s::Sim)
conflicts(snapshot::Snapshot)

Return the vector of constraints in conflict (IIS) of the simulation. If there are no conflicts, return nothing.

source

Carriers And Modifiers

Nosy.EnergyCarrierType
EnergyCarrier(name::String, sim::Sim; energy=nothing)

Return an EnergyCarrier with name name associated with sim. Optional arguments:

  • energy: number, or vector with one value per hour or step, describing the energy density in MWh/t.
source
Nosy.MassCarrierType
MassCarrier(name::String, sim::Sim; energy=nothing)

Return a MassCarrier with name name associated with sim. Optional arguments:

  • energy: number, or vector with one value per hour or step, describing the energy density in MWh/t.
source
Nosy.CO2CarrierType
CO2Carrier(name::String, sim::Sim; weight::Number=1.)

Return a CO2Carrier with name name associated with sim. Optional arguments:

  • weight: CO2-equivalent weight in t CO2eq/t.
source
Nosy.PowerCarrierType
PowerCarrier(name::String, sim::Sim)

Return a PowerCarrier with name name associated with sim.

source
Nosy.energyFunction
energy(x)

Return the energy view of a carrier or port.

energy is a carrier modifier commonly passed to functions such as balance, capacity behaviors, and cost behaviors.

source
Nosy.co2Function
co2(x)

Return the CO2-equivalent view of a carrier or port.

co2 is a carrier modifier for carbon accounting and CO2-related costs.

source

Nodes, Components, And Connections

Nosy.NodeType
Node(name::String, c::AbstractCarrier; mesh=sim(c).mesh, losses::Number=0., rule::Symbol=:default, evalprice::Bool=false, tags::Vector{Symbol}=Symbol[])

Construct a Node with name name associated with carrier c. A node has a unique carrier. The mesh argument defines the time mesh on which the node balance is applied. Connected component ports must use the same or a finer mesh than the node. The rule defines the node behavior (:default or :curtailed). The losses value is the ratio, between 0 and 1, of input flow that is lost. Set evalprice=true to store node-balance constraints for dual-price extraction. The tags argument initialises the node tags.

source
Nosy.ComponentType
Component(name::String, model::AbstractModelData, behaviors::AbstractVector; tags::Vector{Symbol}=Symbol[])

Construct a Component with name name, model archetype model, behaviors and joint flows from behaviors, and optional tags.

source
Nosy.connect!Function
connect!(s::Snapshot, c::Component, n::Node, pname::String)

Connect port named pname of component c to node n on snapshot s.

source
connect!(s::Snapshot, c::Component, n::Node)

Connect all compatible ports of component c to node n on snapshot s.

source
Nosy.tag!Function
tag!(element, tag::Symbol)

Add tag to a component or node.

Tags are used to group model elements for reporting and filtering.

source
Nosy.hastagFunction
hastag(element, tag::Symbol)

Return whether a component or node has tag.

source
Nosy.getnodesFunction
getnodes(snapshot; with=Symbol[], without=Symbol[])

Return the nodes in snapshot, optionally filtered by tags.

source
Nosy.getcomponentsFunction
getcomponents(snapshot; with=Symbol[], without=Symbol[])

Return the components in snapshot, optionally filtered by tags.

source
getcomponents(s::Snapshot, nodename::String; with::Vector{Symbol}=Symbol[], without::Vector{Symbol}=Symbol[])

Return components connected to the node named nodename in snapshot s. The with and without keywords filter connected components by tags.

source

Model Archetypes

Nosy.DispatchableSourceType
DispatchableSource(carrier::AbstractCarrier)

Return a DispatchableSource model archetype for carrier carrier.

source
Nosy.ProfileSourceType
ProfileSource(carrier::AbstractCarrier, profile)

Return a ProfileSource model archetype for carrier carrier with a non-negative profile profile.

If profile is a Number: the profile is flat. If profile is a Vector: it defines the profile.

The values of profile above cutoff will be set to cutoff.

Adding a capacity behavior is mandatory. The profile is not renormalised.

source
Nosy.DemandType
Demand(carrier::AbstractCarrier, series; modifier=defaultmodifier, mesh=sim(carrier).mesh)

Return a Demand model archetype for carrier carrier with a non-negative series series. The parameter series can be either a Vector (of length equal to number of hours or steps) or a Number. If modifier is provided, series is interpreted in the modified carrier unit. The mesh argument defines the component mesh used by the demand port.

source
Nosy.BasicSinkType
BasicSink(carrier::AbstractCarrier)

Return a BasicSink model archetype for carrier carrier.

source
Nosy.ProfileSinkType
ProfileSink(carrier::AbstractCarrier, profile; cutoff=Inf64)

Return a ProfileSink model archetype for carrier carrier with a non-negative profile profile.

If profile is a Number, the profile is flat. If profile is a Vector, it defines the profile.

The values of profile above cutoff will be set to cutoff.

Adding a capacity behavior on input is mandatory. The profile is not renormalised.

source
Nosy.BasicConverterType
BasicConverter(input::AbstractCarrier, output::AbstractCarrier; ratio=1., modifier::Function=defaultmodifier, mesh=sim(input).mesh)

Return a BasicConverter model archetype that converts carrier input into output with ratio ratio. The ratio can be a number or a time series. The mesh argument defines the component mesh used by both input and output ports.

source
Nosy.BasicStorageType
BasicStorage(carrier::AbstractCarrier; eff_i::Float64=1., eff_o::Float64=1., self_discharge::Float64=0., modifier=_defaultmodifier(carrierstyle(carrier)), simplified::Bool=false, mesh=sim(carrier).mesh)

Return a BasicStorage model archetype using carrier for input, output, and level. The model uses input efficiency eff_i, output efficiency eff_o, and hourly self-discharge fraction self_discharge. A timestep of duration Δt retains (1 - self_discharge)^Δt of the initial level. The mesh argument defines the component mesh used by input, output, level, and the storage balance.

source
BasicStorage(input::AbstractCarrier, output::AbstractCarrier, level::AbstractCarrier, modifier::Function; eff_i::Float64=1., eff_o::Float64=1., self_discharge::Float64=0., simplified::Bool=false, mesh=sim(input).mesh)

Return a BasicStorage model archetype associated with:

  • input: carrier of input
  • output: carrier of output
  • level: carrier of level
  • modifier: modifier for all carriers
  • eff_i: input efficiency
  • eff_o: output efficiency
  • self_discharge: fraction of stored energy lost per hour; a timestep of duration Δt retains (1 - self_discharge)^Δt
  • simplified: if true, use step flows instead of trapezoidal integration
  • mesh: component mesh used by input, output, level, and the storage balance

Storage is periodic: the step after the last step is the first step.

source
Nosy.LazyStorageType
LazyStorage(level::AbstractCarrier; modifier::Function=defaultmodifier, eff=nothing, self_discharge=0., simplified::Bool=false)

Return a LazyStorage model archetype with a level of carrier level. The lazy storage constraint is applied to the level and associated joint flows after applying modifier to flows. self_discharge is the fraction of stored energy lost per hour. For a timestep of duration Δt, the fraction retained is (1 - self_discharge)^Δt. Storage is periodic: the step after the last step is the first step.

source
Nosy.ACLineType
ACLine(from::PowerCarrier, to::PowerCarrier, admittance::Number; mesh=sim(from).mesh)

Return an ACLine model archetype from from to to, with admittance admittance. ACLine contributes to Kirchhoff Voltage Law (KVL).

source
Nosy.DCLineType
DCLine(from::PowerCarrier, to::PowerCarrier; mesh=sim(from).mesh)

Return a DCLine model archetype from from to to. DCLine does not contribute to Kirchhoff Voltage Law (KVL).

source

Behaviors

Nosy.FixedCapacityType
FixedCapacity(pname::String, modifier::Function, val::Number; unitsize::Union{Nothing,Number})

Return FixedCapacity behavior data associated with port name pname, modifier modifier, and fixed value val. If unitsize is a number, it is the size of one unit when considering a fleet.

source
Nosy.VariableCapacityType
VariableCapacity(pname::String, modifier::Function; lb::Number=0., ub::Number=Inf, warmstart::Union{Nothing,Number}=nothing, unitsize::Union{Nothing,Number}=nothing, integer::Bool=false, expression::Union{Nothing,GenericVariableRef,GenericAffExpr,Number}=nothing)

Return VariableCapacity behavior data associated with port name pname and modifier modifier. Optional parameters:

  • lb: lower bound
  • ub: upper bound
  • warmstart: initial value for the capacity variable
  • unitsize: size of one unit when considering a fleet
  • integer: if unitsize is a number, constrain the number of units to be integer
  • expression: reused capacity input (nothing, GenericVariableRef, GenericAffExpr, or Number)

A numeric expression is interpreted as a fixed capacity by setting lb = ub = expression. warmstart is not supported when expression is provided. integer is supported only when expression is a GenericVariableRef.

source
Nosy.FixedComposedCapacityType
FixedComposedCapacity(pname::Union{String,Vector{String}}, modifier::Function, val::Number; unitsize::Union{Nothing,Number})

Return FixedComposedCapacity behavior data associated with one or several port names pname, modifier modifier, and fixed value val. The capacity applies to the sum of targeted flows. If unitsize is a number, it is the size of one unit when considering a fleet.

source
Nosy.VariableComposedCapacityType
VariableComposedCapacity(pname::Union{String,Vector{String}}, modifier::Function; weights, lb::Number=0., ub::Number=Inf, warmstart::Union{Nothing,Number}=nothing, unitsize::Union{Nothing,Number}=nothing, integer::Bool=false)

Return VariableComposedCapacity behavior data associated with one or several port names pname and modifier modifier. The capacity applies to the weighted sum of targeted flows. Optional parameters:

  • weights: relative weights of targeted flows, in the same order as pname
  • lb: lower bound
  • ub: upper bound
  • warmstart: initial value for the capacity variable
  • unitsize: size of one unit when considering a fleet
  • integer: if unitsize is a number, constrain the number of units to be integer
source
Nosy.CapacityMultiplierType
CapacityMultiplier(pname::String, val)

Return CapacityMultiplier behavior data associated with port name pname and a scalar or vector value val. The modifier is assumed to be the same as the capacity associated with port named pname.

source
Nosy.DurationType
Duration(hours::Number; inputpname::String="input", outputpname::String="output", levelpname::String="level")

Return Duration behavior data linking storage flow capacity and level capacity by the duration hours. Exactly one of inputpname, outputpname, or levelpname must have a capacity behavior.

source
Nosy.YearlySumType
YearlySum(pname::String, val::Number, type::Symbol; modifier::Function=defaultmodifier)

Return a YearlySum behavior, constraining the sum of the flow associated with port pname and modifier modifier over the year. If type is :equal, the sum is constrained to be equal to val. If type is :max, the sum is constrained to be less than or equal to val. If type is :min, the sum is constrained to be greater than or equal to val.

source
Nosy.RampingType
Ramping(pname::String, sense::Symbol, val::Number; modifier::Function=defaultmodifier)

Return a Ramping behavior that constrains the ramp rate of port pname. sense must be :up or :down, and val is the maximum rate in the modified carrier unit per hour.

source
Nosy.ReserveUpType
ReserveUp(name::String, pname::String, sense::Symbol, duration::Number; modifier::Function=defaultmodifier)

Return ReserveUp behavior data.

  • name: groups reserves at snapshot level (e.g., "FCR", "15min").
  • pname: port name the reserve applies to (e.g., "output", "input").
  • sense: :up (discharge increase) or :down (charge reduction); both provide upward reserve.
  • duration: duration in hours, used for energy-limited constraints.
  • modifier: must match the modifier used by capacity, ramping, and unit commitment behaviors for the target port.
source
Nosy.ReserveDownType
ReserveDown(name::String, pname::String, sense::Symbol, duration::Number; modifier::Function=defaultmodifier)

Return ReserveDown behavior data.

  • name: groups reserves at snapshot level (e.g., "FCR", "15min").
  • pname: port name the reserve applies to (e.g., "output", "input").
  • sense: :down (discharge reduction) or :up (charge increase); both provide downward reserve.
  • duration: duration in hours, used for energy-limited constraints.
  • modifier: must match the modifier used by capacity, ramping, and unit commitment behaviors for the target port.
source
Nosy.UnitCommitmentType
UnitCommitment(pname::String, minratio::Number; startup::Number=0, shutdown::Number=0, uptime::Number=0, downtime=0, startupratio::Number=minratio, shutdownratio::Number=minratio, integer::Bool=false, startupmask::Union{Nothing,Vector{Bool}}=nothing, shutdownmask::Union{Nothing,Vector{Vector{Bool}}}=nothing)

Return a UnitCommitment behavior related to port pname, with minimum flow ratio minratio. Optional parameters:

  • startup: startup duration in hours (default=0).
  • shutdown: shutdown duration in hours (default=0).
  • uptime: minimum uptime duration in hours (default=0).
  • downtime: minimum downtime duration in hours, or a vector of alternative downtime durations (default=0).
  • startupratio: maximum flow ratio for a unit at the end of the startup phase (default=minratio)
  • shutdownratio: maximum flow ratio for a unit at the beginning of the shutdown phase (default=minratio)
  • integer: whether the unit commitment must follow an integer constraint (default=false).
  • startupmask: Boolean vector disallowing startup at certain hours.
  • shutdownmask: Vector of Boolean Vector, disallowing shutdown at certain hours for certain shutdown types.
source
Nosy.FixedCostType
FixedCost(type::Symbol, pname::String, modifier::Function, val::Number; threshold::Number=0.)

Return FixedCost behavior data associated with cost type type, port name pname, modifier modifier, and fixed cost value val. When threshold is positive, the cost applies only to capacity above that threshold.

source
Nosy.ConstantCostType
ConstantCost(type::Symbol, val::Number)

Return ConstantCost behavior data associated with cost type type and constant cost value val.

source
Nosy.VariableCostType
VariableCost(type::Symbol, pname::String, modifier::Function, val; style::Symbol=:step)

Return VariableCost behavior data associated with cost type type, port name pname, modifier modifier, and cost val. val must be either a number or an AbstractVector{<:Number} with length equal to the number of steps or hours. If val is a vector, then style determines how it must be interpreted:

  • if style = :step, the cost is assumed to be a step function
  • if style = :linear, the cost is assumed to vary linearly between timesteps

If val is a number, style has no effect.

source
Nosy.NoLoadCostType
NoLoadCost(type::Symbol, pname::String, val::Number)

Return NoLoadCost behavior data associated with cost type type, port name pname, and hourly cost val.

source
Nosy.StartupCostType
StartupCost(type::Symbol, pname::String, val::Number)

Return StartupCost behavior data associated with cost type type, port name pname, and per-startup cost val.

source

Joint Flows

Nosy.FixedJointFlowType
FixedJointFlow(name::String, carrier::AbstractCarrier, sense::Symbol, series; mustconnect::Bool=true)

Return a FixedJointFlow with name name, sense sense, carrier carrier, and flow time series or scalar series. The series uses the carrier simulation mesh and is projected to the component mesh when the component is built.

source
Nosy.FreeJointFlowType
FreeJointFlow(name::String, carrier::AbstractCarrier, sense::Symbol; mustconnect::Bool=true)

Return a FreeJointFlow with name name, sense sense, and carrier carrier.

source
Nosy.LinkedJointFlowType
LinkedJointFlow(name::String, carrier::AbstractCarrier, sense::Symbol, baseflows, f::Function; modifier::Function=defaultmodifier, mustconnect::Bool=true)

Return a LinkedJointFlow with the following characteristics:

  • sense: sense of the joint flow
  • baseflows: name or names of the target component flows used to evaluate the joint flow. Must be a string or an iterable of strings.
  • f: affine function that calculates the joint flow from baseflows, e.g. x -> x[1] + 2 * x[2].
  • modifier: modifier applied before f to both flows
source

Balance

Nosy.balanceFunction
balance(n::Node, sense::Symbol, modifier::Function; collapse::Bool=true, aggregate::Bool=true)

Return the flow balance for node n.

Parameters:

  • n: Node
  • sense: :input or :output
  • modifier: modifier function e.g. energy, mass, co2
  • collapse: if true, the flows are summed over time; otherwise the Hourly series are returned
  • aggregate: if true, the flows from multiple components are summed together, otherwise one entry per component is returned
source
balance(c::Component, sense::Symbol, modifier::Function; collapse::Bool=true, aggregate::Bool=true)

Return the flow balance for component c.

Parameters:

  • c: Component
  • sense: :input, :output, or :level
  • modifier: modifier function e.g. energy, mass, co2
  • collapse: if true, the flows are summed over time; otherwise the Hourly series are returned. Must be false when sense is :level.
  • aggregate: if true, the multiple flows are summed together, otherwise one entry per flow is returned
source
balance(s::Snapshot, name::String, sense::Symbol, modifier::Function; collapse::Bool=false, aggregate::Bool=false)

Return the flow balance for component or node name in snapshot s with sense sense and modifier modifier.

Optional arguments:

  • collapse: if true, the flows are summed over time; otherwise Hourly time series are returned
  • aggregate: if true, the multiple flows are summed together, otherwise one entry per flow is returned
source

Metrics And Post-Processing

Nosy.capacityFunction
capacity(c::Component; multiplier::Bool=false)

Return the capacity of a Component c. If multiplier is true, return the capacity multiplied with the matching capacity multiplier (same port) if it exists. If the component has no capacity, return zero.

source
capacity(c::Component, pname::String; multiplier::Bool=false)

Return the capacity associated with port named pname of component c. If multiplier is true, return the capacity multiplied with the matching capacity multiplier (same port) if it exists. If the component has no port named pname, throw an error. If the component has no capacity associated with port pname, return Inf64.

source
capacity(s::Snapshot, cname::String; multiplier::Bool=false)

Return the capacity of component with name cname from snapshot s. If multiplier is true, return the capacity multiplied with the matching capacity multiplier (same port) if it exists. If the component has no capacity, return zero. Throw an error if there is no component with name cname in s.

source
Nosy.nbunitsFunction

nbunits(c::Component)

Return the number of units of Component c, related to its capacity and unit size. If c has no capacity or no unit size, return nothing.

source
Nosy.costFunction
cost(c::Component)

Return the cost of Component c.

source
cost(c::Component, type::Symbol)

Return the cost of type type of Component c.

source
cost(s::Snapshot, cname::String)

Return the cost of Component with name cname in Snapshot s. If the component has no cost, return zero. Throw an error if there is no component with name cname in s.

source
cost(s::Snapshot, cname::String, type::Symbol)

Return the cost of type type of Component with name cname in Snapshot s. If the component has no cost, return zero. Throw an error if there is no component with name cname in s.

source
cost(s::Snapshot)

Return the sum of the costs of the components of the Snapshot.

source
cost(s::Snapshot, type::Symbol)

Return the sum of the costs of type type of the components of the Snapshot.

source
Nosy.fixedcostFunction
fixedcost(c::Component)

Return the fixed cost of Component c. If the component has no fixed cost, return zero.

source
fixedcost(c::Component, type::Symbol)

Return the fixed cost of type type of Component c. If the component has no fixed cost, return zero.

source
fixedcost(s::Snapshot, cname::String)

Return the fixed cost of Component with name cname in Snapshot s. If the component has no fixed cost, return zero. Throw an error if there is no component with name cname in s.

source
fixedcost(s::Snapshot, cname::String, type::Symbol)

Return the fixed cost of type type of Component with name cname in Snapshot s. If the component has no fixed cost of type type, return zero. Throw an error if there is no component with name cname in s.

source
fixedcost(s::Snapshot)

Return the sum of fixed cost items of the components of s.

source
fixedcost(s::Snapshot, type::Symbol)

Return the sum of fixed cost items of type type of the components of s.

source
Nosy.constantcostFunction
constantcost(c::Component)

Return the constant cost of Component c. If the component has no constant cost, return zero.

source
constantcost(c::Component, type::Symbol)

Return the constant cost of type type of Component c. If the component has no constant cost, return zero.

source
constantcost(s::Snapshot, cname::String)

Return the constant cost of Component with name cname in Snapshot s. If the component has no constant cost, return zero. Throw an error if there is no component with name cname in s.

source
constantcost(s::Snapshot, cname::String, type::Symbol)

Return the constant cost of type type of Component with name cname in Snapshot s. If the component has no constant cost of type type, return zero. Throw an error if there is no component with name cname in s.

source
constantcost(s::Snapshot)

Return the sum of constant cost items of the components of s.

source
constantcost(s::Snapshot, type::Symbol)

Return the sum of constant cost items of type type of the components of s.

source
Nosy.variablecostFunction
variablecost(c::Component)

Return the variable cost of Component c. If the component has no variable cost, return zero.

source
variablecost(c::Component, type::Symbol)

Return the variable cost of type type of Component c. If the component has no variable cost, return zero.

source
variablecost(s::Snapshot, cname::String)

Return the variable cost of Component with name cname in Snapshot s. If the component has no variable cost, return zero. Throw an error if there is no component with name cname in s.

source
variablecost(s::Snapshot, cname::String, type::Symbol)

Return the variable cost of type type of Component with name cname in Snapshot s. If the component has no variable cost of type type, return zero. Throw an error if there is no component with name cname in s.

source
variablecost(s::Snapshot)

Return the sum of variable cost items of the components of s.

source
variablecost(s::Snapshot, type::Symbol)

Return the sum of variable cost items of type type of the components of s.

source
Nosy.noloadcostFunction
noloadcost(c::Component)

Return the no-load cost of Component c. If the component has no no-load cost, return zero.

source
noloadcost(c::Component, type::Symbol)

Return the no-load cost of type type of Component c. If the component has no no-load cost, return zero.

source
noloadcost(s::Snapshot, cname::String)

Return the no-load cost of Component with name cname in Snapshot s. If the component has no no-load cost, return zero. Throw an error if there is no component with name cname in s.

source
noloadcost(s::Snapshot, cname::String, type::Symbol)

Return the no-load cost of type type of Component with name cname in Snapshot s. If the component has no no-load cost of type type, return zero. Throw an error if there is no component with name cname in s.

source
noloadcost(s::Snapshot)

Return the sum of no-load cost items of the components of s.

source
noloadcost(s::Snapshot, type::Symbol)

Return the sum of no-load cost items of type type of the components of s.

source
Nosy.startupcostFunction
startupcost(c::Component)

Return the startup cost of Component c. If the component has no startup cost, return zero.

source
startupcost(c::Component, type::Symbol)

Return the startup cost of type type of Component c. If the component has no startup cost, return zero.

source
startupcost(s::Snapshot, cname::String)

Return the startup cost of Component with name cname in Snapshot s. If the component has no startup cost, return zero. Throw an error if there is no component with name cname in s.

source
startupcost(s::Snapshot, cname::String, type::Symbol)

Return the startup cost of type type of Component with name cname in Snapshot s. If the component has no startup cost of type type, return zero. Throw an error if there is no component with name cname in s.

source
startupcost(s::Snapshot)

Return the sum of startup cost items of the components of s.

source
startupcost(s::Snapshot, type::Symbol)

Return the sum of startup cost items of type type of the components of s.

source
Nosy.reserveFunction
reserve(c::Component, sense::Symbol, rname::String)

Return the reserve of Component c for the specified sense and rname. sense is :up for upward reserve or :down for downward reserve.

source
reserve(snap::Snapshot{T}, sense::Symbol, rname::String; with::Vector{Symbol}=Symbol[], without::Vector{Symbol}=Symbol[]) where T

Return the total reserve of components in Snapshot snap for the specified sense and reserve name rname. Optional with and without filter components by tags (same as getcomponents(snap; with, without)).

source
reserve(snap::Snapshot{T}, name::String, sense::Symbol, rname::String; with::Vector{Symbol}=Symbol[], without::Vector{Symbol}=Symbol[]) where T

Return the reserve of the component named name, or the total reserve of components connected to node named name, within Snapshot snap for the specified sense and reserve name rname. When name is a node, optional with and without filter components by tags.

source
Nosy.costsFunction
costs(s::Snapshot; removezero::Bool=false, addtotal::Bool=true)

Return a DataFrame containing the details of all the cost items of all the components of Snapshot s. If removezero, components with costs equal to zero will not appear. If addtotal, sums over components and cost types will also be provided.

source
Nosy.tableFunction
table(s::Snapshot, metric::Function; removenothing::Bool=true)

Return a table containing the evaluation of the metric metric over the components of Snapshot s. If removenothing is true, the values equal to nothing will be discarded.

source
table(c::Component, modifier::Function; collapse::Bool=false)

Perform a balance at all the ports of the component, following a given modifier. If collapse is true, return an OrderedDict of portname => yearly balance. If collapse is false, return a DataFrame of Hourly time series per port.

source

Export and Import Snapshots

Nosy.sanitizeFunction
sanitize(snapshot)

Return a lightweight copy of an extracted Snapshot{Float64}.

The sanitized snapshot has no JuMP model, keeps only portable option values, and replaces captured implementation functions with a Nosy-owned placeholder. This function does not serialize the snapshot. The original snapshot is restored before this function returns.

source
Nosy.exportsnapshotFunction
exportsnapshot(path, snapshot)
exportsnapshot(io, snapshot)

Serialize an extracted Snapshot{Float64} after removing its JuMP model.

Path exports require a .snap extension. If no extension is provided, .snap is appended.

The original snapshot keeps its model after export. Imported snapshots are meant for reporting and post-processing, not for further optimization.

source
Nosy.importsnapshotFunction
importsnapshot(path)
importsnapshot(io)

Deserialize a lightweight Snapshot{Float64} exported with exportsnapshot.

source