function [ys, check] = Programable_steadystate(ys,exe)
global M_
check=0;
% TECHNOLOGICAL UNEMPLOYMENT 
bet=0.99;
Gamma=bet;
R = 1/bet;
Rn=R;
sigma_eta_i=0.01;
e_i =1;
deltk =0.025;
B=0.365;
rk = (1/bet + deltk - 1);
sig=1.01;
h=0.7;  %0.65
phix = 0.237;
A1 =1;
alf = 0.33;
elast1 =6.0;
thetai =0.75;
%labour 
alf1 = 0.50;
m=1;
tau=0.11;
kap=0.3; 
etax = 0.4;
thet=1; 
%u=0.1;
v=@(u)thet*u; 
Ha =@(u) m*u^(1-alf1)*v(u)^alf1;
q = m*thet^(-alf1);
f=  m*thet^(1-alf1);
%N =Ha/tau;
N=@(u)f*u/tau;
Omega=kap*(1/q - (1-tau)*Gamma*1/q(+1));
k  =@(u,mc)(rk/(mc*alf*A1*N(u)^(1-alf)))^(1/(alf-1));
Ik =@(u,mc) deltk*k(u,mc);
y1 =@(u,mc)  A1*k(u,mc)^alf*N(u)^(1-alf);
yw =@(u,mc)(1-alf)*A1*(k(u,mc)/N(u))^(alf);
c = @(u,mc) y1(u,mc)-Ik(u,mc)-kap*v(u);
lambd =@(u,mc)(c(u,mc)*(1-h))^(-sig);
w =@(u,mc) (1-etax)*(B+1/lambd(u,mc)*N(u)^phix)+ etax*(mc*yw(u,mc)+kap*thet);
pai=1;
paistar=pai;
x2=@(u,mc) y1(u,mc)*lambd(u,mc)/(1-bet*thetai*pai^(elast1-1));
x1=@(u,mc) y1(u,mc)*lambd(u,mc)/(1-thetai*bet*pai^elast1);
vep=1;

%mc=1-1/elast1;
%w=(1-alf)*mc*A1*(k/N)^(alf);

fun=@(X)[(Omega+w(X(1),X(2)))*(X(2))^(-1)-yw(X(1),X(2));...
         1-(X(1))-N(X(1))];
fsolve(fun,[0.1,0.83])
u=(ans(1));
mc=(ans(2));
v=v(u);
Ha=Ha(u);
N=N(u);
k  =k(u,mc);
Ik =Ik(u,mc);
y1 =y1(u,mc);
yw =yw(u,mc);
c = c(u,mc);
lambd =lambd(u,mc);
w =w(u,mc);
x2=x2(u,mc);
x1=x1(u,mc);
U1 = (1-sig)^(-1)*(c*(1-h))^(1-sig)-1/(1+phix)*N^(1+phix);
W1 = U1/(1-bet);  


NumberOfEndogenousVariables = M_.endo_nbr;                      % Number of endogenous variables.
ys = zeros(NumberOfEndogenousVariables,1);                      % Initialization of ys (steady state).
for ii = 1:NumberOfEndogenousVariables                          % Loop...
  varname = deblank(M_.endo_names(ii,:));                       %    Get the name of endogenous variable i.                     
  eval(['ys(' int2str(ii) ') = ' varname ';']);                 %    Get the steady state value of this variable.
end        


id1 = strmatch('bet',M_.param_names,'exact');          
M_.params(id1) = bet;
id2 = strmatch('deltk',M_.param_names,'exact');          
M_.params(id2) = deltk;
id3 = strmatch('sig',M_.param_names,'exact');          
M_.params(id3) = sig;
id4 = strmatch('h',M_.param_names,'exact');          
M_.params(id4) = h;
id6 = strmatch('phix',M_.param_names,'exact');          
M_.params(id6) = phix;
id7 = strmatch('alf',M_.param_names,'exact');          
M_.params(id7) = alf;
id8 = strmatch('alf1',M_.param_names,'exact');          
M_.params(id8) = alf1;
id9 = strmatch('tau',M_.param_names,'exact');          
M_.params(id9) = tau;
id10 = strmatch('kap',M_.param_names,'exact');          
M_.params(id10) = kap;
id11 = strmatch('m',M_.param_names,'exact');          
M_.params(id11) = m;
id12 = strmatch('etax',M_.param_names,'exact');          
M_.params(id12) = etax;
%id13 = strmatch('A1',M_.param_names,'exact');          
%M_.params(id13) = A1;
id14 = strmatch('sigma_eta_i',M_.param_names,'exact');          
M_.params(id14) = sigma_eta_i;
id15 = strmatch('thetai',M_.param_names,'exact');          
M_.params(id15) = thetai;
id16 = strmatch('elast1',M_.param_names,'exact');          
M_.params(id16) = elast1;
