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.@baseMacro
@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)
source

Input Units

JuliaGrid.@powerMacro
@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:

Changing the unit of reactive power unit is reflected in the following quantities:

Changing the unit of apparent power unit is reflected in the following quantities:

Example

@power(MW, kVAr, VA)
source
JuliaGrid.@voltageMacro
@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:

Changing the unit of voltage angle is reflected in the following quantities:

Changing the unit prefix of voltage base is reflected in the following quantity:

Example

@voltage(pu, deg, kV)
source
JuliaGrid.@currentMacro
@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:

Changing the unit of current angle is reflected in the following quantities:

Example

@current(pu, deg)
source
JuliaGrid.@parameterMacro
@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:

Changing the units of admittance is reflected in the following quantities:

Example

@parameter(Ω, pu)
source

Default Settings

JuliaGrid.@defaultMacro
@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)
source