Experimental and theoretical study on the corrosion inhibition of mild steel by nonanedioic acid derivative in hydrochloric acid solution

The corrosion performance of mild steel (MS) in 1M HCl solution was examined by weight loss (WL), potentiodynamic polarization (PDP), electrochemical impedance spectroscopy (EIS), electrochemical frequency modulation (EFM), and open circuit potential (OCP) measurements in the absence and presence of nonanedihydrazide. PDP measurements indicated that nonanedihydrazide acts as a mixed inhibitor due to its adsorption on the MS surface, exhibiting an inhibition efficiency of more than 97%. The surface morphology investigation of the protective layer on the MS surface confirmed that adsorption of nonanedihydrazide molecules occurred via chemical adsorption following Langmuir’s isotherm model. The effect of temperature on the corrosion performance in the presence of nonanedihydrazide was investigated in the range of 303–333 K, showing that the inhibition efficiency increased with an increase in the inhibitor concentration and decreased with an increase in temperature. A new green corrosion inhibitor was synthesised and theoretical computations were conducted to completely understand the inhibition mechanism. Nonanedihydrazide molecules were investigated by DFT (density functional theory) using the B3LYP functional to evaluate the relationship of corrosion inhibition performance and the molecular structure. The computed theoretical parameters presented significant support for understanding the inhibitive mechanism revealed by the inhibitory molecules and are in good agreement with WL, PDP, EIS, (EFM), and OCP results.

Synthesis of the inhibitor. Initially, hydrazine hydrate (0.002 mmol) was added to a solution of dimethyl nonanedioate (0.001 mol) and refluxed for 6 h before the refluxed solution was concentrated, filtered, and recrystallised using ethyl alcohol. The inhibitor was purified by TLC and the synthesis is shown in Fig. 1. The nuclear magnetic resonance spectra were recorded using an AVANCE III 600 MHz spectrometer (Bruker, Billerica, MA, USA), FTIR spectra by the Thermo Scientific Nicolate 6700 FT-IR Spectrometer (Thermo Fisher Scientific, Waltham, MA, USA), and the molecule fragments were determined by a GC-FID and GC-MS Gravimetric measurements. Weight loss measurements were conducted based on the standard techniques 22 . The abraded MS samples were weighed before exposure to a 1.0 M HCl environment in the presence and absence of various inhibitor concentrations (0.05, 0.1, 0.2, 0.4, and 0.5 mM). All the acidic environments were aerated and after immersion (1,5,10,24, and 48 h), the samples were removed, washed, dried, and weighed. The tests were performed in triplicate and the average values were calculated. The experiments were www.nature.com/scientificreports/ repeated with various inhibitor concentrations, temperatures ranging from 303 to 333 K and the immersion time of 5 h. The corrosion rate (C R ), inhibition efficiency%) and surface coverage (θ) were determined according to Eqs. (1)(2)(3): where w refers to the MS mass loss (mg), a is the MS coupon area (cm 2 ), t is exposure period (h), d is the MS coupon density (g/cm 3 ), w describes MS specimen weight loss, w i , represents MS coupon mass loss with various concentrations of inhibitor.
Electrochemical measurements. A Gamry water-jacketed glass cell was used to perform electrochemical studies at a steady-state corrosion rate. MS samples, a graphite rod, and a saturated calomel electrode (SCE) comprised the three-electrode cell setup, which includes working, counter, and reference electrodes. A Gamry Device Potentiostat/Galvanostat/ZRA (REF 600) model was used to conduct electrochemical corrosion analysis (Gamry, Warminster, PA, USA) and the Gamry software was utilised to achieve the corrosion potential, EFM, PDP and EIS measurements. The PDP curves were conducted by adjusting the potential between − 0.2 to + 0.2 VSCE over the corrosion potential at a scan rate of 0.5 mV·s −1 . EIS measurements were conducted via alternating current signals of 5 mV peak-to-peak amplitude at the corrosion potential using the frequency region of 100 kHz to 0.1 Hz. All impedance data were fitted and simulated to appropriate equivalent circuits (ECs) utilising the Gamry Echem Analyst software. EFM tests were accomplished at a 0.1 Hz base frequency with an alternating current amplitude for 20 cycles. The electrochemical corrosion tests were conducted for 30 min after the working electrode was exposed in the environment to achieve steady-state conditions. The experiments were performed in triplicate with the average values recorded to ensure that the measurements were repeatable.
Quantum chemical studies. The ground-state geometry was derived with Gaussian 03, Revision C.01 23 , and the valence and polarisation basis set (6-31G + + (d,p)) was used to optimise to a local minimum without symmetry constraints 24 . A variation of the DFT approach that combines the Becke three-parameter hybrid (B3) 25 exchange functional with the Lee-Yang-Parr (LYP) 26 correlation functional (B3LYP) 27,28 was utilised to evaluate the optimised geometry, frontier molecular orbitals (HOMO, LUMO) energies, and physical parameters for the molecule in the current investigation. Based on DFT-Koopman's theorem 29 , the ionisation potential (I) is related to the E HOMO , whereas electron affinity (A) is related to E LUMO . The ionisation potential and electron affinity can be calculated according to Eqs. (4 and 5): The analysis of the natural bond orbital (NBO) 30 was conducted to determine the electron density distributions, as electron density represents a significant factor in computing the parameters of chemical reactivity. The electronegativity (χ), hardness (η) and softness (σ) were computed according to Eqs. (6)(7)(8): The transferred electrons number (ΔN) was determined based on the DFT approach 31 by applying the following Eq. (9): where χFe is the iron absolute electronegativity, χinh indicates the absolute electronegativity of the inhibitor molecule, ηFe refers to iron absolute hardness and ηinh represents the inhibitor molecule absolute hardness.
In the current investigation, the χFe theoretical value was 7.0 eV and for ηFe was zero. (1)

