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.
--- /dev/null
+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