Configuration Setup
For further information on this topic, please see the Power System Model section of the Manual.
Base Units
Input Units
Default Settings
To load power system model API functionalities into the current scope, utilize the following command:
using JuliaGrid
Base Units
JuliaGrid.@base
— Macro@base(system::PowerSystem, power, voltage)
By default, the units for base power and base voltages are set to volt-ampere (VA) and volt (V), but you can modify the prefixes using the macro.
Prefixes must be specified according to the SI prefixes and should be included with the unit of power
(VA) or unit of voltage
(V). Keep in mind that the macro must be used after creating the composite type PowerSystem
.
Example
system = powerSystem("case14.h5")
@base(system, MVA, kV)
Input Units
JuliaGrid.@power
— Macro@power(active, reactive, apparent)
JuliaGrid stores all data related with powers in per-units, and these cannot be altered. However, the power units of the built-in functions used to add or modified power system elements can be modified using the macro.
Prefixes must be specified according to the SI prefixes and should be included with the unit of active
power (W), reactive
power (VAr), or apparent
power (VA). Also it is a possible to combine SI units with/without prefixes with per-units (pu).
Changing the unit of active
power is reflected in the following quantities:
addBus!
,updateBus!
,@bus
:active
,conductance
;addBranch!
,updateBranch!
,@branch
: iftype = 2
:longTerm
,shortTerm
,emergency
;addGenerator!
,updateGenerator!
,@generator
:active
,minActive
,maxActive
,lowActive
,upActive
,loadFollowing
,reserve10min
,reserve30min
;cost!
: ifactive
:piecewise
,polynomial
;addWattmeter!
,updateWattmeter!
:active
,variance
;@wattmeter
: ,varianceBus
,varianceFrom
,varianceTo
.
Changing the unit of reactive
power unit is reflected in the following quantities:
addBus!
,updateBus!
,@bus
:reactive
,susceptance
;addGenerator!
,updateGenerator!
,@generator
:reactive
,minReactive
,maxReactive
,minLowReactive
,maxLowReactive
,minUpReactive
,maxUpReactive
,reactiveTimescale
;cost!
: ifreactive
:piecewise
,polynomial
;addVarmeter!
,updateVarmeter!
:reactive
,variance
;@varmeter
:varianceBus
,varianceFrom
,varianceTo
.
Changing the unit of apparent
power unit is reflected in the following quantities:
addBranch!
,updateBranch!
,@branch
: iftype = 1
ortype = 3
:longTerm
,shortTerm
,emergency
.
Example
@power(MW, kVAr, VA)
JuliaGrid.@voltage
— Macro@voltage(magnitude, angle, base)
JuliaGrid stores all data related with voltages in per-units and radians, and these cannot be altered. However, the voltage magnitude and angle units of the built-in functions used to add or modified power system elements can be modified using the macro.
The prefixes must adhere to the SI prefixes and should be specified along with the unit of voltage, either magnitude
(V) or base
(V). Alternatively, the unit of voltage magnitude
can be expressed in per-unit (pu). The unit of voltage angle
should be in radians (rad) or degrees (deg).
Changing the unit of voltage magnitude
is reflected in the following quantities:
addBus!
,updateBus!
,@bus
:magnitude
,minMagnitude
,maxMagnitude
;addGenerator!
,updateGenerator!
,@generator
:magnitude
;addVoltmeter!
,updateVoltmeter!
,@voltmeter
:magnitude
,variance
;addPmu!
,updatePmu!
: ifbus
:magnitude
,varianceMagnitude
;@pmu
:varianceMagnitudeBus
.
Changing the unit of voltage angle
is reflected in the following quantities:
addBus!
,updateBus!
,@bus
:angle
;addBranch!
,updateBranch!
,@branch
:shiftAngle
,minDiffAngle
,maxDiffAngle
;addPmu!
,updatePmu!
: ifbus
:angle
,varianceAngle
;@pmu
:varianceAngleBus
.
Changing the unit prefix of voltage base
is reflected in the following quantity:
addBus!
,updateBus!
,@bus
:base
.
Example
@voltage(pu, deg, kV)
JuliaGrid.@current
— Macro@current(magnitude, angle)
JuliaGrid stores all data related with currents in per-units and radians, and these cannot be altered. However, the current magnitude and angle units of the built-in functions used to add or modified measurement devices can be modified using the macro.
The prefixes must adhere to the SI prefixes and should be specified along with the unit of current magnitude
(V). Alternatively, the unit of current magnitude
can be expressed in per-unit (pu). The unit of current angle should be in radians (rad) or degrees (deg).
Changing the unit of current magnitude
is reflected in the following quantities:
addAmmeter!
,updateAmmeter!
:magnitude
,variance
;@ammeter
:varianceFrom
,varianceTo
;addPmu!
,updatePmu!
: iffrom
orto
:magnitude
,varianceMagnitude
;@pmu
:varianceMagnitudeFrom
,varianceMagnitudeTo
.
Changing the unit of current angle
is reflected in the following quantities:
addPmu!
,updatePmu!
: iffrom
orto
:angle
,varianceAngle
;@pmu
:varianceAngleFrom
,varianceAngleTo
.
Example
@current(pu, deg)
JuliaGrid.@parameter
— Macro@parameter(impedance, admittance)
JuliaGrid stores all data related with impedances and admittancies in per-units, and these cannot be altered. However, units of impedance and admittance of the built-in functions used to add or modified power system elements can be modified using the macro.
Prefixes must be specified according to the SI prefixes and should be included with the unit of impedance
(Ω) or unit of admittance
(S). The second option is to define the units in per-unit (pu).
In the case where impedance and admittance are being used in SI units (Ω and S) and these units are related to the transformer, the assignment must be based on the primary side of the transformer.
Changing the units of impedance
is reflected in the following quantities in specific functions:
addBranch!
,updateBranch!
,@branch
:resistance
,reactance
.
Changing the units of admittance
is reflected in the following quantities:
addBranch!
,updateBranch!
,@branch
:conductance
,susceptance
.
Example
@parameter(Ω, pu)
Default Settings
JuliaGrid.@default
— Macro@default(mode)
The macro is designed to reset various settings to their default values.
The mode
argument can take on the following values:
unit
: resets all units to their default settings;power
: sets active, reactive, and apparent power to per-units;voltage
: sets voltage magnitude to per-unit and voltage angle to radian;parameter
: sets impedance and admittance to per-units;template
: resets bus, branch, generator, voltmeter, ammeter, wattmeter, varmeter, and pmu templates to their default settings;bus
: resets the bus template to its default settings;branch
: resets the branch template to its default settings;generator
: resets the generator template to its default settings;voltmeter
: resets the voltmeter template to its default settings;ammeter
: resets the ammeter template to its default settings;wattmeter
: resets the wattmeter template to its default settings;varmeter
: resets the varmeter template to its default settings;pmu
: resets the pmu template to its default settings.
Example
@default(unit)