function Xt = cnn(A,Btem,Bias,x0,u,tf)
% CNN (A,Btem,Bias,x0,u,tf) 
% runs the CNN with until time tf 
% returning the final state matrix 
 
global Atem Bu I m n 

I = Bias;
Atem = A;
Bu = reflect_corr2(u,Btem);
[m,n] = size(x0);

x0 = x0(:);

[t,y] = ode23('cnnderiv', [0, tf/2, tf], x0);
%[t,y] = ode45('cnnderiv', 0, tf, x0);

ly = size(y,1);
Xt = reshape(y(ly,:),m,n);

