diff options
Diffstat (limited to '218/main.cpp')
-rw-r--r-- | 218/main.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/218/main.cpp b/218/main.cpp new file mode 100644 index 0000000..379804a --- /dev/null +++ b/218/main.cpp @@ -0,0 +1,19 @@ +#include <iostream> +#include "include/praktable.hpp" +#include "include/prakphys.hpp" + +int main() { + prak::table<f64> t("data"); + t .add_column("1/dt") + .apply(prak::inv<f64>, "dt", "1/dt") + .write_plot("1dt(dp).plot", "dp", "1/dt", std::nullopt) + .print(); + auto [A, B] = t.least_squares_linear("dp", "1/dt", std::nullopt, 0.00001); + f64 W = 3.82; + prak::pvalue<f64> beta = {1.51e-6, 0.05e-6}, T0 = {298.5, 1}, p0 = {0.99e5, 500}, + CPR = A * W * T0 / beta / p0, CP = CPR * prak::R<f64>, + CVR = CPR - 1.0, CV = CVR * prak::R<f64>, i = 2.0*CV/prak::R<f64>; + + std::cout var(A) var(B) var(beta) var(p0) var(CPR) var(CP) var(CVR) var(CV) var(i) << std::endl; + return 0; +} |