From: Lukáš Jiřiště Date: Tue, 14 May 2024 13:01:33 +0000 (+0200) Subject: Implement process_experiment function X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=a7687a88a9df9626917705c373d687a1ab4a8f42;p=analyse_servo.git Implement process_experiment function This function accepts the pressure-time dependence along with other important characteristics of the aparature (volumes, temperature). It also optionally accepts the pressure of V1 which is then used to get a more precise value for the pressure after connecting V1 to V2. --- diff --git a/process_experiment.m b/process_experiment.m new file mode 100644 index 0000000..74cfc5a --- /dev/null +++ b/process_experiment.m @@ -0,0 +1,13 @@ +function [p_eq n] = process_experiment(t, p, V1, V2, Vvz, p_up = 0, T = 298, graph = 1, threshold = 0.05) + R = 8.314; + [p_eq, p_ao] = get_important_pressure(t, p, graph, threshold); + if (p_up != 0) + p_ao = (p_up(find(detect_open(t, p, threshold) == 1) - 1) * V1 + p_eq(1:(end - 1)) .* (V2 - Vvz)) / (V1 + V2 - Vvz); + end + delta_n = (p_ao - p_eq(2:end)) .* (V1 + V2 - Vvz) / R / T; + n = cumsum(delta_n); + if (graph) + figure(); + plot(p_eq, [0 n], "-o"); + end +end