function y=diff(t,u)

u_in = [0.5 1 0 0 0];    %mol/dm3
V = 1;                   %dm3
q = 2;                   %dm3/s


% rate constants 
k11 = 0.412;      %1/h
k12 = 2.3407e-17;
k21 = 0.055;      %1/h
k22 = 3.1247e-18;

% reaction rates 
r11 = k11*u(1);   % mol/h
r12 = k21*u(3)*u(5);
r21 = k21*u(3);   % mol/h
r22 = k22*u(4)*u(5);

y=zeros(size(u));

y(1) = r12-r11         + q/V*(u_in(1)-u(1));   %Bensen
y(2) = r12-r11+r22-r21 + q/V*(u_in(2)-u(2));   %Cl2
y(3) = r11-r12+r22-r21 + q/V*(u_in(3)-u(3));   %monoklorbensen
y(4) = r21-r22         + q/V*(u_in(4)-u(4));   %diklorbensen
y(5) = r11-r12+r21-r22 + q/V*(u_in(5)-u(5));   %HCl

%legend('C_6H_6','Cl_2','monoklorbensen','diklorbensen','HCl')
