to_andes#

ams.interop.andes.to_andes(system, addfile=None, setup=False, no_output=False, default_config=True, verify=True, tol=0.001)[source]#

Convert the AMS system to an ANDES system.

A preferred dynamic system file to be added has following features: 1. The file contains both power flow and dynamic models. 2. The file can run in ANDES natively. 3. Power flow models are in the same shape as the AMS system. 4. Dynamic models, if any, are in the same shape as the AMS system.

This function is wrapped as the System class method to_andes(). Using the file conversion to_andes() will automatically link the AMS system instance to the converted ANDES system instance in the AMS system attribute dyn.

It should be noted that detailed dynamic simualtion requires extra dynamic models to be added to the ANDES system, which can be passed through the addfile argument.

Parameters:
systemSystem

The AMS system to be converted to ANDES format.

addfilestr, optional

The additional file to be converted to ANDES dynamic mdoels.

setupbool, optional

Whether to call setup() after the conversion. Default is True.

no_outputbool, optional

To ANDES system.

default_configbool, optional

To ANDES system.

verifybool

If True, the converted ANDES system will be verified with the source AMS system using AC power flow.

tolfloat

The tolerance of error.

Returns:
adsysandes.system.System

The converted ANDES system.

Notes

  1. Power flow models in the addfile will be skipped and only dynamic models will be used.

  2. The addfile format is guessed based on the file extension. Currently only xlsx is supported.

  3. Index in the addfile is automatically adjusted when necessary.

Examples

>>> import ams
>>> import andes
>>> sp = ams.load(ams.get_case('ieee14/ieee14_uced.xlsx'), setup=True)
>>> sa = sp.to_andes(addfile=andes.get_case('ieee14/ieee14_full.xlsx'),
...                  setup=False, overwrite=True, no_output=True)