gtopt::Generator struct

Represents a generation unit (thermal, renewable, hydro) at a bus.

A generator injects active power p ∈ [pmin, pmax] at its connected bus. The LP objective includes gcost × power × duration for operational cost. When expcap and expmod are non-null the solver may invest in additional capacity modules at cost annual_capcost per module per year.

Public functions

auto set_attrs(this auto&& self, auto&& attrs) -> auto&
Sets generator attributes from a GeneratorAttrs 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 generator is connected.
OptTRealFieldSched capacity
Installed generation capacity [MW].
OptTRealFieldSched capmax
Absolute maximum capacity after expansion [MW].
OptTRealFieldSched expcap
Capacity added per expansion module [MW].
OptTRealFieldSched expmod
Maximum number of expansion modules [dimensionless].
OptTRealFieldSched gcost
Variable generation cost [$/MWh].
OptTRealFieldSched lossfactor
Network loss factor [p.u.].
Name name
Generator name.
OptTBRealFieldSched pmax
Maximum active power output [MW].
OptTBRealFieldSched pmin
Minimum active power output [MW].
OptName type
Uid uid
Unique identifier.

Function documentation

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

Sets generator attributes from a GeneratorAttrs object.

Parameters
self The generator object to update (deduced; supports const/non-const).
attrs Generator attributes to be set
Returns Reference to this Generator object

Example usage:

Generator gen;
GeneratorAttrs attrs;
attrs.bus = 1;
attrs.pmax = 100.0;
gen.set_attrs(std::move(attrs));
// gen.bus should now be 1, and attrs.bus should be empty

Variable documentation

OptName gtopt::Generator::type

Optional generator type tag (e.g. "thermal", "hydro", "solar")