% HOLDUP_CHANGE.M %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Compute holdup change

function dm = holdup_change(L,V,L_in,V_in)

Nt = length(L);

dm = [
    L_in - L(1) + V(2) - V(1)
    L(1:Nt - 3) - L(2:Nt - 2) + V(3:Nt - 1) - V(2:Nt - 2)
    L(Nt - 2) - L(Nt - 1) + V(Nt) - V(Nt - 1)
    L(Nt - 1) - L(Nt) +  V_in(1) - V(Nt)
];
