mp.task_pf_legacy

class mp.task_pf_legacy

Bases: mp.task_pf, mp.task_shared_legacy

mp.task_pf_legacy - MATPOWER task for legacy power flow (PF).

Adds functionality needed by the legacy MATPOWER framework to the task implementation for the power flow problem. This consists of pre-processing some input data and exporting and packaging result data.

mp.task_pf Methods:

See also mp.task_pf, mp.task, mp.task_shared_legacy.

Method Summary
run_pre(d, mpopt)

Pre-process inputs that are for legacy framework only.

[d, mpopt] = task.run_pre(d, mpopt)
Inputs:
  • d – data source specification, currently assumed to be a MATPOWER case name or case struct (mpc)

  • mpopt (struct) – MATPOWER options struct

Outputs:
  • d – updated value of corresponding input

  • mpopt (struct) – updated value of corresponding input

Call run_pre_legacy() method before calling parent.

run_post(mm, nm, dm, mpopt)

Export results back to data model source.

task.run_post(mm, nm, dm, mpopt)
Inputs:
Output:

task (mp.task) – task object

Calls mp.dm_converter.export() and saves the result in the data model source property.

legacy_post_run(mpopt)

Post-process legacy framework outputs.

[results, success] = task.legacy_post_run(mpopt)
Input:

mpopt (struct) – MATPOWER options struct

Outputs:
  • results (struct) – results struct for legacy MATPOWER framework, see Table 4.1 in legacy MATPOWER User's Manual.

  • success (integer) – 1 - succeeded, 0 - failed

Extract results and success and save the task object in results.task before returning.