Harmony
HARMONic stabilitY assessment of PE-penetrated power systems
Loading...
Searching...
No Matches
Examples

Runnable demonstration programs under src/examples/. More...

Files

file  Examples.h
 Declarations for runnable demonstration programs.
 

Functions

void example_OPF_single_area (bool plotting_enabled=true)
 Single-area hybrid AC–DC optimal power flow case.
 
void example_OPF_csv (bool plotting_enabled=true)
 OPF case driven by CSV network data.
 
void example_OPF_ac (bool plotting_enabled=true)
 AC-only OPF from bundled CSV case data.
 
void example_OPF_double_area (bool plotting_enabled=true)
 Double-area hybrid OPF demonstration.
 
void example_OPF_csv_1 (bool plotting_enabled=true)
 Variant OPF case from CSV data.
 
void example_OPF_PV (bool plotting_enabled=true)
 OPF study including a PV plant.
 
void example_OPF_WT (bool plotting_enabled=true)
 OPF study including a wind-turbine plant.
 
void example_DQsym_math_operations (bool plotting_enabled=true)
 Validate core dynamic-phasor (DQsym) math operations.
 
void example_DQsym_DSSS2 (bool plotting_enabled=true)
 DQsym switching / DSSS demonstration.
 
void example_DQsym_RLC (bool plotting_enabled=true)
 Simple RLC circuit in the DQsym framework.
 
void example_DQsym_Simple_MMC (bool plotting_enabled=true)
 Simplified MMC model in the DQsym solver.
 
void example_DQsym_validation ()
 DQsym validation routines (header declaration only).
 
void example_state_space ()
 Build state-space (A, B, C, D) matrices for an RLC network.
 
void example_generator (bool plotting_enabled=true)
 Generator element demonstration.
 
void example_MMC (bool plotting_enabled=true)
 MMC equilibrium, ABCD, Y-matrix, and eigenvalue study.
 
void example_WT_type_3 (bool plotting_enabled=true)
 Type-3 wind-turbine model demonstration.
 
void example_WT_type_4 (bool plotting_enabled=true)
 Type-4 wind-turbine model demonstration.
 
void example_PV_plant (bool plotting_enabled=true)
 Photovoltaic plant model demonstration.
 
void example_OHL (bool plotting_enabled=true)
 Overhead transmission line geometry and Y-parameter sweep.
 
void example_cable (bool plotting_enabled=true)
 Underground cable layers and Y-parameter sweep.
 
void example_transformer ()
 Transformer topologies and Y-parameters.
 
void example_constructors ()
 Instantiate basic element types via constructors.
 
void example_visuals (bool plotting_enabled=true)
 Plotting and visualization utilities.
 
void example_stability_check (bool plotting_enabled=true)
 Full AC–DC hybrid stability study.
 
void example_admittance_parameters ()
 Equivalent admittance parameter utilities.
 
void example_point2point_case ()
 Point-to-point HVDC-style OPF case.
 

Detailed Description

Runnable demonstration programs under src/examples/.

Function Documentation

◆ example_admittance_parameters()

void example_admittance_parameters ( )
extern

Equivalent admittance parameter utilities.

Equivalent admittance parameter utilities.

This function creates a simple circuit with a PI section element, computes its Y-parameters over a frequency range, and plots the results.

References Element::compute_y_parameters(), and Element::setTransformation().

◆ example_cable()

void example_cable ( bool  plotting_enabled = true)
extern

Underground cable layers and Y-parameter sweep.

Parameters
plotting_enabledEnable result plots.

References Element::plotYParameters(), Cable::printElementValues(), and Element::writeFile().

◆ example_constructors()

void example_constructors ( )
extern

Instantiate basic element types via constructors.

References Element::writeFile().

◆ example_DQsym_DSSS2()

void example_DQsym_DSSS2 ( bool  plotting_enabled = true)
extern

DQsym switching / DSSS demonstration.

Parameters
plotting_enabledEnable result plots.

References dqn2abc_groups_at_time(), DQsym::DSSS(), plot_abc_groups_implot(), and write_file().

