from_matpower#

andes.interop.matpower.from_matpower(m, varname, system=None)[source]#

Retrieve a MATPOWER mpc case from a MATLAB/Octave instance.

Parameters:
mMATLAB/Octave instance

Instance from which to retrieve the MATPOWER case.

varnamestr

Name of the variable in the MATPOWER MPC format to retrieve.

Returns:
System

System from the mpc case. The system will not have been set up.

Examples

To retrieve a case from MATPOWER from instance m, do the following:

from andes.interop.matpower import start_instance, to_matpower, from_matpower

system = from_matpower(m, 'mpc')

One can create an Excel file with dynamic data only and use the xlsx parser to load data into system:

from andes.io import xlsx

xlsx.read(system, andes.get_case('ieee14/ieee14_dyn_only.xlsx'))

The ieee14_dyn_only.xlsx is an example spreadsheet that only contains dynamic components. One will need to create the idx correctly for dynamic components to match these from the MATPOWER case. If not sure about the indices, one can save the ANDES system to an Excel file, using:

xlsx.write(system, 'system_static.xlsx')