3.3. Simulation result processing and visualisation

The pyramses.extractor provides the necessary methods to analyse the results of a simulation.

3.3.1. Initializing

We can initialize an instance by importing pyramses and invoking the pyramses.extractor class of pyramses:

import pyramses
data = pyramses.extractor('data.trj')

The available calls to the pyramses.extractor class are fully documented in code_extractor_doc. The most important are detailed below.

3.3.2. Full list of functions

class pyramses.extractor(traj)[source]

The extractor class is used to extract the timeseries data after the simulation and process them.

Parameters

rtraj (str) – the path to the ramses trajectory file. This should be the same file that was set in the case with case.addTrj(‘filenm.rtrj’).

Example

>>> import pyramses
>>> case = pyramses.cfg("case.rcfg") # load case from a configuration file
>>> ram = pyramses.sim()
>>> ram.execSim(case) # run the simulation
>>> ext = pyramses.extractor(case.getTrj())
>>> ext.getBus('1041').mag.plot() # will plot the timeseries simulated for the voltage magnitude on bus '1041'
getBranch(braname)[source]

Returns an object that allows to extract or plot branch related variables.

Parameters

braname (str) – the name of the branch

Example

>>> import pyramses
>>> case = pyramses.cfg("case.rcfg") # load case from a configuration file
>>> ram = pyramses.sim()
>>> ram.execSim(case) # run the simulation
>>> ext = pyramses.extractor(case.getTrj())
>>> ext.getBranch('1041-4041').PF.plot() # will plot the timeseries simulated for the active power of line'1041-4041' 

Note

Available data are obsnames = [‘PF’,’QF’,’PT’,’QT’,’RM’,’RA’] obsdesc = [‘P (MW) entering at FROM end’, ‘Q (Mvar) entering at FROM end’,

‘P (MW) entering at TO end’, ‘Q (Mvar) entering at TO end’, ‘magnitude of transformer ratio’,’phase angle of transformer ratio (deg)’]

getBus(busname)[source]

Returns an object that allows to extract or plot bus related variables.

Parameters

busname (str) – the name of the bus

Example

>>> import pyramses
>>> case = pyramses.cfg("case.rcfg") # load case from a configuration file
>>> ram = pyramses.sim()
>>> ram.execSim(case) # run the simulation
>>> ext = pyramses.extractor(case.getTrj())
>>> ext.getBus('1041').mag.plot() # will plot the timeseries simulated for the voltage magnitude on bus '1041' 

Note

Available data are obsnames = [‘mag’,’pha’] obsdesc = [‘Voltage magnitude (pu)’,’Voltage phase angle (deg)’]

getDctl(dctlname)[source]

Returns an object that allows to extract or plot dctl related variables.

Parameters

dctlname (str) – the name of the dctl

Example

>>> import pyramses
>>> case = pyramses.cfg("case.rcfg") # load case from a configuration file
>>> ram = pyramses.sim()
>>> ram.execSim(case) # run the simulation
>>> ext = pyramses.extractor(case.getTrj())
>>> ext.getDctl('agc').g5.plot() # will plot the timeseries simulated for the power of 'g5' 
getExc(syncname)[source]

Returns an object that allows to extract or plot exciter related variables.

Parameters

syncname (str) – the name of the generator that we want to check the exciter

Example

>>> import pyramses
>>> case = pyramses.cfg("case.rcfg") # load case from a configuration file
>>> ram = pyramses.sim()
>>> ram.execSim(case) # run the simulation
>>> ext = pyramses.extractor(case.getTrj())
>>> ext.getExc('g1').vf.plot() # will plot the timeseries simulated for the field voltage of 'g1' 
getInj(injname)[source]

Returns an object that allows to extract or plot injector related variables.

Parameters

injname (str) – the name of the injector

Example

>>> import pyramses
>>> case = pyramses.cfg("case.rcfg") # load case from a configuration file
>>> ram = pyramses.sim()
>>> ram.execSim(case) # run the simulation
>>> ext = pyramses.extractor(case.getTrj())
>>> ext.getInj('pv1').P.plot() # will plot the timeseries simulated for the active power of 'pv1' 
getLoad(ldname)[source]

Returns an object that allows to extract or plot load related variables.

Parameters

ldname (str) – the name of the load

Example

>>> import pyramses
>>> case = pyramses.cfg("case.rcfg") # load case from a configuration file
>>> ram = pyramses.sim()
>>> ram.execSim(case) # run the simulation
>>> ext = pyramses.extractor(case.getTrj())
>>> ext.getLoad('L_1').P.plot() # will plot the timeseries simulated for the active power of 'L_1' 

Note

Available data are obsnames = [‘P’,’Q’] obsdesc = [‘Active power consumed (MW)’,’Reactive power consumed (Mvar)’]

getShunt(shuname)[source]

Returns an object that allows to extract or plot shunt related variables.

Parameters

shuname (str) – the name of the shunt

Example

>>> import pyramses
>>> case = pyramses.cfg("case.rcfg") # load case from a configuration file
>>> ram = pyramses.sim()
>>> ram.execSim(case) # run the simulation
>>> ext = pyramses.extractor(case.getTrj())
>>> ext.getShunt('sh1').Q.plot() # will plot the timeseries simulated for the reactive power of shunt 'sh1' 

Note

Available data are obsnames = [‘Q’] obsdesc = [‘Reactive power produced (Mvar)’]

getSync(syncname)[source]

Returns an object that allows to extract or plot synchronous machine related variables.

Parameters

syncname (str) – the name of the sync machine

Example

>>> import pyramses
>>> case = pyramses.cfg("case.rcfg") # load case from a configuration file
>>> ram = pyramses.sim()
>>> ram.execSim(case) # run the simulation
>>> ext = pyramses.extractor(case.getTrj())
>>> ext.getSync('g1').P.plot() # will plot the timeseries simulated for the active power of 'g1' 

Note

Available data are obsnames = [‘P’,’Q’,’A’,’S’,’FW’,’DD’,’QD’,’QW’,’FC’,’FV’,’T’,’ET’,’SC’] obsdesc = [‘active power produced (MW)’,

‘reactive power produced (Mvar)’, ‘rotor angle wrt COI (deg)’, ‘rotor speed (pu)’, ‘flux in field winding (pu mach. base) ‘, ‘flux in d1 damper (pu mach. base) ‘, ‘flux in q1 damper (pu mach. base) ‘, ‘flux in q2 winding (pu mach. base) ‘, ‘field current (pu) ‘, ‘field voltage (pu) ‘, ‘mechanical torque (pu) ‘, ‘electromagnetic torque (pu mach. base) ‘, ‘speed of COI reference (pu) ‘]

getTor(syncname)[source]

Returns an object that allows to extract or plot governor related variables.

Parameters

syncname (str) – the name of the generator that we want to check the governor

Example

>>> import pyramses
>>> case = pyramses.cfg("case.rcfg") # load case from a configuration file
>>> ram.execSim(case) # run the simulation
>>> ext = pyramses.extractor(case.getTrj())
>>> ext.getTor('g1').Tm.plot() # will plot the timeseries simulated for the torque of 'g1' 
getTwop(twopname)[source]

Returns an object that allows to extract or plot twoport related variables.

Parameters

twopname (str) – the name of the twoport

Example

>>> import pyramses
>>> case = pyramses.cfg("case.rcfg") # load case from a configuration file
>>> ram = pyramses.sim()
>>> ram.execSim(case) # run the simulation
>>> ext = pyramses.extractor(case.getTrj())
>>> ext.getTwop('lcc1').P1.plot() # will plot the timeseries simulated for the power of 'lcc1'