Division of the code#

The code of the reactive OPF is divided into several files, each serving a specific function:

  • reactiveopf.dat defines the network data files imported (files with ampl_ prefix), and the files used to configure the run (files with param_ prefix).
    See Inputs.

  • iidm_importer.mod, or_param_importer.mod and commons.mod define the sets and parameters of the optimization.

  • connected_component.mod, dcopf.mod and acopf.mod define the optimization problems solved in reactiveopf.run.
    See Slack bus and main connex components, DC optimal power flow and AC optimal power flow, respectively.

  • connected_component.run, dcopf.run, acopf_preprocessing.run and acopf.run orchestrate the optimization and its post-processing.

  • reactiveopfoutput.mod exports result files if the execution of reactiveopf.run is successful.
    See Outputs.

  • reactiveopfexit.run contains the code executed when the process fails.
    Refer to section 8.2.

  • reactiveopf.run executes the AMPL process of OpenReac, calling the previous scripts.