function [A,x] = model_discret(x,dt,t_sample)

% Please enter your model in lines 18 and following

kBC=3;
kCB=2;
Vdot=1;
VR=10;
ca0 = 1;
h = dt;

t = 0;

while t < t_sample
% Implement your model here:
% x = [f1;f2;f3;f4], cA is x(1), cB is x(2), cC is x(3), kAB is x(4)
x = [(x(1)-(x(4)+Vdot/VR)*h*x(1) + Vdot/VR*ca0*h)
       (x(2)+x(1)*x(4)*h - Vdot/VR*x(2)*h - kBC*x(2)^2 *h + kCB*x(3)*h)
       (x(3)+kBC*x(2)^2 *h -(kCB+Vdot/VR)*h*x(3))
       x(4)];   

t = t + h;
end   

Acon = [-Vdot/VR-x(4), 0, 0, -x(1); x(4), -Vdot/VR-2*kBC*x(2), kCB, x(1);
     0, 2*kBC*x(2), -Vdot/VR-kCB, 0; 0,0,0,0];

A = expm(Acon*t_sample);
 
% A = [1-(Vdot/VR + x(4))*h , 0 , 0 , -x(1)*h;
%      x(4)*h     (1-Vdot/VR*h-2*kBC*x(2)*h)    kCB*h  x(1)*h;
%        0               2*kBC*x(2)*h        1-(Vdot/VR+kCB)*h    0;
%        0                0                      0       1  ];
%    