The generator was modelled by differential algebraic equations. The solution was conducted by constrained minimization tool. The method needs voltage and current in the generator's bus and field voltage. The validation was performed with real data obtained in a small power system.