PMABCMachineRHS:

--------------------------------------------------------------------------
   Permanent magnet machine model in ABC coordinates.
   Assumes a 3 phase machine in a Y connection.
   The permanent magnet flux distribution is assumed sinusoidal.
--------------------------------------------------------------------------
   Form:
   xDot = PMMachineABCRHS( x, t, d )
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   x       (5,1)    The state vector [iA;iB;iC;omegaM;thetaM]
   t       (1,1)    Time
   d       (1,1)    Data structure
                    .lM   (1,1) Mutual inductance
                    .psiM (1,1) Permanent magnet flux
                    .lSS  (1,1) Stator self inductance
                    .rS   (1,1) Stator resistance
                    .p    (1,1) Number of poles (1/2 pole pairs)
                    .u    (3,1) [uA;uB;uC]
                    .tL   (1,1) Load torque
                    .bM   (1,1) Viscous damping (Nm/rad/s)
                    .j    (1,1) Inertia

   -------
   Outputs
   -------
   x       (5,1)    The state vector derivative

--------------------------------------------------------------------------
   Reference: Lyshevski, S. E., "Electromechanical Systems, Electric
              Machines, and Applied Mechatronics," CRC Press, 2000,
--------------------------------------------------------------------------