function [A] = groove_leak_area(N, t1, t2, area, tglow, tgup)
%UNTITLED2 Summary of this function goes here
%   Detailed explanation goes here
dt = tgup - tglow;
A = zeros(N, 1);
tt = t1 + (0:N).*(t2 - t1)/N;
if area  ~= 0
    for ii = 1 : N
        tlow = tt(ii); tup = tt(ii+1);
        if tlow < tglow && tup < tgup && tup > tglow, A(ii) = area*(tup-tglow)/dt;
        elseif  tlow <= tglow && tup >= tgup, A(ii) = area;
        elseif  tlow > tglow &&  tlow < tgup, A(ii) = area*(tgup-tlow)/dt;
        end 
    end
 A = flip(A);
end

end