◆ example_DQsym_math_operations()

void example_DQsym_math_operations ( bool  plotting_enabled = true)
extern

Validate core dynamic-phasor (DQsym) math operations.

Parameters
plotting_enabledEnable result plots.

References dq_add(), dq_integrate(), dq_multiply(), dq_subtract(), DQsym::DSSS(), plot_abc_waveforms_implot(), simulate_dqn2abc(), ABCResult::t, and ABCResult::Xabc.

◆ example_DQsym_RLC()

void example_DQsym_RLC ( bool  plotting_enabled = true)
extern

Simple RLC circuit in the DQsym framework.

Parameters
plotting_enabledEnable result plots.

References dqn2abc_groups_at_time(), DQsym::DSSS(), plot_abc_groups_implot(), and write_file().

◆ example_DQsym_Simple_MMC()

◆ example_DQsym_validation()

void example_DQsym_validation ( )
extern

DQsym validation routines (header declaration only).

◆ example_generator()

void example_generator ( bool  plotting_enabled = true)
extern

Generator element demonstration.

Parameters
plotting_enabledEnable result plots.

References Element::plotYParameters().

◆ example_MMC()

◆ example_OHL()

void example_OHL ( bool  plotting_enabled)
extern

Overhead transmission line geometry and Y-parameter sweep.

Parameters
plotting_enabledEnable result plots.

Overhead transmission line geometry and Y-parameter sweep.

This function demonstrates how to create an overhead line with specific geometric and material properties, compute its electrical parameters, and analyze its behavior over a frequency range.

References Element::plotYParameters(), and Element::writeFile().

◆ example_OPF_ac()

void example_OPF_ac ( bool  plotting_enabled = true)
extern

AC-only OPF from bundled CSV case data.

Parameters
plotting_enabledEnable result plots.

References PowerFlow::solve_opf().

◆ example_OPF_csv()

void example_OPF_csv ( bool  plotting_enabled = true)
extern

OPF case driven by CSV network data.

Parameters
plotting_enabledEnable result plots.

References PowerFlow::solve_opf().

◆ example_OPF_csv_1()

void example_OPF_csv_1 ( bool  plotting_enabled = true)
extern

Variant OPF case from CSV data.

Parameters
plotting_enabledEnable result plots.

References PowerFlow::solve_opf().

◆ example_OPF_double_area()

void example_OPF_double_area ( bool  plotting_enabled = true)
extern

Double-area hybrid OPF demonstration.

Parameters
plotting_enabledEnable result plots.
  • -------— 0 Set Network Object -------— *‍/
  • ----— 1.1 Create AC Buses (Area 1) --— *‍/
  • ----— 1.2 Create AC Buses (Area 2) --— *‍/
  • ----— 1.3 Add AC Loads (Area 1) --— *‍/
  • ----— 1.4 Add AC Loads (Area 2) --— *‍/
  • ----— 1.5 Add AC Generators (Area 1) --— *‍/
  • ----— 1.6 Add AC Generators (Area 2) --— *‍/
  • ----— 1.7 Add AC Branches (Area 1) --— *‍/
  • ----— 1.8 Add AC Branches (Area 2) --— *‍/
  • ---— 2.1 Create DC Buses -— *‍/
  • ----— 2.2 Add DC Branches --— *‍/
  • ----— 2.3 Add MMC Converters --— *‍/

*--— 3 OPF Implementatiopn --— *‍/

References Network::connectElementToBus(), PowerFlow::make_OPF(), omega, and Element::setOPFInfo().

◆ example_OPF_PV()

void example_OPF_PV ( bool  plotting_enabled = true)
extern

OPF study including a PV plant.

Parameters
plotting_enabledEnable result plots.

References Network::connectElementToBus(), PowerFlow::make_OPF(), and omega.

◆ example_OPF_single_area()

void example_OPF_single_area ( bool  plotting_enabled = true)
extern

Single-area hybrid AC–DC optimal power flow case.

