Multiscale modeling of carbon nanotubes under axial tension and compression