to_matpower#
- andes.interop.matpower.to_matpower(m, varname, system)[source]#
Send an ANDES case to a running MATLAB instance.
- Parameters:
- mMATLAB/Octave instance
Instance to which to send the MATPOWER case.
- varnamestr
Name of the variable to store the mpc case in MATLAB/Octave.
- system
System
System whose power flow data to send to MATPOWER.
Examples
The code below will create an IEEE 14-bus example system in ANDES, convert it to MATPOWER's case, and send to the MATLAB/Octave instance.
import andes from andes.interop.matpower import (start_instance, to_matpower, from_matpower) m = start_instance() ss = andes.system.example() mpc = to_matpower(m, 'mpc', ss) m.eval("runpf(mpc)") mpc_out = m.pull("mpc") # retrieve the mpc case from MATLAB/Octave