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.rtrj')

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.getBus('1041-4041').PF.plot() # will plot the timeseries simulated for the active power of line'1041-4041' 
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' 
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.getBus('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.getBus('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.getBus('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.getBus('L_1').P.plot() # will plot the timeseries simulated for the active power of 'L_1' 
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.getBus('sh1').Q.plot() # will plot the timeseries simulated for the reactive power of shunt 'sh1' 
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.getBus('g1').P.plot() # will plot the timeseries simulated for the active power of 'g1' 
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.getBus('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.getBus('lcc1').P1.plot() # will plot the timeseries simulated for the power of 'lcc1'