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

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

mMATLAB/Octave instance

Instance from which to retrieve the MATPOWER case.


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


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


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 import xlsx, 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')