Automated modeling of power system dynamics using the Lagrangian formulation. (13th June 2014)