# Why are my simulations not starting from initial values?

**URL:** <https://forum.dynare.org/t/why-are-my-simulations-not-starting-from-initial-values/25518>\
**Category:** Perfect foresight simulations\
**Created:** [10 April 2024 17:57 UTC](https://forum.dynare.org/t/why-are-my-simulations-not-starting-from-initial-values/25518 "2024-04-10T17:57:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hamza.jamaal](https://forum.dynare.org/letter_avatar_proxy/v4/letter/h/f19dbf/32.png) [@hamza.jamaal](https://forum.dynare.org/u/hamza.jamaal)\
**Post date:** [10 April 2024 17:57 UTC](https://forum.dynare.org/t/why-are-my-simulations-not-starting-from-initial-values/25518/1 "2024-04-10T17:57:55Z")

</div>

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?

```auto
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);

```

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [11 April 2024 07:19 UTC](https://forum.dynare.org/t/why-are-my-simulations-not-starting-from-initial-values/25518/2 "2024-04-11T07:19:50Z")

</div>

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

```auto
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);

```