Results and discussion
Confirmation of the nonanedihydrazide structure. The nonanedihydrazide was prepared via the schematic route shown in Fig. 1 starting with dimethyl nonanedioate. The structure of the synthesised nonanedihydrazide was elucidated via FT-IR, 1 H NMR, 13 C NMR, and mass spectroscopy. The molecular weight of nonanedihydrazide was (216), determined according to the molecular formula (C 9 H 20 N 4 O 2 ) and confirmed by mass spectroscopy. Nonanedihydrazide is a corrosion inhibitor dissolved in dichloromethane, acetone, dimethylsulphoxide, dimethylformamide, and alcohol media. Figure 2a shows the FTIR spectrum of nonanedihydrazide, with the band at 3,289 cm −1 and 3,314 cm −1 corresponding to hydrazide NH 2 bonds and the band at 3,199 cm -1 is a hydrazide NH bond. The significant band at 1633 cm −1 is carbonyl (C=O) stretching. Alkyl groups which represent methylene groups (CH 2 ) are absorbed in the regions of 2849 cm -1 and 2922 cm -1 . The 1 H-NMR spectrum in Fig. 2b shows a singlet at δ 8.882 ppm owing to the protons of an amino group. The multiple singlets for two hydrogens (2H) located at δ 1.207 ppm, δ 1.412 ppm, and δ 1.938 ppm were attributed to the methylene groups. Figure 2c shows the spectrum of 13 CNMR, the molecular structure of the synthesised corrosion inhibitor. The band at 172.140 ppm was attributed to the carbon of the C=O group. The carbon atoms of methylene groups also have bands at 28.980 ppm, 29.540 ppm, 33.600 ppm, 33.860 ppm, 34.130 ppm, 39.500 ppm, and 39.640 ppm representing the atoms in the methylene groups. Nonanedihydrazide exhibited an m/z value of 217.0 indicating the carbon-nitrogen cleavage to produce a C=O bond, whereas 186.0 describes the splitting of the nitrogen-carbon linkage yielding C=O, while the m/z value at 156.0 was attributed to a compound with bicarbonyl groups (Fig. 2d).
Weight loss. Effect of the inhibitor concentration. Nonanedihydrazide protected MS against corrosion and Fig. 3 shows the rate of corrosion C R and inhibition efficiency ( IE% ). The WL tests were conducted at 303 K, showing that with increasing nonanedihydrazide concentration, the C R decreased, hence, the inhibition improved as more molecules are adsorbed onto the MS decreasing the interaction with HCl. The highest inhibition efficiency (IE)% (98.3%) was exhibited by 0.5 mM nonanedihydrazide and is attributed to the amino and carbonyl groups donating electrons, as well as the inductive effect of methylene groups, which improves the inhibitor's ability to shift electron pairs to (from inhibitor molecules) the unoccupied d-orbitals of iron atoms on the www.nature.com/scientificreports/ MS surface, thereby controlling and/or impeding corrosion. Increasing the concentration of nonanedihydrazide to 0.6 mM has no discernible effect on inhibitory performance 32 . The immersion duration also impacted the resistance of nonanedihydrazide to the HCl environment ( Fig. 3), with the C R reducing throughout the first 10 h in 1 M HCl, with the maximum IE of 98.3%, while nonanedihydrazide had the highest IE of 88.1% after 1 h. After 24 h of immersion, the IE value declined, 98.3% at 0.5 mM, reducing to 84.7% after 48 h. The duration of immersion is a critical factor in protection. The adsorption of nonanedihydrazide molecules on the MS surface thereby covering the area of the specimen exposed to the HCl solution may account for the decrease in C R and increase in IE as the concentration of nonanedihydrazide increases 33 . More nonanedihydrazide particles were available to be absorbed onto the MS surface when the concentration of nonanedihydrazide increased, thus the surface coverage significantly increased.
The inhibition efficacy of the synthesised nonanedihydrazide was compared to other corrosion inhibitors having nitrogen atoms to protect against MS corrosion (Table 1). Nonanedihydrazide has the greatest inhibitory efficiency compared to the compounds in Table 1 [34][35][36][38][39][40][41] , as well as an efficiency equivalent to that described in 37,42,43 . As the concentration of nonanedihydrazide increased, the rate of corrosion reduced and the inhibitive efficacy improved, possibly because of the increased absorption of nonanedihydrazide on the MS surface as the inhibitor concentration increased.
Temperature effect. Temperature affects the inhibitory efficacy of the inhibitor, with the IE remaining approximately constant as the temperature increased to 323 K, then falls as the temperature climbs to 333 K. Figure 4 shows that at a dose of 0.5 mM, the efficiency of nonanedihydrazide inhibition declines from 98.2 to 73.5% when the temperature changes from 303 to 333 K. This indicates that nonanedihydrazide molecules detach from the MS surface as the temperature rises, so the MS is no longer protected by inhibitor molecules, resulting in a reduction in corrosion IE.
Thermodynamic studies. The Arrhenius Eq. (10) and transition state Eq. (11) were used to calculate the temperature-dependent C R : where E a represents the energy of activation, λ is the factor of pre-exponential and R is the constant of gas, H * is the enthalpy of activation and S * is the entropy of activation.
Adsorption isotherm. Various adsorption isotherm models can be used to get important details based on inhibitor molecules adsorption on the MS surface and as the linear regression coefficient is close to one, the Langmuir isotherm was considered appropriate to describe the inhibitor molecules' adsorption on the MS surface 47,48 . The Langmuir adsorption isotherms can be understood as: This graph shows the association between the inhibitor concentration C inh and inhibitor surface coverage (θ) on the MS surface. The surface coverage percentage is defined as the proportion of the surface that is coated with inhibitor molecules and can be calculated using Eq. (3). The plot of C inh / θ vs C inh (as shown in Fig. 6) at 303 K is a straight line, indicating that the inhibitor molecules' adsorption temperature is more closely aligned with the Langmuir adsorption temperature than other isotherms. The link between the adsorbent and the adsorbate is represented by K ads , with an increased K ads predicting better adsorption, thus better inhibition. The straight-line intercept shown in Table 2 can be used to calculate K ads . The link between the adsorption free Gibbs energy and the adsorption equilibrium constant is represented by Eq. (13): where R refers to the constant of gas, T is the temperature, and K ads is the constant of equilibrium.
The negative value of the adsorption Gibbs free energy G o ads denotes spontaneity and the inhibitor molecules are adsorbed on the MS 49 . G o ads ≤ −20 kJ mol −1 represents the physical adsorption of the inhibitor molecule to  Electrochemical results. Open circuit potential (OCP). The open-circuit potential for MS in 1.0 M HCl at 303 K is shown in Fig. 7 as a function of the nonanedihydrazide concentration. The MS sample is the negatively charged electrode, while nonanedihydrazide is the positively charged solution 52,53 . Adsorption to the metal surface, which is usually made up of free oxides, is a fundamental stage in acidic solution inhibition 54 . Variations in the OCP of 90.70 mV vary from −560.90 to −470.20 mV, implying that nonanedihydrazide molecules are absorbed through a positively charged protecting film on the surface of the negatively charged MS specimens 55 . The OCP dramatically decreases between 303 and 333 K at the same concentration of 0.5 mM but at different temperatures due to the temperature difference as in Fig. 8. The OCP rises between 303 and 333 K, indicating that there is corrosion, that is, high temperatures reduce the corrosion inhibitor's effectiveness. Tables 3 and 4 summarise the EIS measurements for MS corrosion in the presence and absence of the inhibitor at 303, 313, 323, and 333 K. Figure 12 shows the Nyquist plots of the impedance spectra for MS samples in 1.0 M HCl in the absence and presence of various amounts of nonanedihydrazide at 303 K.

