Power system modelling and scripting is a quite general and ambitious title. Of course, to embrace all existing aspects of power system modelling would lead to an encyclopedia and would be likely an impossible task. Thus, the book focuses on a subset of power system models based on the following assumptions: (i) devices are modelled as a set of nonlinear differential algebraic equations, (ii) all alternate-current devices are operating in three-phase balanced fundamental frequency, and (iii) the time frame of the dynamics of interest ranges from tenths to tens of seconds. These assumptions basically restrict the analysis to transient stability phenomena and generator controls.