function [ys,check]=modelka_steadystate(junk,ys)
check=0;
%global q0_beta q0_Y q0_N q1_beta q1_Y q1_R q1_N gama_m alfa sigmaa teta ro_1 ro_R ro_Y ro_P
global M_
XXX=size(M_.params,1);
for i=1:XXX
    eval([M_.param_names(i,:),'=',num2str(M_.params(i,1)),';']);
end

Z_beta=q0_beta/(1-q1_beta);
Z_N=q0_N/(1-q1_N);
Z_Y=q0_Y/(1-q1_Y);
Z_R=0;
LLL=0;
W=log(alfa*(1-1/teta));
N=-Z_N;
Y=(1/alfa)*Z_Y+N;

RB=(ro_1+ro_P*(Z_beta-Y)+ro_Y*Y)/(1-ro_R-ro_P);
P=RB+Z_beta-Y;
PS=P+Y-Z_beta;
RR=log(exp(PS-P)+sigmaa);
K=log((1-alfa)/alfa)+W+Y-log(exp(RR)-1);
II=log(exp(K)-(1-sigmaa)*exp(K-Y));
C=log(1-exp(II));
M=-log(exp(-C)*(1-exp(-RB))/gama_m);
S=1-exp(W)-exp(II);
BH=log((exp(M)-exp(M+P+Y))/(exp(P+Y)-exp(RB)));


ys=[BH;C;II;K;LLL;M;N;P;PS;RB;RR;S;W;Y;Z_beta;Z_N;Z_R;Z_Y];
%ys =[C;II;Y;P;N;W;K;r;M;B;R;Z1;Z2];,