EIS.
The addition of the corrosion inhibitor results in a significant increase in the overall impedance. The impedance response of MS is dramatically affected by the addition of the inhibitor to the corrosive solution, as illustrated in Fig. 9. Increasing inhibitor concentration causes an increase in substrate impedance and the total impedance of MS in the presence of 0.5 mM decreases as the solution temperature rises, as shown in Fig. 10,  . The electrode and charge transfer processes are responsible for the HF and MF loops, respectively. In the absence and presence of the inhibitor, the inductive behaviour seen in the LF region is attributed to the relaxation of the adsorption of corrosion products or the adsorption of inhibitor molecules on the MS surface in an acidic solution 56 . All other temperatures studied show a similar pattern of activity. The working electrode's corroding surface is rough, so the capacitance is given using a constant phase element (CPE). As illustrated in Fig. 11, the EIS findings were examined using the equivalent circuit 57 . Using Eq. (14), the inhibition efficiencies were determined from the charge transfer resistance:       Table 4 shows that as the temperature is increased from 303 to 333 K, the Rct also increased, and the inhibition efficacy decreases. Since the corrosion inhibitor molecules are adsorbed on the surface of the MS sample, they will condense as the temperature rises 60 . The physical and chemical adsorptions are the two basic types of adsorption of organic molecules. The presence of a transition metal, the vacuum region, the low energy of the electron orbital, and the inhibitors of molecules with relatively loose electrons are all important factors contributing to corrosion inhibition 61 . Rct values increase with increasing concentration but decrease dramatically with increasing solution temperature, as indicated in Tables 3 and 4. Figure 10 shows the Nyquist plots for MS in 1 M HCl with 0.5 mM nonanedihydrazide at various temperatures. The semicircle graph at 333 K is the shortest while the circle for 303 K is the largest indicating that when the temperature increases the diameter of the semicircle shrinks. These results indicate that as the temperature increases, the corrosion prevention decreases significantly and the corrosion accelerates with increasing temperature due to changes in the corrosion actuation mechanism 55 .
The inhibitor-covered metal/solution interface is described using the equivalent circuit model depicted in Fig. 11, while Fig. 12 shows a one-time constant in the Bode phase. Figure 12 depicts the impedance and phase data in the form of Bode graphs for MS exposed to 1 M HCl at 303 K and shows the fit of the line using the parabolic circuit model. Figure 12 shows Bode diagrams for MS in 1 M HCl with and without the corrosion inhibitor. In the EIS spectrum, different wear regimes (e.g., charge transfer control, diffusion control, or mixed-type) may reveal different features. The process of system erosion can be identified by studying the EIS data (Nyquist plot, Bode plot). EIS data are often interpreted in terms of equivalent electrical circuits that can be used to characterise the electrical properties of electrochemical communications in practice 56 . Most impedance spectra reported for MS corrosion in hydrochloric acid solutions include one low capacitive loop (one time constant in the Bode phase representation) or two capacitive semicircles (two well-defined time constants in the Bode phase format).
When the Nyquist plot contains a 'low' semicircle with the centre below the real axis, this is known as frequency dispersal and has been linked to surface roughness and inhomogeneity 57 . EIS spectra of heterogeneous coatings on metallic surfaces or rough and porous electrodes have been described by two approaches, namely the finite transmission line model 58 Tables 5 and 6 show that as i corr increases with increasing solution temperature while decreasing with the addition of the synthetic inhibitor to the acidic solution over the studied temperature range. This result can be described as follows: the inhibitor is adsorbed on the metal surface, and as the temperature rises, some of the inhibitor molecules adsorb the adsorbent, exposing more of the metal surface to the acidic medium, which    www.nature.com/scientificreports/ When the change in E CORR is greater than 85 mV, the tested inhibitor is classified as an anodic or cathodic type inhibitor 61 . Nonanedihydrazide acts as a mixed-type inhibitor as its highest displacement is 385 mV at 303 K ( Table 5), indicating that the addition of an acidic solution reduces the anodic solubility of MS and delays the formation of cathodic hydrogen.
Electrochemical frequency modulation (EFM). EFM is an electrochemical approach for estimating the corrosion rate without knowing the Tafel constants in advance 62 . A major advantage of this method is that it measures the erosion rate, Tafel parameters, and causation variables in one data set. To produce a current response using EFM, a potential perturbation signal consisting of two sine waves is applied to any corrosion sample. Table 7 shows that as the inhibitor concentration rises, the i corr rate decreases, CF-2 and CF-3 have standard values of 2.0 and 3.0, respectively. If the value of the causation factor approaches the criteria, there is a correlation between the perturbation and response signals, and the data can be accepted. Electrochemical frequency modulation has been used to accurately evaluate corrosion parameters for a variety of metals and electrolytes. This method is similar to the harmonic method in that it uses a low amplitude (20 mV) sine perturbation signal but instead of one sine wave, it uses two sine waves. Data validation, larger current response, insensitivity to harmonics and perturbation signal are just some of the benefits of electrochemical frequency modulation over the harmonic technique. Tables 7 and 8  EFM results are valid if CF-2 and CF-3 are in the 0-2 and 0-3 ranges, respectively. Any difference from the theoretical value in the causation factor could be due to a very small perturbation amplitude, poor frequencyresolution of the spectrum, or a defective damper 63 . The inhibition efficacy of nonanedihydrazide increases with the increasing concentration of the inhibitor but decreases with increasing solution temperature at a constant concentration, as previously shown in other tests. This finding demonstrates that the inhibitor molecules are physically rather than chemically adsorbed on the surface of MS and that higher temperature accelerates both the dissolution of the metal and the adsorption of the inhibitor molecule from the metal surface.
The current response spectrum as a function of frequency is the result of EFM experiments. Intermodulation spectra of electrochemical frequency modulation of MS in 1 M HCl in the absence and presence of different concentrations of corrosion inhibitor at 303 K are shown in Fig. 15a-e.