Parameters
plotting_enabledEnable result plots.
  • -------— 0 Set Network Object -------— *‍/
  • -------— 1.1 Create AC Buses -------— *‍/
  • -------— 1.2 Add AC Loads (~2 GW total, R-only equivalent at 345 kV) -------— *‍/
  • -------— 1.3 Add AC Generators -------— *‍/
  • -------— 1.4 Add Branches -------— *‍/
  • -------— 2.1 Create DC Buses -------— *‍/
  • -------— 2.2 Create DC Branches -------— *‍/
  • -------— 2.3 Create Converters (2 GW hybrid link) -------— *‍/

*--— 3 OPF Implementatiopn --— *‍/

References Network::connectElementToBus(), PowerFlow::make_OPF(), omega, and Element::setOPFInfo().

◆ example_OPF_WT()

void example_OPF_WT ( bool  plotting_enabled = true)
extern

OPF study including a wind-turbine plant.

Parameters
plotting_enabledEnable result plots.

References Network::connectElementToBus(), PowerFlow::make_OPF(), and omega.

◆ example_point2point_case()

void example_point2point_case ( )
extern

Point-to-point HVDC-style OPF case.

  • -------— 0 Set Network Object -------— *‍/
  • -------— 1.1 Create AC Buses -------— *‍/
  • -------— 1.2 Add AC Loads -------— *‍/
  • -------— 1.3 Add AC Generators -------— *‍/

Generator 1

  • -------— 1.4 Add Branches -------— *‍/
  • -------— 1.5 Add Converter Transformers -------— *‍/
  • -------— 2.1 Create DC Buses -------— *‍/
  • -------— 2.2 Create DC Buses -------— *‍/
  • -------— 2.3 Create Converters -------— *‍/

*--— 3 OPF Implementatiopn --— *‍/

References Network::connectElementToBus(), PowerFlow::make_OPF(), omega, and Element::setOPFInfo().

◆ example_PV_plant()

void example_PV_plant ( bool  plotting_enabled = true)
extern

Photovoltaic plant model demonstration.

Parameters
plotting_enabledEnable result plots.

References Element::plotYParameters().

◆ example_stability_check()

void example_stability_check ( bool  plotting_enabled = true)
extern

Full AC–DC hybrid stability study.

Parameters
plotting_enabledEnable result plots.
  • -------— 0 Set Network Object -------— *‍/
  • -------— 1.1 Create AC Buses -------— *‍/
  • -------— 1.2 Add AC Loads -------— *‍/
  • -------— 1.3 Add AC Generators -------— *‍/

Generator 1

  • -------— 1.4 Add Branches -------— *‍/
  • -------— 2.1 Create DC Buses -------— *‍/
  • -------— 2.2 Create DC Buses -------— *‍/
  • -------— 2.3 Create Converters -------— *‍/

*--— 3 OPF Implementatiopn --— *‍/

References StabilityEstimate::add_areas(), StabilityEstimate::bodeplotTF(), StabilityEstimate::compute_transfer_function(), MMC::compute_y_parameters(), Network::connectElementToBus(), PowerFlow::make_OPF(), StabilityEstimate::nyquistplotTF(), omega, Element::plotYParameters(), Element::setOPFInfo(), and vectorToMatrix().

◆ example_state_space()

◆ example_transformer()

void example_transformer ( )
extern

Transformer topologies and Y-parameters.

References Element::writeFile().

◆ example_visuals()

void example_visuals ( bool  plotting_enabled = true)
extern

Plotting and visualization utilities.

Parameters
plotting_enabledEnable result plots.

References Element::plotYParameters(), and Element::writeFile().

◆ example_WT_type_3()

void example_WT_type_3 ( bool  plotting_enabled = true)
extern

Type-3 wind-turbine model demonstration.

Parameters
plotting_enabledEnable result plots.

References Element::plotYParameters(), and Element::writeFile().

◆ example_WT_type_4()

void example_WT_type_4 ( bool  plotting_enabled = true)
extern

Type-4 wind-turbine model demonstration.

Parameters
plotting_enabledEnable result plots.

References Element::plotYParameters().