Calibrating parameters in OLG model

I am trying to calibrating my parameters for my OLG model to target k/y=2.8 naturkapital/y=0.9 and humankapital/y=2.4.
Can someone help me out?

% 1.1 Define endogenous variables
%--------------------------------------------------------------------------
var s, r, w, k, welfare, welfare1, cons_m, cons_o, naturkapital, cons, y, e, humankapital,  budgetconstraint, k_y, naturkapital_y, humankapital_y;
// e=educational expenditure
predetermined_variables k humankapital; 
%--------------------------------------------------------------------------
% 1.2 Define exogenous variables
%--------------------------------------------------------------------------
varexo alpha ; 
%--------------------------------------------------------------------------
% 1.3 Define parameters
%--------------------------------------------------------------------------
parameters sigma, delta, tau, h0, h1, h2, h3, gamma, A, k_value, cons_value, phi, beta, theta, eta, dep, humankapital_value;
%--------------------------------------------------------------------------
% 1.4 Declare parameter values
%--------------------------------------------------------------------------
sigma = 0.8; 
delta = 1.2; 
h0 = 4; 
h1 = 1; 
h2 = 1;
h3 = 0.5; 
gamma = 1.837147; 
A = 1; 
tau = 1.1;                     //market imperfection (borrowing rate < return on savings)
dep=0.05;            //depreciation of physical kapital
phi = 0.1996;               // Elasticity of educational inputs on human capital
beta = 0.8;                   // Intergenerational spillover of human capital
theta = 0.16445;       // Elasticity of kapital on human capital
eta=0.11;
//*************************************************************************
% 2. Model
//*************************************************************************
model; 
s = (w - tau * (1 + r) * e(-1)) / (1 + (1 + delta)^(1/sigma) * (1 + r(+1))^(1 - 1/sigma));
r= alpha * A*naturkapital*k^(alpha-1)*humankapital-dep;
w = (1-alpha)*A*(h0-h1*k^(gamma)-h2*k(-1)^gamma-h3*k(-2)^gamma)*k^alpha*humankapital; 
k(+1) = (1-dep)*k+s; 
welfare1 = cons_m^(1-sigma)/(1-sigma)+1/(1+delta)*cons_o(+1)^(1-sigma)/(1-sigma);
welfare = ((w - tau * (1 + r) * e(-1))^(1 - sigma) / (1 - sigma)) * (1 + (1 + delta)^(-1/sigma) * (1 + r(+1))^(1/sigma - 1))^sigma;
cons_m = w-s-(1+r)*tau*e(-1); 
cons_o = (1+r)*s(-1); 
cons = cons_m + cons_o;
naturkapital = (h0-h1*k^gamma-h2*k(-1)^gamma-h3*k(-2)^gamma);
y = naturkapital*A*k^alpha*humankapital;
humankapital(+1) = e^phi * k^theta * humankapital^beta + eta*naturkapital(+1);
budgetconstraint = w - (1+r)*tau*e(-1) - cons_m - cons_o(+1)/(1+r(+1));
e=((tau*(1+r(+1)))/(naturkapital(+1)*(1-alpha)*A*k(+1)^alpha*k^theta*humankapital^beta*phi))^(1/(phi-1));
k_y= k/y;
naturkapital_y= naturkapital/y;
humankapital_y= humankapital/y;
end;

//*************************************************************************
% 3. Steady State, Initial and End Values Block
//*************************************************************************
%--------------------------------------------------------------------------
% 3.1 initval-block: set initial condition to steady state value
%--------------------------------------------------------------------------
initval;
y = 0.43605;
k = 1.220944;
humankapital = 1.046524;
naturkapital = 0.3924462;
k_y=2.8;
naturkapital_y=0.9;
humankapital_y=2.4;
s = 0.12;
r = 0.11;
w = 0.31;
cons_m = 0.1297;
cons_o = 0.1308;
cons = 0.2605;
e = 0.047;
alpha = 0.3; 
end;

steady; 
histval;
humankapital(-2) = 0.4;
humankapital(-1) 0.4;
humankapital(0) = 0.4;
k(0) = 0.4; 
k(-1) = 0.4; 
k(-2) = 0.4;
r(0) = alpha*A*(h0-h1*k_value^(gamma)-h2*k_value^gamma-h3*k_value^gamma)*k_value^(alpha-1)*humankapital-dep;
w(0) = (1-alpha)*A*(h0-h1*k_value^(gamma)-h2*k_value^gamma-h3*k_value^gamma)*k_value^alpha*humankapital;
naturkapital(0) = h0-h1*k_value^gamma-h2*k_value^gamma-h3*k_value^gamma;
end;

%--------------------------------------------------------------------------
% 3.3 steady-command: 
%--------------------------------------------------------------------------
steady;

perfect_foresight_setup(periods=15);
perfect_foresight_solver;

Usually, that involves adjusting parameters like beta. What is your current approach?

I tried calculating the parameters manually to target the ratios, and now my steady state values look great, however dynare cannot solve perfect foresight anymore. I added a constant to humankapital, so it looks like:
humankapital(+1) = 0.58 + e^phi * k^theta * humankapital^beta + eta*naturkapital(+1);
Maybe my histval is nolonger properly defined??