DFT calculations
Computational studies. The eigenvalues of the highest occupied (HOMO) and lowest unoccupied (LUMO) molecular orbitals, the HOMO-LUMO gap, electronegativity, chemical hardness, dipole moment, Fukui indices, and other parameters are among the most popular molecular-electronic properties in the inhibition efficiency correlation approach. The molecular-electronic properties in the inhibition efficiency correlation method are based on two assumptions. The first is that these chemical characteristics are crucial reactivity markers that can be used to forecast the direction of inhibitor adsorption bonding. Typically, the higher the eigenvalue of HOMO, the greater the molecular electron donation to the metal substrate, and the lower the eigenvalue of LUMO, the greater the electron back-donation from surface states to the molecule; however, high and low imply a small HOMO0-LUMO gap, because ELUMO is larger than EHOMO [64][65][66] . In evaluating inhibitor molecules, theoretical chemistry approaches are as useful as experimental procedures and the efficacy of inhibitor molecules can be calculated using different quantum parameters without the need for investigation. The subjects of atomic charge, border molecular orbitals, and energy gap can be used to classify computational factors commonly used in quantum chemical examinations of corrosion 67 . In addition, parameters such as molecular activity, chemical structures, and corrosion inhibitor capacity must be determined. The steric hindrance or how the metal solution interface handles the inhibitor can be revealed by the optimal chemical structures of the inhibitor molecules. Another approach is to show how the inhibitor behaves electrochemically in the presence of orbital energies and differences in orbital energies. Frontier Molecular Orbitals (Energy of HOMO, and Energy LUMO), the parameter of softness calculated from E HOMO , and the parameter of hardness calculated from E LUMO are all carefully related to the inhibitor's potential to interact. The protection efficacy and levels of energy of the molecular orbitals of many organic compounds have been determined using computational chemistry research 68 . The Density Function Theory (DFT) 69 , which is based on the idea that a molecule's total electron energy is determined based on its electron density 70 , was used to investigate inhibitory behaviour in several different base sets of corrosion inhibitors. The electronic characteristics 71 were computed and shown in Table 9 using Eqs. (4) to (9). As EHOMO is linked to the electron-donating potential, increasing the value of HOMO increases the inhibitor's inhibition efficacy 72 , which is the mechanism for transferring the charge along the metal surface and initiating the adsorption mechanism. The assessed inhibitor is recognised as having the most significant inhibitory effectiveness depending on the greatest energy value of HOMO presented in Fig. 16 because it has a high value of inhibitory effectiveness.
The ability to receive electrons is fundamental to E LUMO , whereby a low-value E LUMO indicates that the inhibitor molecules can find another negative charge on the MS surface. The LUMO values of the inhibitors studied were relatively high, with a high E HOMO value. It was determined that the examined inhibitor molecules were reactive when acting as the donor, indicating that they are very efficient. Although inhibitor molecules with a small E HOMO value reduce metal reactivity, the metal acts as a donor to the inhibitor molecules, thus, the inhibitor efficiency is lowered while the metal reactivity is boosted. The assessed inhibitor compounds had the greatest effective corrosion inhibition according to E HOMO -E LUMO (Fig. 16). The inhibitor molecules with a high E HOMO and a low energy gap were found to have high softness and low hardness values, indicating significant inhibitory activity. An additional component for inhibitory potency is electronegativity (χ) and electronegativity values determined for the tested inhibitor compounds may reveal information about the covalent bonds between the inhibitor and the metal surface 73 . The inhibitory effects of inhibitor molecules designed as an iron-inhibitor were studied (Table 9), indicating that the Fe atoms will form chemical bonds by gaining electrons from inhibitor molecules. The inhibitor is effective with a low electronegativity value based on the electronegativity value. The ΔN value in Table 9 shows that the examined inhibitor molecules transfer more electrons to the Fe atoms on the metal surface, indicating a higher performance. The dipole moment (μ) is another unique factor shown in Table 9. While previous studies have not found a significant correlation between dipole moment and corrosion inhibition efficiency, the inhibitory efficiency suggests that a high dipole moment signals strong corrosion inhibition potency. In different studies, it was found that lowering the dipole moment value increased corrosion   www.nature.com/scientificreports/  inhibition efficiency. The assessed inhibitor has a low dipole moment value, suggesting a firmer coating of the metal surface when the dipole moment value is low.
Mulliken charges. Table 10 shows the Mulliken atomic charges of the studied inhibitor. Mulliken charges is a widely used technique for predicting the interactions between adsorption sites 74 . By donating and receiving electrons, the heteroatoms in the inhibitor molecules boost the capacity to adsorb on the MS surface 75 . The inhibitor is efficient due to oxygen and nitrogen atoms in the inhibitor molecules and Table 10  Some researchers in 1999 used the right and left derivatives about the number of electrons to determine the electrophilic and nucleophilic Fukui functions of the k site in a molecule (17)(18)(19): Local reactivity. The Fukui indices for each atom in the inhibitors were determined at the B3LYP/6-31++G level for a better understanding of the local reactivity of the tested inhibitor. The Fukui indices and local descriptors provide more complete information about the reactivity of the compounds under investigation and can help distinguish each portion of the inhibitor molecule based on its chemical activity with various substituent functional groups. As a result, the nucleophilic attack site will be where the value of f − is at its highest, whereas f + controls the site for electrophilic assault. The results show that the atoms O(10), O (13), N(11), N(12), N (14), and N (15) have the highest f − kfk − values f-or nucleophilic attack, suggesting a proclivity to donate electrons to unoccupied molecular orbitals on the iron surface, resulting in the formation of a coordinate bond. This is consistent with the computed HOMO density. The atoms O(10), O (13), N(11), N(12), N (14), and N(15) in the investigated inhibitor had the greatest f − kfk − values for the electrophilic attack, indicating that these are the locations most capable of accepting electrons to form feedback bonds with the Fe surface. This is also consistent with the LUMO orbital density calculated and supported by the values of the local dual indices (Δf, Δσ, and Δω), which show that this inhibitor has numerous active sites, with most centres having values of the two descriptors less than 0, except for a few atoms that have values greater than 0, indicating electrophilic centres. A closer look reveals that the carbon atoms have undergone back-donation, which corresponded to the border orbital results (Fig. 17). These findings suggest that the tested inhibitor molecule will have numerous active sites that will interact with the iron substrate, most likely locations with N and O atoms which are the most plausible sites for attaching to the iron surface via electron donation to the Fe 3d orbitals 76 . Furthermore, the metal surface and the tested inhibitor molecule may have a strong bond.
Proposed protection mechanism. The corrosion protection efficiency on the MS surface in an acidic environment can be exhibited based on the size of the inhibitor molecular chemical structure, the interaction modes with the iron atoms of the metal surface include the nature of the bonds (chemisorption) and the number of adsorption sites (physisorption). The N and O atoms in the inhibitor molecule all operate as adsorption sites, thus the inhibitor might use unpaired electrons to establish coordination bonds and chemisorb onto the MS surface. The protonation of nitrogen atoms is simple and can be accomplished through physisorption with chloride ions. The presence of unpaired electrons and the inductive impact of methylene groups are credited with the inhibitor's high inhibitive potency. On the steel/HCl interface, Fig. 18 depicts a possible blocked mechanism of www.nature.com/scientificreports/ the adsorption inhibitor molecules. Furthermore, the free electrons of the nitrogen and oxygen atoms are transferred to the d-orbitals of the iron atoms.

