Skip to content

2.9. Adding New Models

Julius Susanto edited this page Mar 20, 2015 · 2 revisions

Adding new built-in machine models

Built-in machine models (e.g. synchronous machines, induction machines, external grids, converters, etc) are defined in individual Python class files, for example, sym_order4.py for the 4th order synchronous machine model.

Each of these model classes must expose the following three methods (which is called by the simulation engine):

  • initialise (self, vt0, S0): is the initialisation function with the steady-state terminal voltage (vt0) and power injection (S0) as the inputs.
  • calc_currents (self, vt): is the function for calculating current injections into the network with the terminal voltage phasor (vt) as an input.
  • solve_step(self,h,dstep): is the function to solve the next stage of the integration step with the step-size (h) and the stage of the integration step (e.g. 2nd stage of Runge-Kutta integration method)

There are also two additional interfaces that need to be modified when adding a new model:

  • run_sim.py: in the setup section, lists are made for machines and controllers. The program differentiates machines from controllers by checking the class name. The class name of the new model needs to be added here.
  • mod_Ybus.py: this file builds the modified Ybus matrix with the shunt admittance for each machine type calculated based on its class. Code for adding the shunt admittance for the new model needs to be added here.