This program solves the economic dispatch problem using the lambda iteration method for a system with three generating units, both with and without considering transmission losses.
It defines the cost curves and operating limits of each generator. The problem is solved by minimizing total generation cost subject to the load demand constraint, using MATLAB's fsolve function to solve the coordination equations.
Without losses, it calculates the optimal dispatch, total cost and verifies load balance. With losses, it iteratively solves the coordination equations including loss coefficients to determine the optimal dispatch that minimizes total cost including losses, calculating total losses and resulting load supplied.