In the present study, the aeroelastic energy response of a twin-engine composite wing system is optimized based on sequential quadratic programming (SQP) method. The variable stiffness is acquired by constructing laminates of thin wall beam (TWB) with curvilinear fibers having prescribed paths. In order to account the effect of spanwise locations and mass of the engines on the aeroelastic characteristics of TWB, the novel governing equations of motion are obtained using Hamilton's variational principle. The paper aims to exploit desirable fiber paths with improved aeroelastic properties for different twin-engine wing configuration. Ritz based solution methodology is employed to solve the equations with coupled incompressible unsteady aerodynamic model based on Wagner's function. A novel optimization strategy based on the total energy of the aeroelastic system is introduced. The proposed total energy, as a cost function, is minimized in terms of four optimization variables of two engine's locations and wing structure curvilinear fiber angle with two design parameters. The total energy is obtained by integrating responses of kinetic and potential energy in a specific time interval. The minimum total energy is an indication of ideal optimization variables which leads to the optimum flutter performance. Numerical results demonstrate the effectiveness of the optimization variables on the total energy of the aeroelastic system and determine the optimal values of introduced variables in case of minimum total energy and improved aeroelastic characteristics.