RCK model with given initial and final steady-state values

I am simulating a Ramsey–Cass–Koopmans model which includes a technology catch-up process. Although all the equations are specified correctly in the model and the initial and final values are non-zero when calculated based on the formulas provided in the code, I get the following error messages:

Error using print_info
Impossible to find the steady state (the sum of square residuals of the static equations is 0.2594). Either the model doesn’t have
a steady state, there are an infinity of steady states, or the guess values are too far from the solution

Error in check (line 48)
print_info(info, 0, options);

Error in basemodel.driver (line 209)
oo_.dr.eigval = check(M_,options_,oo_);

Error in dynare (line 278)
evalin(‘base’,[fname ‘.driver’]);

Can you spot where the issue comes from? Please find the code below:

> //Number of periods
> @#define simulation_periods=106
>  
> //Define variables
> var c       ${c}$     (long_name='Consumption')
>     k       ${k}$     (long_name='Capital')
>     y       ${y}$     (long_name='Output')
>     i       ${i}$     (long_name='Investment')
>     alpha   ${alpha}$ (long_name='Distance to the technology frontier')
> ;
>  
> //Define exogenous variables
> varexo 
> l     ${l}$     (long_name='Labour')
> n     ${n}$     (long_name='Population growth')
> ;
>  
> //Define parameters
> parameters
> beta            ${\beta}$        (long_name='Discount factor')
> theta           ${\theta}$       (long_name='Capital share - China')
> theta_star      ${\theta_star}$  (long_name='Capital share - US')
> delta           ${\delta}$       (long_name='Depreciation rate - China')
> delta_star      ${\delta_star}$  (long_name='Depreciation rate - US')
> g               ${\g}$           (long_name='Technology growth rate - US')
> gamma0          ${\gamma0}$      (long_name='Initial technology - China')
> gamma           ${\gamma}$       (long_name='Catch-up bound')
> eta             ${\eta}$         (long_name='Catch-up rate')
> ;
>  
> //Set parameters
> beta = 0.948;
> theta = 0.5;
> theta_star = 0.39;
> delta = 0.054;
> delta_star = 0.040;
> g = 0.02;
> gamma0 = 0.03;
> gamma = 0.22;
> eta = 0.08;
>  
> //Enter the model equations
> model;
>     [name='Investment equation']
>     i(-1)=(1+g)*(1+n)*k-(1-delta)*k(-1);
>     [name='Resource constraint']
>     c+i=y;
>     [name='Euler equation']
>     1/c*(1+g)=beta*1/c(+1)*(theta*k(+1)^(theta-1)*(gamma*alpha(+1)*l(+1))^(1-theta)+1-delta);
>     [name='Production function']
>     y=k^theta*(gamma*alpha*l)^(1-theta);
>     [name='Convergence to technology frontier']
>     log(alpha)=(1-eta)*log(alpha(-1));
> end;
>  
> //Initial values
> initval;
>     l=0.563;
>    n=0.865;
>     alpha=exp((1-eta)*log(gamma0))/gamma;
>     k=(((1+g)*beta^(-1)+delta-1)*(theta)^(-1))^(1/(theta-1))*gamma0*l;
>     i=(1+g)*(1+n/100)*k-(1-delta)*k;
>     y=k^theta*(gamma0*l)^(1-theta);
>     c=y-i;
> end;
> check;
>  
> //Shocks (path of exogenous variables)
> shocks;
>     var l;
>     periods 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106;
>     values 0.563, 0.564, 0.565, 0.567, 0.569, 0.570, 0.572, 0.573, 0.573, 0.573, 0.574, 0.573, 0.573, 0.572, 0.571, 0.571, 0.570, 0.569, 0.569, 0.568, 0.567, 0.565, 0.562, 0.560, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557, 0.557;
>     var n;
>     periods 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106;
>     values 0.865, 0.796, 0.746, 0.709, 0.665, 0.71, 0.652, 0.63, 0.607, 0.622, 0.619, 0.634, 0.646, 0.66, 0.683, 0.667, 0.65, 0.74, 0.652, 0.665, 0.563, 0.607, 0.586, 0.376, 0.3, 0.131, 0.004, -0.005, -0.025, -0.044, -0.068, -0.091, -0.113, -0.135, -0.156, -0.178, -0.198, -0.217, -0.237, -0.26, -0.277, -0.295, -0.309, -0.323, -0.34, -0.358, -0.375, -0.393, -0.418, -0.439, -0.471, -0.502, -0.536, -0.574, -0.614, -0.657, -0.701, -0.742, -0.784, -0.825, -0.866, -0.905, -0.939, -0.965, -0.992, -1.012, -1.026, -1.039, -1.045, -1.05, -1.054, -1.055, -1.053, -1.057, -1.054, -1.054, -1.055, -1.058, -1.067, -1.072, -1.085, -1.099, -1.113, -1.129, -1.144, -1.161, -1.174, -1.184, -1.195, -1.202, -1.206, -1.206, -1.207, -1.203, -1.198, -1.192, -1.187, -1.181, -1.182, -1.18, -1.181, -1.184, -1.188, -1.193, -1.197, -1.207;
> end;
>  
> //Final values
> endval;
>     l=0.557;
>     n=-1.207;
>     k=(((1+g)*beta^(-1)+delta-1)*(theta^(-1)))^(1/(theta-1))*gamma*l;
>     i=(1+g)*(1+n/100)*k-(1-delta)*k;
>     y=k^theta*(gamma*l)^(1-theta);
>     c=y-i;
> end;
>  
> //Perfect foresight setup: simulation for 106 periods (can check the settings in oo_.endo_simul and oo_.exo_simul)
> perfect_foresight_setup(periods=@{simulation_periods});
>  
> //Compute the solution
> perfect_foresight_solver;
>  
> //Graphs
> rplot k c i y;