clear 
T = 1:3600;
Csr = 0.01;
V = 0.551;
k = 0.0016;
D = 0.3;

a = size (T);
finish = a(1,2);

k=1;
for i = 1:finish
    temp(i) = (D*(1/k*(1-exp(-k*T(i))))/(T(i)*V))-Csr;
    %if temp(i)>=0
     %   par(k)=temp(i);
     %   k=k+1;
     %end
     par = abs(temp);
end

b = min(par)
c = size(par);

for i =1 : c(1,2) 
if par(i) == b
    wynik = T(i)
end
end