农业废弃物制储氢材料论文复现报告

Author

黄娇

Published

April 9, 2026

一、数据准备

set.seed(123)
group <- factor(c("UTL0", "UTL1", "UTL2", "UTL3",
                  "OP0", "OP1", "OP2", "OP3"))

H2_excess <- c(0, 4.44, 4.83, 5.29,
               0, 4.06, 4.78, 5.24)

BET_SSA <- c(5, 2008, 2378, 2814,
             3, 1700, 2218, 2417)

dat <- data.frame(group, H2_excess, BET_SSA)
dat
  group H2_excess BET_SSA
1  UTL0      0.00       5
2  UTL1      4.44    2008
3  UTL2      4.83    2378
4  UTL3      5.29    2814
5   OP0      0.00       3
6   OP1      4.06    1700
7   OP2      4.78    2218
8   OP3      5.24    2417
library(ggplot2)
library(dplyr)

mean_data <- dat %>%
  group_by(group) %>%
  summarise(mean_H2 = mean(H2_excess))

ggplot(dat, aes(x = group, y = H2_excess, fill = group)) +
  geom_boxplot(width = 0.6, outlier.shape = NA, alpha = 0.7) +
  geom_jitter(width = 0.2, size = 2.5, color = "black") +
  geom_text(data = mean_data,
            aes(label = sprintf("%.2f", mean_H2)),
            vjust = -0.8, size = 4, fontface = "bold") +
  labs(title = "不同样品高压储氢过量值对比",
       x = "样品类型",
       y = "储氢量 (wt%)") +
  theme_bw() +
  theme(plot.title = element_text(hjust = 0.5),
        legend.position = "none")

不同样品高压储氢过量值对比

二、描述性统计

summary(dat[, c("H2_excess", "BET_SSA")])
   H2_excess        BET_SSA    
 Min.   :0.000   Min.   :   3  
 1st Qu.:3.045   1st Qu.:1276  
 Median :4.610   Median :2113  
 Mean   :3.580   Mean   :1693  
 3rd Qu.:4.933   3rd Qu.:2388  
 Max.   :5.290   Max.   :2814  

三、相关性分析(BET比表面积 与 过量储氢量)

cor_result_kendall <- cor.test(dat$BET_SSA, dat$H2_excess, method = "kendall")
Warning in cor.test.default(dat$BET_SSA, dat$H2_excess, method = "kendall"):
Cannot compute exact p-value with ties
cor_result_kendall

    Kendall's rank correlation tau

data:  dat$BET_SSA and dat$H2_excess
z = 3.3662, p-value = 0.000762
alternative hypothesis: true tau is not equal to 0
sample estimates:
      tau 
0.9819805 
cor_result_pearson <- cor.test(dat$BET_SSA, dat$H2_excess, method = "pearson")
cor_result_pearson

    Pearson's product-moment correlation

data:  dat$BET_SSA and dat$H2_excess
t = 17.157, df = 6, p-value = 2.51e-06
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
 0.9434107 0.9982536
sample estimates:
      cor 
0.9899613 

备注: 由于数据存在并列值(ties),Kendall’s tau 使用了正态近似计算 p 值,但结果依然显著(p < 0.001)。

四、UTL 和 OP 两组之间的差异比较

dat$type <- ifelse(grepl("UTL", dat$group), "UTL", "OP")
t.test(H2_excess ~ type, data = dat)   # 比较过量储氢量

    Welch Two Sample t-test

data:  H2_excess by type
t = -0.070009, df = 5.9969, p-value = 0.9465
alternative hypothesis: true difference in means between group OP and group UTL is not equal to 0
95 percent confidence interval:
 -4.314688  4.074688
sample estimates:
 mean in group OP mean in group UTL 
             3.52              3.64 
t.test(BET_SSA ~ type, data = dat)     # 比较比表面积

    Welch Two Sample t-test

data:  BET_SSA by type
t = -0.26163, df = 5.9096, p-value = 0.8025
alternative hypothesis: true difference in means between group OP and group UTL is not equal to 0
95 percent confidence interval:
 -2251.493  1817.993
sample estimates:
 mean in group OP mean in group UTL 
          1584.50           1801.25 

五、保存图表

ggsave("results/h2_storage_comparison_reproduced.png", width = 6, height = 4)

# 显示图片
knitr::include_graphics("results/h2_storage_comparison_reproduced.png")

储氢性能对比图(复现)