  A new Lagrangian formulation with complex currents is developed and yields a
direct and simple method for modeling three-phase permanent-magnet and
induction machines. The Lagrangian is the sum a mechanical one and of a
magnetic one. This magnetic Lagrangian is expressed in terms of rotor angle,
complex stator and rotor currents. A complexification procedure widely used in
quantum electrodynamic is applied here in order to derive the Euler-Lagrange
equations with complex stator and rotor currents. Such complexification process
avoids the usual separation into real and imaginary parts and simplifies
notably the calculations. Via simple modifications of such magnetic Lagrangians
we derive new dynamical models describing permanent-magnet machines with both
saturation and saliency, and induction machines with both magnetic saturation
and space harmonics. For each model we also provide its Hamiltonian thus its
magnetic energy. This energy is also expressed with complex currents and can be
directly used in Lyapunov and/or passivity based control. Further, we briefly
investigate the observability of this class of Euler-Lagrange models, in the
so-called sensorless case when the measured output is the stator current and
the load torque is constant but unknown. For all the dynamical models obtained
via such variational principles, we prove that their linear tangent systems are
unobservable around a one-dimensional family of steady-states attached to the
same constant stator voltage and current. This negative result explains why
sensorless control of three-phase electrical machines around zero stator
frequency remains yet a difficult control problem.
