Transient stability of power systems using Lyapunov functions with improved synchronous machine models