R Under development (unstable) (2025-07-25 r88451 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(chapensk) Loading required package: Bessel > > # graphics parameters > width <- 10 > height <- 5 > mar <- c(5.1, 4.6, 0.2, 0.6) > mai <- c(1.02, 0.82, 0.04, 0.04) > family <- "Helvetica" > pointsize <- 12 > lwd <- 1 > > c2h6 <- Gas("ethane") > > if (interactive()) { + if (exists("outputDevice")) { + if (outputDevice == "pdf") pdf(file = "man/figures/ethane.pdf", width = width, height = height, family = family, pointsize = pointsize) + if (outputDevice == "svg") svg(file = "man/figures/ethane.svg", width = width, height = height, family = family, pointsize = pointsize) + } + split.screen(figs = c(1, 2)) + } > > ethane_viscosity <- subset(ethane_data, (property == "viscosity") & (T >= 90) & (T <= 675), select = c(T, value)) > sigma0 <- c2h6$sigma > epsk0 <- c2h6$epsk > c2h6$zeta <- 0 > print("Literature data") [1] "Literature data" > print(c2h6$sigma) [1] 4.443 > print(c2h6$epsk) [1] 215.7 > ethane_viscosity$value <- 1E-6 * ethane_viscosity$value > ethane_B <- subset(ethane_data, (property == "BQFH") & (T >= 220) & (T <= 623)) > ethane_B$value <- 1E-6 * ethane_B$value > fit <- c2h6$fit_B_viscosity_data(ethane_B, ethane_viscosity, log = FALSE) > sigma1 <- c2h6$sigma > epsk1 <- c2h6$epsk > zeta1 <- c2h6$zeta > print("Fit of B and viscosity data") [1] "Fit of B and viscosity data" > print(c2h6$sigma) [1] 4.358396 > print(c2h6$epsk) [1] 244.8239 > print(c2h6$zeta) [1] 0 > stopifnot(round(c2h6$sigma, 2) == 4.36) > stopifnot(round(c2h6$epsk, 1) == 244.8) > c2h6$sigma <- sigma0 > c2h6$epsk <- epsk0 > c2h6$zeta <- 0 > if (interactive()) { + screen(1) + } > par(mai = mai, mar = mar) > c2h6$fit_viscosity_data(ethane_viscosity) 3.217631e-13 (7.05e-01): par = (4.443 215.7) 2.078813e-13 (1.23e-01): par = (4.387213 232.5813) 2.045675e-13 (1.14e-02): par = (4.379045 235.3511) 2.045379e-13 (1.20e-03): par = (4.378 235.6692) 2.045376e-13 (1.27e-04): par = (4.377886 235.7031) 2.045376e-13 (1.34e-05): par = (4.377874 235.7067) 2.045376e-13 (1.47e-06): par = (4.377872 235.707) Formula: value ~ .self$viscosity(T, sigma, epsk, zeta = 0, third_order_correction = TRUE) Parameters: Estimate Std. Error t value Pr(>|t|) sigma 4.37787 0.02068 211.71 <2e-16 *** epsk 235.70704 6.01015 39.22 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 9.642e-08 on 22 degrees of freedom Number of iterations to convergence: 6 Achieved convergence tolerance: 1.474e-06 > lines(ethane_viscosity$T, 1E6 * c2h6$viscosity(ethane_viscosity$T, sigma = sigma1, epsk = epsk1, zeta = zeta1), col = "red", lty = 2) > if (interactive()) { + legend("top", bty = "n", legend = "(a)") + screen(2) + } > print("Fit of viscosity data") [1] "Fit of viscosity data" > print(c2h6$sigma) [1] 4.377872 > print(c2h6$epsk) [1] 235.707 > stopifnot(round(c2h6$sigma, 2) == 4.38) > stopifnot(round(c2h6$epsk, 1) == 235.7) > par(mai = mai, mar = mar) > c2h6$zeta <- 0 > c2h6$fit_B_data(ethane_B) 3.298456e-09 (2.96e+00): par = (4.377872 235.707) 1.793282e-09 (2.19e+00): par = (4.70964 211.6114) 3.304397e-10 (2.73e-01): par = (4.961272 200.5874) 3.075578e-10 (2.91e-03): par = (4.950029 201.9349) 3.075552e-10 (2.71e-05): par = (4.949684 201.9616) 3.075552e-10 (3.99e-07): par = (4.949678 201.962) Formula: value ~ .self$B(T, sigma, epsk, zeta = 0) Parameters: Estimate Std. Error t value Pr(>|t|) sigma 4.94968 0.05755 86.00 <2e-16 *** epsk 201.96198 3.45749 58.41 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 4.528e-06 on 15 degrees of freedom Number of iterations to convergence: 5 Achieved convergence tolerance: 3.995e-07 > lines(ethane_B$T, 1E6 * c2h6$B(ethane_B$T, sigma = sigma1, epsk = epsk1), col = "red", lty = 2) > if (interactive()) { + legend("top", bty = "n", legend = "(b)") + close.screen() + dev.off() + } > print("Fit of B data") [1] "Fit of B data" > print(c2h6$sigma) [1] 4.949678 > print(c2h6$epsk) [1] 201.962 > stopifnot(round(c2h6$sigma, 2) == 4.95) > stopifnot(round(c2h6$epsk, 1) == 202.0) > > proc.time() user system elapsed 2.1 0.1 2.2