Dynamic economic dispatch using complementary quadratic programming