Setup and Print
For further information on this topic, please see the Power System Model or Measurement Model sections of the Manual. Various macros are available for setting units or defining label types. Print functions allow results to be displayed in the REPL, or users can redirect the output to a file.
To load power system model API functionalities into the current scope, utilize the following command:
using JuliaGrid
Base Units
Input Units
Configuration Settings
Print Power System Data
Print Power System Summary
Print Measurement Data
Print Constraint Data
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 users 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 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:
active
, conductance
;
addBranch!
,updateBranch!
,@branch
: iftype = 2
:minFromBus
,maxFromBus
,minToBus
,maxToBus
;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
,reactiveRamp
;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
:minFromBus
,maxFromBus
,minToBus
,maxToBus
.
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:
addBranch!
,updateBranch!
,@branch
: iftype = 3
:minFromBus
,maxFromBus
,minToBus
,maxToBus
.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)
Configuration Settings
JuliaGrid.@config
— Macro@config(label, verbose)
The macro defines general configuration settings for JuliaGrid.
By default, JuliaGrid stores all labels as strings in ordered dictionaries. However, users can choose to store labels as integers, which can be a more efficient option for large-scale systems.
Users can also adjust the level of printed information for the algorithms used in JuliaGrid. The verbose
setting is multilevel and can take the following values:
verbose = 0
: Silent mode (default).verbose = 1
: Prints exit messages.verbose = 2
: Prints algorithm solver progress data.verbose = 3
: Prints detailed data.
Examples
Set labels as integers and print only basic data:
@config(label = Integer, verbose = 1)
Set labels as strings and enable detailed data printing:
@config(label = String, verbose = 3)
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
: Restores all units to their default settings.power
: Converts active, reactive, and apparent power to per-unit values.voltage
: Expresses voltage magnitude in per-unit and voltage angle in radians.parameter
: Converts impedance and admittance to per-unit values.bus
: Resets the bus template to its default configuration.branch
: Resets the branch template to its default configuration.generator
: Resets the generator template to its default configuration.voltmeter
: Resets the voltmeter template to its default configuration.ammeter
: Resets the ammeter template to its default configuration.wattmeter
: Resets the wattmeter template to its default configuration.varmeter
: Resets the varmeter template to its default configuration.pmu
: Resets the PMU template to its default configuration.template
: Restores all templates and configurations to their default settings.
Example
@default(template)
Print Power System Data
JuliaGrid.printBusData
— FunctionprintBusData(analysis::Analysis, [io::IO];
label, fmt, width, show, delimiter, title, header, footer, repeat, style)
The function prints voltages, powers, and currents related to buses. Optionally, an IO
may be passed as the last argument to redirect the output.
Keywords
The following keywords control the printed data:
label
: Prints only the data for the corresponding bus.fmt
: Specifies the preferred numeric formats or alignments for the columns.width
: Specifies the preferred widths for the columns.show
: Toggles the printing of the columns.delimiter
: Sets the column delimiter.title
: Toggles the printing of the table title.header
: Toggles the printing of the header.footer
: Toggles the printing of the footer.repeat
: Prints the header again after a specified number of lines have been printed.style
: Prints either a stylish table or a simple table suitable for easy export.
The function requires Julia 1.10 or later.
Examples
Print data for all buses:
system = powerSystem("case14.h5")
analysis = newtonRaphson(system)
powerFlow!(analysis; power = true)
fmt = Dict("Power Demand" => "%.2f", "Voltage Magnitude" => "%.2f", "Label" => "%s")
show = Dict("Power Injection" => false, "Power Generation Reactive" => false)
printBusData(analysis; fmt, show, repeat = 10)
Print data for specific buses:
system = powerSystem("case14.h5")
analysis = newtonRaphson(system)
powerFlow!(analysis; power = true)
delimiter = " "
width = Dict("Voltage" => 9, "Power Injection Active" => 9)
printBusData(analysis; label = 2, delimiter, width, title = true, header = true)
printBusData(analysis; label = 10, delimiter, width)
printBusData(analysis; label = 12, delimiter, width, footer = true)
JuliaGrid.printBranchData
— FunctionprintBranchData(analysis::Analysis, [io::IO];
label, fmt, width, show, delimiter, title, header, footer, repeat, style)
The function prints powers and currents related to branches. Optionally, an IO
may be passed as the last argument to redirect the output.
Keywords
The following keywords control the printed data:
label
: Prints only the data for the corresponding branch.fmt
: Specifies the preferred numeric formats or alignments for the columns.width
: Specifies the preferred widths for the columns.show
: Toggles the printing of the columns.delimiter
: Sets the column delimiter.title
: Toggles the printing of the table title.header
: Toggles the printing of the header.footer
: Toggles the printing of the footer.repeat
: Prints the header again after a specified number of lines have been printed.style
: Prints either a stylish table or a simple table suitable for easy export.
The function requires Julia 1.10 or later.
Examples
Print data for all branches:
system = powerSystem("case14.h5")
analysis = newtonRaphson(system)
powerFlow!(analysis; power = true)
fmt = Dict("Shunt Power" => "%.2f", "Series Power Reactive" => "%.2f")
show = Dict("From-Bus Power" => false, "To-Bus Power Reactive" => false)
printBranchData(analysis; fmt, show, repeat = 11, title = false)
Print data for specific branches:
system = powerSystem("case14.h5")
analysis = newtonRaphson(system)
powerFlow!(analysis; power = true)
delimiter = " "
width = Dict("From-Bus Power" => 9, "To-Bus Power Active" => 9)
printBranchData(analysis; label = 2, delimiter, width, header = true)
printBranchData(analysis; label = 12, delimiter, width)
printBranchData(analysis; label = 14, delimiter, width, footer = true)
JuliaGrid.printGeneratorData
— FunctionprintGeneratorData(analysis::Analysis, [io::IO];
label, fmt, width, show, delimiter, title, header, footer, repeat, style)
The function prints powers related to generators. Optionally, an IO
may be passed as the last argument to redirect the output.
Keywords
The following keywords control the printed data:
label
: Prints only the data for the corresponding generator.fmt
: Specifies the preferred numeric formats or alignments for the columns.width
: Specifies the preferred widths for the columns.show
: Toggles the printing of the columns.delimiter
: Sets the column delimiter.title
: Toggles the printing of the table title.header
: Toggles the printing of the header.footer
: Toggles the printing of the footer.repeat
: Prints the header again after a specified number of lines have been printed.style
: Prints either a stylish table or a simple table suitable for easy export.
The function requires Julia 1.10 or later.
Examples
Print data for all generators:
system = powerSystem("case14.h5")
analysis = newtonRaphson(system)
powerFlow!(analysis; power = true)
fmt = Dict("Power Output Active" => "%.2f")
show = Dict("Power Output Reactive" => false)
printGeneratorData(analysis; fmt, show, title = false)
Print data for specific generators:
system = powerSystem("case14.h5")
analysis = newtonRaphson(system)
powerFlow!(analysis; power = true)
delimiter = " "
width = Dict("Power Output Active" => 7)
printGeneratorData(analysis; label = 1, delimiter, width, header = true)
printGeneratorData(analysis; label = 4, delimiter, width)
printGeneratorData(analysis; label = 5, delimiter, width, footer = true)
Print Power System Summary
JuliaGrid.printBusSummary
— FunctionprintBusSummary(analysis::Analysis, [io::IO];
fmt, width, show, delimiter, title, header, footer, style)
The function prints a summary of the electrical quantities related to buses. Optionally, an IO
may be passed as the last argument to redirect the output.
Keywords
The following keywords control the printed data:
fmt
: Specifies the preferred numeric formats or alignments for the columns.width
: Specifies the preferred widths for the columns.show
: Toggles the printing of the columns.delimiter
: Sets the column delimiter.title
: Toggles the printing of the table title.header
: Toggles the printing of the header.footer
: Toggles the printing of the footer.style
: Prints either a stylish table or a simple table suitable for easy export.
The function requires Julia 1.10 or later.
Example
system = powerSystem("case14.h5")
analysis = newtonRaphson(system)
powerFlow!(analysis; power = true)
show = Dict("In-Use" => false)
printBusSummary(analysis; show, delimiter = " ", title = false)
JuliaGrid.printBranchSummary
— FunctionprintBranchSummary(analysis::Analysis, [io::IO];
fmt, width, show, delimiter, title, header, footer, style))
The function prints a summary of the electrical quantities related to branches. Optionally, an IO
may be passed as the last argument to redirect the output.
Keywords
The following keywords control the printed data:
fmt
: Specifies the preferred numeric formats or alignments for the columns.width
: Specifies the preferred widths for the columns.show
: Toggles the printing of the columns.delimiter
: Sets the column delimiter.title
: Toggles the printing of the table title.header
: Toggles the printing of the header.footer
: Toggles the printing of the footer.style
: Prints either a stylish table or a simple table suitable for easy export.
The function requires Julia 1.10 or later.
Example
system = powerSystem("case14.h5")
analysis = newtonRaphson(system)
powerFlow!(analysis; power = true)
show = Dict("Total" => false)
printBranchSummary(analysis; show, delimiter = " ", title = false)
JuliaGrid.printGeneratorSummary
— FunctionprintGeneratorSummary(analysis::Analysis, [io::IO];
fmt, width, show, delimiter, title, header, footer, style)
The function prints a summary of the electrical quantities related to generators. Optionally, an IO
may be passed as the last argument to redirect the output.
Keywords
The following keywords control the printed data:
fmt
: Specifies the preferred numeric formats or alignments for the columns.width
: Specifies the preferred widths for the columns.show
: Toggles the printing of the columns.delimiter
: Sets the column delimiter.title
: Toggles the printing of the table title.header
: Toggles the printing of the header.footer
: Toggles the printing of the footer.style
: Prints either a stylish table or a simple table suitable for easy export.
The function requires Julia 1.10 or later.
Example
system = powerSystem("case14.h5")
analysis = newtonRaphson(system)
powerFlow!(analysis; power = true)
show = Dict("Minimum" => false)
printGeneratorSummary(analysis; show, delimiter = " ", title = false)
Print Measurement Data
JuliaGrid.printVoltmeterData
— FunctionprintVoltmeterData(data::Union{Measurement, Analysis}, [io::IO];
label, fmt, width, show, delimiter, title, header, footer, repeat, style)
The function prints data related to voltmeters. Optionally, an IO
may be passed as the last argument to redirect the output. Users may choose to print only measurement data by passing the Measurement
type, or both measurement data and analysis results by passing the Analysis
type.
Keywords
The following keywords control the printed data:
label
: Prints only the data for the corresponding voltmeter.fmt
: Specifies the preferred numeric formats or alignments for the columns.width
: Specifies the preferred widths for the columns.show
: Toggles the printing of the columns.delimiter
: Sets the column delimiter.title
: Toggles the printing of the table title.header
: Toggles the printing of the header.footer
: Toggles the printing of the footer.repeat
: Prints the header again after a specified number of lines have been printed.style
: Prints either a stylish table or a simple table suitable for easy export.
The function requires Julia 1.10 or later.
Examples
Print data for all voltmeters:
system, monitoring = ems("case14.h5", "monitoring.h5")
analysis = gaussNewton(monitoring)
stateEstimation!(analysis)
fmt = Dict("Voltage Magnitude" => "%.2f", "Voltage Magnitude Estimate" => "%.6f")
show = Dict("Voltage Magnitude Residual" => false)
printVoltmeterData(analysis; fmt, show, delimiter = " ", repeat = 10)
Print data for specific voltmeters:
system, monitoring = ems("case14.h5", "monitoring.h5")
analysis = gaussNewton(monitoring)
stateEstimation!(analysis)
width = Dict("Voltage Magnitude Estimate" => 11)
printVoltmeterData(analysis; label = 1, width, header = true)
printVoltmeterData(analysis; label = 6, width)
printVoltmeterData(analysis; label = 8, width, footer = true)
JuliaGrid.printAmmeterData
— FunctionprintAmmeterData(data::Union{Measurement, Analysis}, [io::IO];
label, fmt, width, show, delimiter, title, header, footer, repeat, style)
The function prints data related to ammeters. Optionally, an IO
may be passed as the last argument to redirect the output. Users may choose to print only measurement data by passing the Measurement
type, or both measurement data and analysis results by passing the Analysis
type.
Keywords
The following keywords control the printed data:
label
: Prints only the data for the corresponding ammeter.fmt
: Specifies the preferred numeric formats or alignments for the columns.width
: Specifies the preferred widths for the columns.show
: Toggles the printing of the columns.delimiter
: Sets the column delimiter.title
: Toggles the printing of the table title.header
: Toggles the printing of the header.footer
: Toggles the printing of the footer.repeat
: Prints the header again after a specified number of lines have been printed.style
: Prints either a stylish table or a simple table suitable for easy export.
The function requires Julia 1.10 or later.
Examples
Print data for all ammeters:
system, monitoring = ems("case14.h5", "monitoring.h5")
analysis = gaussNewton(monitoring)
stateEstimation!(analysis; current = true)
fmt = Dict("Current Magnitude" => "%.2f", "Current Magnitude Estimate" => "%.6f")
show = Dict("Current Magnitude Residual" => false)
printAmmeterData(analysis; fmt, show, delimiter = " ", repeat = 10)
Print data for specific ammeters:
system, monitoring = ems("case14.h5", "monitoring.h5")
analysis = gaussNewton(monitoring)
stateEstimation!(analysis; current = true)
width = Dict("Current Magnitude" => 10)
printAmmeterData(analysis; label = "From 1", width, header = true)
printAmmeterData(analysis; label = "From 4", width)
printAmmeterData(analysis; label = "From 6", width, footer = true)
JuliaGrid.printWattmeterData
— FunctionprintWattmeterData(data::Union{Measurement, Analysis}, [io::IO];
label, fmt, width, show, delimiter, title, header, footer, repeat, style)
The function prints data related to wattmeters. Optionally, an IO
may be passed as the last argument to redirect the output. Users may choose to print only measurement data by passing the Measurement
type, or both measurement data and analysis results by passing the Analysis
type.
Keywords
The following keywords control the printed data:
label
: Prints only the data for the corresponding wattmeter.fmt
: Specifies the preferred numeric formats or alignments for the columns.width
: Specifies the preferred widths for the columns.show
: Toggles the printing of the columns.delimiter
: Sets the column delimiter.title
: Toggles the printing of the table title.header
: Toggles the printing of the header.footer
: Toggles the printing of the footer.repeat
: Prints the header again after a specified number of lines have been printed.style
: Prints either a stylish table or a simple table suitable for easy export.
The function requires Julia 1.10 or later.
Examples
Print data for all wattmeters:
system, monitoring = ems("case14.h5", "monitoring.h5")
analysis = gaussNewton(monitoring)
stateEstimation!(analysis; power = true)
fmt = Dict("Active Power" => "%.2f", "Active Power Estimate" => "%.6f")
show = Dict("Active Power Status" => false)
printWattmeterData(analysis; fmt, show, delimiter = " ", repeat = 14)
Print data for specific wattmeters:
system, monitoring = ems("case14.h5", "monitoring.h5")
analysis = gaussNewton(monitoring)
stateEstimation!(analysis; power = true)
width = Dict("Active Power Residual" => 11)
printWattmeterData(analysis; label = 2, width, header = true)
printWattmeterData(analysis; label = 5, width)
printWattmeterData(analysis; label = 9, width, footer = true)
JuliaGrid.printVarmeterData
— FunctionprintVarmeterData(data::Union{Measurement, Analysis}, [io::IO];
label, fmt, width, show, delimiter, title, header, footer, repeat, style)
The function prints data related to varmeters. Optionally, an IO
may be passed as the last argument to redirect the output. Users may choose to print only measurement data by passing the Measurement
type, or both measurement data and analysis results by passing the Analysis
type.
Keywords
The following keywords control the printed data:
label
: Prints only the data for the corresponding varmeter.fmt
: Specifies the preferred numeric formats or alignments for the columns.width
: Specifies the preferred widths for the columns.show
: Toggles the printing of the columns.delimiter
: Sets the column delimiter.title
: Toggles the printing of the table title.header
: Toggles the printing of the header.footer
: Toggles the printing of the footer.repeat
: Prints the header again after a specified number of lines have been printed.style
: Prints either a stylish table or a simple table suitable for easy export.
The function requires Julia 1.10 or later.
Examples
Print data for all varmeters:
system, monitoring = ems("case14.h5", "monitoring.h5")
analysis = gaussNewton(monitoring)
stateEstimation!(analysis; power = true)
fmt = Dict("Reactive Power" => "%.2f", "Reactive Power Estimate" => "%.6f")
show = Dict("Reactive Power Status" => false)
printVarmeterData(analysis; fmt, show, delimiter = " ", repeat = 14)
Print data for specific varmeters:
system, monitoring = ems("case14.h5", "monitoring.h5")
analysis = gaussNewton(monitoring)
stateEstimation!(analysis; power = true)
width = Dict("Reactive Power Residual" => 11)
printVarmeterData(analysis; label = 2, width, header = true)
printVarmeterData(analysis; label = 5, width)
printVarmeterData(analysis; label = 9, width, footer = true)
JuliaGrid.printPmuData
— FunctionprintPmuData(data::Union{Measurement, Analysis}, [io::IO];
label, fmt, width, show, delimiter, title, header, footer, repeat, style)
The function prints data related to PMUs. Optionally, an IO
may be passed as the last argument to redirect the output. Users may choose to print only measurement data by passing the Measurement
type, or both measurement data and analysis results by passing the Analysis
type.
Keywords
The following keywords control the printed data:
label
: Prints only the data for the corresponding PMU.fmt
: Specifies the preferred numeric formats or alignments for the columns.width
: Specifies the preferred widths for the columns.show
: Toggles the printing of the columns.delimiter
: Sets the column delimiter.title
: Toggles the printing of the table title.header
: Toggles the printing of the header.footer
: Toggles the printing of the footer.repeat
: Prints the header again after a specified number of lines have been printed.style
: Prints either a stylish table or a simple table suitable for easy export.
The function requires Julia 1.10 or later.
Examples
Print data for all PMUs:
system, monitoring = ems("case14.h5", "monitoring.h5")
analysis = gaussNewton(monitoring)
stateEstimation!(analysis; current = true)
fmt = Dict("Current Magnitude" => "%.2f", "Current Magnitude Variance" => "%.5f")
show = Dict("Current Angle" => false, "Current Magnitude Status" => false)
printPmuData(analysis; fmt, show, delimiter = " ", repeat = 10)
Print data for specific PMUs:
system, monitoring = ems("case14.h5", "monitoring.h5")
analysis = gaussNewton(monitoring)
stateEstimation!(analysis; current = true)
width = Dict("Current Magnitude" => 10, "Current Angle Status" => 8)
printPmuData(analysis; label = "From 1", width, header = true)
printPmuData(analysis; label = "From 4", width)
printPmuData(analysis; label = "From 6", width, footer = true)
Print Constraint Data
JuliaGrid.printBusConstraint
— FunctionprintBusConstraint(analysis::OptimalPowerFlow, [io::IO];
label, fmt, width, show, delimiter, title, header, footer, repeat, style)
The function prints constraint data related to buses. Optionally, an IO
may be passed as the last argument to redirect the output.
Keywords
The following keywords control the printed data:
label
: Prints only the data for the corresponding bus.fmt
: Specifies the preferred numeric formats or alignments for the columns.width
: Specifies the preferred widths for the columns.show
: Toggles the printing of the columns.delimiter
: Sets the column delimiter.title
: Toggles the printing of the table title.header
: Toggles the printing of the header.footer
: Toggles the printing of the footer.repeat
: Prints the header again after a specified number of lines have been printed.style
: Prints either a stylish table or a simple table suitable for easy export.
The function requires Julia 1.10 or later.
Examples
Print data for all buses:
using Ipopt
system = powerSystem("case14.h5")
analysis = acOptimalPowerFlow(system, Ipopt.Optimizer)
powerFlow!(analysis)
fmt = Dict("Active Power Balance" => "%.2e", "Reactive Power Balance Dual" => "%.4e")
show = Dict("Voltage Magnitude" => false, "Reactive Power Balance Solution" => false)
printBusConstraint(analysis; fmt, show, repeat = 10)
Print data for specific buses:
using Ipopt
system = powerSystem("case14.h5")
analysis = acOptimalPowerFlow(system, Ipopt.Optimizer)
powerFlow!(analysis)
delimiter = " "
width = Dict("Voltage Magnitude" => 8, "Active Power Balance Solution" => 12)
printBusConstraint(analysis; label = 2, delimiter, width, header = true)
printBusConstraint(analysis; label = 10, delimiter, width)
printBusConstraint(analysis; label = 14, delimiter, width, footer = true)
JuliaGrid.printBranchConstraint
— FunctionprintBranchConstraint(analysis::OptimalPowerFlow, [io::IO];
label, fmt, width, show, delimiter, title, header, footer, repeat, style)
The function prints constraint data related to branches. Optionally, an IO
may be passed as the last argument to redirect the output.
Keywords
The following keywords control the printed data:
label
: Prints only the data for the corresponding branch.fmt
: Specifies the preferred numeric formats or alignments for the columns.width
: Specifies the preferred widths for the columns.show
: Toggles the printing of the columns.delimiter
: Sets the column delimiter.title
: Toggles the printing of the table title.header
: Toggles the printing of the header.footer
: Toggles the printing of the footer.repeat
: Prints the header again after a specified number of lines have been printed.style
: Prints either a stylish table or a simple table suitable for easy export.
The function requires Julia 1.10 or later.
Examples
Print data for all branches:
using Ipopt
system = powerSystem("case14.h5")
updateBranch!(system; label = 3, minDiffAngle = 0.05, maxDiffAngle = 1.5)
updateBranch!(system; label = 9, minFromBus = 0.1, maxFromBus = 0.3)
analysis = acOptimalPowerFlow(system, Ipopt.Optimizer)
powerFlow!(analysis)
fmt = Dict("Voltage Angle Difference" => "%.2f")
show = Dict("To-Bus Apparent Power Flow Dual" => false)
printBranchConstraint(analysis; fmt, show)
Print data for specific branches:
using Ipopt
system = powerSystem("case14.h5")
updateBranch!(system; label = 3, minDiffAngle = 0.05, maxDiffAngle = 1.5)
updateBranch!(system; label = 9, minFromBus = 0.1, maxFromBus = 0.3)
analysis = acOptimalPowerFlow(system, Ipopt.Optimizer)
powerFlow!(analysis)
delimiter = " "
width = Dict("From-Bus Apparent Power Flow" => 13, "Voltage Angle Difference Dual" => 12)
printBranchConstraint(analysis; label = 3, delimiter, width, header = true)
printBranchConstraint(analysis; label = 9, delimiter, width, footer = true)
JuliaGrid.printGeneratorConstraint
— FunctionprintGeneratorConstraint(analysis::OptimalPowerFlow, [io::IO];
label, fmt, width, show, delimiter, title, header, footer, repeat, style)
The function prints constraint data related to generators. Optionally, an IO
may be passed asn the last argument to redirect the output.
Keywords
The following keywords control the printed data:
label
: Prints only the data for the corresponding generator.fmt
: Specifies the preferred numeric formats or alignments for the columns.width
: Specifies the preferred widths for the columns.show
: Toggles the printing of the columns.delimiter
: Sets the column delimiter.title
: Toggles the printing of the table title.header
: Toggles the printing of the header.footer
: Toggles the printing of the footer.repeat
: Prints the header again after a specified number of lines have been printed.style
: Prints either a stylish table or a simple table suitable for easy export.
The function requires Julia 1.10 or later.
Examples
Print data for all generators:
using Ipopt
system = powerSystem("case14.h5")
analysis = acOptimalPowerFlow(system, Ipopt.Optimizer)
powerFlow!(analysis)
fmt = Dict("Active Power Capability" => "%.2f")
show = Dict("Reactive Power Capability" => false, "Active Power Capability Dual" => false)
printGeneratorConstraint(analysis; fmt, show, repeat = 3)
Print data for specific generator:
using Ipopt
system = powerSystem("case14.h5")
analysis = acOptimalPowerFlow(system, Ipopt.Optimizer)
powerFlow!(analysis)
delimiter = " "
width = Dict("Active Power Capability" => 11, "Reactive Power Capability Dual" => 10)
printGeneratorConstraint(analysis; label = 2, delimiter, width, header = true)
printGeneratorConstraint(analysis; label = 3, delimiter, width)
printGeneratorConstraint(analysis; label = 5, delimiter, width, footer = true)