Stability and accuracy of electromagnetic transient simulation algorithms