This paper concerns the optimization of a dual-purpose desalination system based on a geothermal flash cycle, a Kalina cycle, and a desalination process. A non-linear mathematical programming (NLP) optimization is developed and implemented in GAMS –General Algebraic Modelling System– a high-level modeling environment widely used in process systems engineering (PSE). CONOPT, a NLP derivative-based optimization algorithm, is employed. Furthermore, dynamic link libraries (DLLs) are developed and implemented in C programming code to calculate the thermodynamic properties of all process streams. The DLLs are systematically called from the GAMS environment. Additionally, a solution strategy has been devised to facilitate model convergence. In this strategy, several models are solved sequentially, commencing with the simplest model and progressing to solve the most complex model. This approach enables the optimal sizing and operating conditions of all process units to be obtained simultaneously. Two process configurations, differing in the type of seawater desalination system (reverse osmosis and multi-stage flash desalination systems), are optimized. The proposed mathematical models are effective decision-making tools for the design and synthesis of integrated geothermal power and seawater desalination processes. They can be used as either simulators or optimizers, depending on the number of degrees of freedom specified by the user.