First-principles investigation of carbon-based nanomaterials for supercapacitors