Why are my simulations not starting from initial values?

This is the code i’m running but the problem is that I have specified an initial value of k = 5.07 but it starts from 5.14 when i plot k, how do i make it start from 5.07?

var c, k, y;

parameters alpha, delta, a, n, g, s;

alpha = 0.3;

delta = 0.05;

a = 1;

n = 0.01;

g = 0.02;

s = 0.2525;

model;

y =a*k^alpha;

c = y*(1-s);

k(+1)= (1/((1+n)*(1+g)))*(s*a*k^alpha + (1-delta)*k);

end;

initval;

c = 1.22;

k = 5.07;

y = 1.62;

end;

endval;

c = 1.22;

k = 5.07;

y = 1.62;

end;

steady;

simul(periods=100);

plot(k);

Because you did not declare capital as predetermined. In Dynare 6, use

var c, k, y;

parameters alpha, delta, a, n, g, s;
predetermined_variables k;

alpha = 0.3;

delta = 0.05;

a = 1;

n = 0.01;

g = 0.02;

s = 0.2525;

model;

y =a*k^alpha;

c = y*(1-s);

k(+1)= (1/((1+n)*(1+g)))*(s*a*k^alpha + (1-delta)*k);

end;

initval;

c = 1.22;

k = 5.07;

y = 1.62;

end;


endval;

c = 1.22;

k = 5.07;

y = 1.62;

end;

steady;

simul(periods=100);
send_endogenous_variables_to_workspace;
plot(k);