ShortCircuitAnalysis.set_faults(df=None, **kwargs)[source]#

Define faults to be analysed in the short-circuit simulation.

Return type:



The current implementation allows the simulation of three-phase bus faults, where the fault resistance and reactance, when specified, are connected to the ground in series.

Data may be provided as a dataframe or as keyword arguments. In the latter case, all arguments must have the same length.

Valid attributes are:

  • id: the id of the fault.

  • element_id: the id of the bus on which the fault will be simulated (bus/view topology).

  • r: The fault resistance to ground, in Ohm (optional).

  • x: The fault reactance to ground, in Ohm (optional).

  • proportional_location: location of the fault on the branch as a percentage of the length of the branch, side 1 is the reference (optional, only for branch fault).

  • fault_type: The fault type either BUS_FAULT or BRANCH_FAULT


analysis = pypowsybl.shortcircuit.create_analysis()

# define a single fault as keyword arguments
analysis.set_faults(id='F1', element_id='Bus1', r= 0, x= 0)

# or, define multiple faults as keyword arguments
analysis.set_faults(id=['F1', 'F2'], element_id= [ 'Bus1', 'Bus2'], r= [0, 0], x= [0,0])

# or, define faults as a dataframe
analysis.set_faults(pd.DataFrame.from_records(index='id', data=[{'id': 'F1', 'element_id': buses.index[0], 'r': 1, 'x': 2}]))

# or, since resistance and reactance are not mandatory parameters
analysis.set_faults(pd.DataFrame.from_records(index='id', data=[{'id': 'F1', 'element_id': buses.index[0]}]))