Here are my
STEADY-STATE RESULTS:

s 0.0747648
r 0.0462572
w 0.30592
k 1.21805
welfare 4.98213
welfare1 4.98213
cons_m 0.198069
cons_o 0.0782232
naturkapital 0.408157
cons 0.276292
y 0.437029
e 0.0301177
humankapital 1.00921
test 0.0528863
budgetconstraint 0
k_y 2.78712
naturkapital_y 0.933936
humankapital_y 2.30926

and code:

% 1.1 Define endogenous variables

%--------------------------------------------------------------------------

var s, r, w, k, welfare, welfare1, cons_m, cons_o, naturkapital, cons, y, e, humankapital, test, budgetconstraint, k_y, naturkapital_y, humankapital_y;

predetermined_variables k humankapital;

%--------------------------------------------------------------------------

% 1.2 Define exogenous variables

%--------------------------------------------------------------------------

varexo alpha ;

%--------------------------------------------------------------------------

% 1.3 Define parameters

%--------------------------------------------------------------------------

parameters sigma, delta, tau, h0, h1, h2, h3, gamma, A, k_value, cons_value, phi, beta, theta, eta, dep, humankapital_value;

%--------------------------------------------------------------------------

% 1.4 Declare parameter values

%--------------------------------------------------------------------------

sigma = 0.8;

delta = 1.2;

h0 = 4;

h1 = 1;

h2 = 1;

h3 = 0.5;

gamma = 1.8371;

A = 1;

k_value = 1.22/3;

humankapital_value = 1.05/3;

tau = 1.05;

phi = 0.267; // Elasticity of educational inputs on human capital

beta = 0.5; // Intergenerational spillover of human capital

theta = 0.183;

eta=0.05;

dep=0.06138058;

//*************************************************************************

% 2. Model

//*************************************************************************

model;

s = (w - tau * (1 + r) * e(-1)) / (1 + (1 + delta)^(1/sigma) * (1 + r(+1))^(1 - 1/sigma));

r= alpha * A*naturkapital*k^(alpha-1)*humankapital-dep;

w = (1-alpha)*A*(h0-h1*k^(gamma)-h2*k(-1)^gamma-h3*k(-2)^gamma)*k^alpha*humankapital;

k(+1) = (1-dep)*k+s;

welfare1 = cons_m^(1-sigma)/(1-sigma)+1/(1+delta)*cons_o(+1)^(1-sigma)/(1-sigma);

welfare = ((w - tau * (1 + r) * e(-1))^(1 - sigma) / (1 - sigma)) * (1 + (1 + delta)^(-1/sigma) * (1 + r(+1))^(1/sigma - 1))^sigma;

cons_m = w-s-(1+r)*tau*e(-1);

cons_o = (1+r)*s(-1);

cons = cons_m + cons_o;

naturkapital = (h0-h1*k^gamma-h2*k(-1)^gamma-h3*k(-2)^gamma);

y = naturkapital*A*k^alpha*humankapital;

humankapital(+1) = 0.58 + e^phi * k^theta * humankapital^beta + eta*naturkapital(+1);

budgetconstraint = w - (1+r)*tau*e(-1) - cons_m - cons_o(+1)/(1+r(+1));

e=((tau*(1+r(+1)))/(naturkapital(+1)*(1-alpha)*A*k(+1)^alpha*k^theta*humankapital^beta*phi))^(1/(phi-1));

k_y= k/y;

naturkapital_y= naturkapital/y;

humankapital_y= humankapital/y;

test = y - cons - (k(+1)-(1-dep)*k) - (1+r)*tau*e(-1);

end;

//*************************************************************************

% 3. Steady State, Initial and End Values Block

//*************************************************************************

%--------------------------------------------------------------------------

% 3.1 initval-block: set initial condition to steady state value

%--------------------------------------------------------------------------

initval;

y = 0.43605;

k = 1.220944;

humankapital = 1.046524;

naturkapital = 0.3924462;

k_y=2.8;

naturkapital_y=0.9;

humankapital_y=2.4;

s = 0.12;

r = 0.11;

w = 0.31;

cons_m = 0.1297;

cons_o = 0.1308;

cons = 0.2605;

e = 0.0329;

alpha = 0.3;

test=0;

end;

steady;

histval;

humankapital(-2) = 0.58 + e^phi * k_value^theta * humankapital^beta + eta*naturkapital;

humankapital(-1) = 0.58 + e^phi * k_value^theta * humankapital^beta + eta*naturkapital;

humankapital(0) = 0.58 + e^phi * k_value^theta * humankapital^beta + eta*naturkapital;

k(0) = k_value;

k(-1) = k_value;

k(-2) = k_value;

r(0) = alpha*A*(h0-h1*k_value^(gamma)-h2*k_value^gamma-h3*k_value^gamma)*k_value^(alpha-1)*humankapital-dep;

w(0) = (1-alpha)*A*(h0-h1*k_value^(gamma)-h2*k_value^gamma-h3*k_value^gamma)*k_value^alpha*humankapital;

naturkapital(0) = h0-h1*k_value^gamma-h2*k_value^gamma-h3*k_value^gamma;

end;

steady;


perfect_foresight_setup(periods=15);
perfect_foresight_solver;