Conclusion
The physical and chemical interactions between a metal and its environment cause changes in its characteristics, such as corrosion, which might alter the function, therefore corrosion inhibitors are often used to protect the metallic surface from corrosion. A corrosion inhibitor was synthesised and fully characterised using FTIR, 1 H NMR, 13 C NMR and mass spectrometry. The analysis revealed that: 1. Nonanedihydrazide is an effective corrosion inhibitor of MS in an HCl environment. The corrosion was controlled through the adsorption of inhibitor molecules onto the metal surface. As a mixed-type inhibitor, nonanedihydrazide showed outstanding inhibitory effectiveness, with increasing efficacy as the nonanedihydrazide concentration increased but decreased correspondingly as the temperature increased. 2. The inhibition efficiency obtained from mass loss measurements agreed with the EIS experimental results and polarisation techniques in which the treated environment had a higher value than the untreated one. As the concentration of nonanedihydrazide increased, the inhibitor inhibitive value increased. 3. The Langmuir isotherm model was used to explain the adsorption of nonanedihydrazide molecules on the MS surface. 4. The low E LUMO of the nonanedihydrazide molecules combined with the high E HOMO reveals that the nonanedihydrazide molecules were reactive by serving as a donor, hence confirming the predicted inhibition. The electronegativity atoms have a significant effect on the corrosion inhibition efficiency of nonanedihydrazide molecules, and the atom with a negative charge has a HOMO centre, so the nonanedihydrazide molecule coordinates with the iron atoms d-orbitals on the surface MS from these negatively charged atoms. 5. Nonanedihydrazide molecules show significant corrosion protection properties and are thought to be more effective when heteroatoms are added to the structure.  www.nature.com/scientificreports/