This paper is to describe an open-source code for optimization of clean energy technologies. The model covers the whole chain of energy systems including mainly 6 areas: renewable energies, clean energy conversion technologies, mitigation technologies, intelligent energy uses, energy storage, and sustainability. Originally developed for optimization of renewable water pumping systems for irrigation, the open-source model is written in Matlab® and performs simulation, optimization, and design of hybrid power systems for off-grid and on-grid applications. The model uses genetic algorithm (GA) as optimization technique to find the best mix among power sources, storage systems, and back-up sources to minimize life cycle cost, and renewable power system reliability.