aboutsummaryrefslogtreecommitdiffstats
path: root/218/main.cpp
diff options
context:
space:
mode:
authorjustanothercatgirl <sotov2070@gmail.com>2025-04-14 00:34:52 +0300
committerjustanothercatgirl <sotov2070@gmail.com>2025-04-14 00:34:52 +0300
commit5ee716791bf7a8ca74c1670a6887a53ab92141f6 (patch)
tree0a5a522f89d258ec36f4af23cc60aaa578abe7e8 /218/main.cpp
parent320bf2f0155edd67557a3042403eeb843b90a41d (diff)
added 218, 226, 234, 240
Diffstat (limited to '218/main.cpp')
-rw-r--r--218/main.cpp19
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;
+}