This paper presents a simulation code for the thermal power plant AVV1, located in Copenhagen, Denmark, in response to the challenge launched at the ECOS 2003 congress. The simulation program was specially created for this contest, including the calculation of the thermodynamic properties of water, as based on IAPWS97. Every component of the plant is modeled through mass and energy balance equations, and the solution of the whole system is achieved by a successive substitution scheme. The plant is simulated in two operation modes: generating electricity only, and generating electricity and district heating simultaneously. In the first operation mode, four series of simulations are run for loads varying from 40% to 100%. Each series assumes different hypotheses with respect to the variation in the isentropic efficiencies and pressures of the groups that form the turbine. In the second mode, the plant is simulated with a 100% load. An exergetic analysis of the plant, in the two modes analyzed, is presented. The generated results are compared with those presented by several researchers who have tackled the problem. The comparison shows that the results presented here agree most satisfactorily with the results presented in the literature.