MATPOWER¶
To communicate to MATPOWER to exchange network data these functions are available.
-
pandapower.converter.
from_mpc
(mpc_file, f_hz=50, casename_mpc_file='mpc', validate_conversion=False)¶ This function converts a matpower case file (.mat) version 2 to a pandapower net.
Note: python is 0-based while Matlab is 1-based.
INPUT:
mpc_file - path to a matpower case file (.mat).OPTIONAL:
f_hz (int, 50) - The frequency of the network.
casename_mpc_file (str, ‘mpc’) - If mpc_file does not contain the arrays “gen”, “branch” and “bus” it will use the sub-struct casename_mpc_file
OUTPUT:
net - The pandapower networkEXAMPLE:
import pandapower.converter as pc
pp_net = cv.from_mpc(‘case9.mat’, f_hz=60)
-
pandapower.converter.
to_mpc
(net, filename=None, **kwargs)¶ This function converts a pandapower net to a matpower case files (.mat) version 2. Note: python is 0-based while Matlab is 1-based.
- INPUT:
- net - The pandapower net.
- OPTIONAL:
- filename (str, None) - File path + name of the mat file which will be created. If None
- the mpc will only be returned
**kwargs - please look at to_ppc() documentation
- EXAMPLE:
- import pandapower.converter as pc import pandapower.networks as pn net = pn.case9() pc.to_mpc(net, “case9.mat”)