ReluctanceMachineRHS:

--------------------------------------------------------------------------
   Right hand side for a 3 phase reluctance motor or generator.
   Static and coulomb friction are allowed.
--------------------------------------------------------------------------
   Form:
   [xDot, tE] = ReluctanceMachineRHS( x, t, d )
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   x          (5,1)  States [iAS;iBS;iCS;omegaR;thetaR]
   t          (1,1)  Time (not used)
   d          (1,1)  Machine data structure
                     .p   (1,1) Number of poles
                     .b   (1,1) Viscous friction (Nms/rad)
                     .s   (1,1) Static friction (Nm)
                     .j   (1,1) Inertia (kg-m^2)
                     .lMD (1,1) Direct mutual inductance (H)
                     .lMQ (1,1) Quadrature mutual inductance (H)
                     .lLS (1,1) Self inductance (H)
                     .rS  (1,1) Stator resistance (Ohm)
                     .tL  (1,1) Load torque (Nm)
                     .u   (3,1) Phase voltages (V)

   -------
   Outputs
   -------
   xDot       (5,1)  State Derivative [iAS;iBS;iCS;omega;theta]
   tE         (1,1)  Electrical torque (Nm)

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