Since the flexible optimization to be implemented in this study is not available in public software packages, a Python script included with the SciPy module (scipy.optimize) was used in this study to develop a new optimization approach. The potential energy and stresses of the system, along with the forces acting on the atoms, were calculated for the input force-field parameters and lattice and atomic positions with the help of library-based LAMMPS, which can implement the functional forms of second-generation force fields.