In recent years, the interest in the use of renewable energy has encouraged the growth of studies into renewable sources, such as the production of biofuels. This work investigates the vapor-liquid equilibrium (VLE), vapor-liquid-liquid equilibrium (VLLE) and liquid-liquid equilibrium (LLE) of binary, ternary, quaternary and pseudo-quaternary systems using an optimization approach for components found in biodiesel production, which consists in vegetable oils, fatty acids, esters and alcohols. A methodology has been developed based on the Gibbs energy minimization and the discretization of the molar fraction domain, which incorporates a thermodynamic model to describe the phase equilibria. This work used the Soave-Redlich-Kwong equation of state (SRK-EOS) for phase equilibria calculation, where the compressibility factor was used to determine the phase present in the system (liquid, vapor or supercritical fluid). The chemical and phase equilibrium problem is solved using linear programming and satisfies the mass balance constraints. It was found that the proposed methodology adequately represents the selected experimental data, with an average absolute deviation of 1.31 % obtained.