Add a function that generates pseudo experiment
authorLukáš Jiřiště <jiriste@icpf.cas.cz>
Tue, 7 May 2024 13:51:28 +0000 (15:51 +0200)
committerLukáš Jiřiště <jiriste@icpf.cas.cz>
Tue, 7 May 2024 13:51:28 +0000 (15:51 +0200)
I add this function to generate data that is qualitatively similar to
the data produced by the experiment. The real data may prove more
difficult, but the structure of the processing should be the same.

pseudo_exp.m [new file with mode: 0644]

diff --git a/pseudo_exp.m b/pseudo_exp.m
new file mode 100644 (file)
index 0000000..a1af932
--- /dev/null
@@ -0,0 +1,11 @@
+function [t, p, t_open] = pseudo_exp(p1, V1, V2, Vvz, n)
+       t_open = rand(1, n) * (50 - 15) + 15;
+       t_open = ceil(cumsum(t_open));
+       t = (0:ceil(t_open(n)) + 20);
+       p = rand(size(t)) * p1 / 100;
+       for i = ceil(t_open)
+               p2 = (p(i + 1) * (V2 - Vvz) + p1 * V1) / (V1 + V2 - Vvz);
+               peq = 0.7 * p2;
+               p(i + 1:end) += (p2 - peq) * exp((-(i + 1:length(p)) + i) / 10) + peq;
+       end
+end