gtopt::Demand struct

Represents an electrical demand (load) at a bus.

A demand consumes active power load ∈ [0, lmax] at its connected bus. Any deficit between lmax and the served load is treated as unserved demand and penalized at the global demand_fail_cost. When expcap and expmod are non-null the solver may invest in additional load capacity.

Public functions

auto set_attrs(this auto&& self, auto&& attrs) -> auto&
Sets the demand attributes from a DemandAttrs object.

Public variables

OptActive active
Activation status (default: active)
OptTRealFieldSched annual_capcost
Annualized investment cost [$/MW-year].
OptTRealFieldSched annual_derating
Annual capacity derating factor [p.u./year].
SingleId bus
Bus ID where the demand is connected.
OptTRealFieldSched capacity
Installed demand capacity [MW].
OptTRealFieldSched capmax
Absolute maximum capacity after expansion [MW].
OptTRealFieldSched ecost
Energy-shortage cost [$/MWh].
OptTRealFieldSched emin
Minimum energy that must be served per stage [MWh].
OptTRealFieldSched expcap
Capacity added per expansion module [MW].
OptTRealFieldSched expmod
Maximum number of expansion modules [dimensionless].
OptTRealFieldSched fcost
Demand curtailment cost [$/MWh].
OptTBRealFieldSched lmax
Maximum served load [MW].
OptTRealFieldSched lossfactor
Network loss factor [p.u.].
Name name
Descriptive name.
OptName type
Optional demand type tag (e.g. "residential", "industrial")
Uid uid
Unique identifier.

Function documentation

auto& gtopt::Demand::set_attrs(this auto&& self, auto&& attrs)

Sets the demand attributes from a DemandAttrs object.

Parameters
self The demand object to update (deduced; supports const/non-const).
attrs The attribute object to transfer values from
Returns Reference to the updated demand object