Investigation of buckling of double-walled carbon nanotubes embedded in an elastic medium using the energy method