Coal is the ballast stone of China’s energy and resource security. It is of great significance to realize the clean processing and efficient utilization of coal in the context of “dual carbon”. In particular, ash detection is important for the clean and intelligent utilization of coals. To address the outstanding problems of the existing ash detection that need to be improved in terms of detection accuracy, the distribution of ash and elemental composition of coal samples were systematically studied using slow-ashing and X-ray fluorescence (XRF) detection methods around typical coal in the Huainan and Huaibei mining areas. On this basis, the ash-elements feature dataset was constructed by adopting machine learning theory. Combined with Gray System Theory and Metabolic Algorithm, an adaptive GM(1,N) dynamic network gray fitting optimization model was constructed and the dynamic network algorithm flow was designed. For the GM(1,N) dynamic model, the key hyper-parameters were proposed and the model fitting performance was comprehensively evaluated by comparing with conventional fitting methods. The results show that the coal in the Huainan and Huaibei mining areas can be regarded as the composition of combustible elements and ash-forming elements. In the ash-forming elements, the highest contents are Si and Al, followed by S, Fe, and Ca, etc., and the lowest contents are P and Cl, etc. Moreover, the total content of ash-forming elements in coal is positively correlated with ash content, while negatively correlated with combustible elements. The GM(1,N) dynamic network ash fitting model and its algorithm flow were designed in the main line of sample data division → dynamic network ash fitting → model evaluation mechanism → dynamic fitting model adaptive optimization → robustness enhancement → multi-round iterative optimization, which effectively improve the stability and freshness of the data set with fast iterative convergence. The accuracy of the GM(1,N) dynamic network model is up to 100% when the ash fitting error threshold is 5%. Comparing with the classical GM(1,N) model and the conventional multiple linear regression model, it is demonstrated that the ash fitting performance of the new model is significantly improved, with the relative errors between the fitted and true values ranging from 0.16% to 4.96% and the mean error value of only 2.29%.