I developed a mathematical model for peer-to-peer energy trading in microgrids using LP optimization. GAMS software is used with CPLEX solver to solve the LP problem and code doesn't work. At the moment I refer the book " power system optimization modelling in GAMS" by Prof Alireza Soroudi.
If any further references for GAMS coding, please let me know.