This code takes the object from the function, ThermodynamicCycle, which I coded during Wolfram Summer School 2020. But this new code finds the optimal point that the system performs the maximum thermal efficiency, by using a genetic algorithm. It is able to deal with a Rankine Cycle which is the power cycle that represents a vasty number of power generation including, nuclear plants, solar plants, natural gas plants. The code returns a graphic that shows the evolution of generations until the maximum efficiency, as well as the mean of individuals of each generation and the global maximum. At this point, it is necessary adjust the objective function in the code of the genetic algorithm but we intent to code a function entirely computable in the future.
Attachments: