## 3 Results and Discussion
### Electrochemical Study  
This is the first time that PANI nanofibers doped with P-TSA are used as a precursor to prepare carbon materials. We realized the initial ideas of using nanostructured PANI as a precursor to obtain nitrogen-doped carbons materials with high nitrogen content and a high specific surface area, and removing activation at high temperatures. Subsequently, capacitive properties of NCFs are characterized by electrochemical analysis with a three-electrode test cell. The cyclic voltammograms (CV) of NCFs with different scanning rates, as seen in Figure 8a, show nearly square cycle profiles without any obvious redox peaks at a potential window ranging from 0 V to \(-\)0.8 V vs Hg/Hg\(\cdot\)SO\({}_{4}\), indicating that typical double layer capacitance is present [27]. The shape of CV curves is very consistent with the previous report [27; 29], depicting that the CV curves of NCFs demonstrate moderate distortion, which can be attributed to the faradic reactions of nitrogen-and oxygen-containing functional groups on the carbon's surface [29]. The functional groups of carbon materials generate a fast and reversible faradaic redox reaction between the ions of electrolytes and the carbon electrode surface mentioned above. The specific capacitances of NCFs calculated from the CV profiles are 172, 167, 147, 139, and 105 F g\({}^{-1}\) at 2, 5, 10, 20, and 50 mV s\({}^{-1}\), respectively. It is a common behavior that the specific capacitance decreases from 172 F g\({}^{-1}\) to 105 F g\({}^{-1}\) with an increase in the scan rate from 2 mV s\({}^{-1}\) to 50 mV s\({}^{-1}\) due to the decreasing ability of ionic penetration into micropores, which is a widely accepted explanation of this behavior [32]. In the present work, at a relatively low scan rate of 50 mV s\({}^{-1}\), the shape of the CV curve already shows a transition from box-like to spindle, indicating sluggish ionic diffusion has occurred. To understand the ionic diffusion clearly, we characterize the kinetic analysis of the NCFs electrode. Figure 8b is a plot of the specific capacitance vs scan rate\({}^{-1/2}\) and it does not seem to follow a linear trend, starting from 2 mV s\({}^{-1}\) to 50 mV s\({}^{-1}\). At the low scan rate, the capacitance is almost independent of the scan rate, indicating that the electrolyte diffusion is not the limiting factor for charge storage owing to the special structure and heteroatoms functional groups of NCFs [57]. NCFs exhibits a 71.4% capacitance retention with the increasing scan rate from 10 mV s\({}^{-1}\) to 50 mV s\({}^{-1}\), which is comparable to others [29]. The curves of the galvanostatic charge/discharge (GCD) exhibit a precise symmetry, suggesting a prominent capacitive behavior of the electrode (Figure 8c). The specific capacitances of NCFs calculated from the GCD profiles are 182, 162, 139, 128, and 115 F g\({}^{-1}\) at 0.2, 0.5, 1, 2, and 5 A g\({}^{-1}\), respectively. With the increasing current densities from 0.5 A g\({}^{-1}\) to 10 A g\({}^{-1}\), the capacitance decreases only by 30%. Figure 8d shows the Nyquist plots of NCFs' electrodes in the frequency range of 0.01 Hz-100 kHz. For pseudocapacitive materials, the Nyquist representation will contain a vertical line with a phase angle of 90\({}^{\circ}\) or less and a semicircle in the high-frequency region associated with the charge-transfer resistance [58]. Compared to the literature [35], a small semicircle is observed at the high frequency region for NCFs, meaning the smaller charges transfer resistance. Obviously, NCFs exhibit a steep line with a higher slope in the low-frequency region, indicating a better capacitive performance. Satisfyingly, NCFs have excellent cycling stability (89% capacitance retention over 5000 cycles at current density of 5 A g\({}^{-1}\)), as shown in Figure 8e.