Digital simulation of AC electrical drives based on field-oriented control method using a general purpose program