The principles of electromagnetism applied to electrical machines