function [ system ] = MinWageModelSS_Targets_Final( xstart, Param,Targets)

c_eH_ss=xstart(1);
c_eL_ss=xstart(2);
c_u_ss =xstart(3);
c_n_ss =xstart(4);
l_ss=xstart(5);
u_ss=xstart(6);
e_ss=xstart(7);
e_H_ss=xstart(8);
e_L_ss=xstart(9);
l_H_ss=xstart(10);
l_L_ss=xstart(11);
u_H_ss=xstart(12);
u_L_ss=xstart(13);
s_H_ss=xstart(14);
s_L_ss=xstart(15);
v_H_ss=xstart(16);
v_L_ss=xstart(17);
fv_H_ss=xstart(18);
fv_L_ss=xstart(19);
k_H_ss=xstart(20);
k_L_ss=xstart(21);
x_ss=xstart(22);
b_bar_ss=xstart(23);
beta=xstart(24);
i_bar=xstart(25);
tau_ss=xstart(26);
w_H_ss=xstart(27);
q_H_ss=xstart(28);
q_L_ss=xstart(29);
dw_H_ss=xstart(30);
dw_L_ss=xstart(31);
d_H_ss=xstart(32);
d_L_ss=xstart(33);
D_ss=xstart(34);
OmegaH_ss=xstart(35);
OmegaL_ss=xstart(36);
GammaH_ss=xstart(37);
GammaL_ss=xstart(38);
xi_bar_H=xstart(39);
xi_bar_L=xstart(40);
PstarH_P_ss=xstart(41);
PstarL_P_ss=xstart(42);
B_H=xstart(43);
B_L=xstart(44);
Y_ss=xstart(45);
Y_H_ss=xstart(46);
Y_L_ss=xstart(47);
tau_u_ss=xstart(48);
p_aH_ss=xstart(49);
p_bH_ss=xstart(50);
varpsi_H_ss=xstart(51);
p_aL_ss=xstart(52);
p_bL_ss=xstart(53);
varpsi_L_ss=xstart(54);
pi=xstart(55);
PH_P_ss=xstart(56);
PL_P_ss=xstart(57);

system=zeros(length(xstart),1);

system(1)=c_eH_ss-(1-beta*(1+i_bar)*e_H_ss)/beta*(1+i_bar)*(e_L_ss*(1/c_eL_ss)+u_ss*(1/c_u_ss)+(1-l_ss)*(1/c_n_ss));
system(2)=x_ss-b_bar_ss;
system(3)=x_ss+(1-tau_ss)*Param.w_L-c_eL_ss;
system(4)=x_ss+tau_u_ss-c_u_ss;
system(5)=x_ss-c_n_ss;
system(6)=tau_ss-u_ss*tau_u_ss/(e_H_ss*c_eH_ss+e_L_ss*c_eL_ss+u_ss*c_u_ss+(1-l_ss)*c_n_ss);
system(7)=e_H_ss-(Param.fs_H_ss/(1-(1-Param.fs_H_ss)*Param.rho_H_ss))*l_H_ss;
system(8)=e_L_ss-(Param.fs_L_ss/(1-(1-Param.fs_L_ss)*Param.rho_L_ss))*l_L_ss;
system(9)=l_H_ss+l_L_ss-l_ss;
system(10)=-u_H_ss+l_H_ss-e_H_ss;
system(11)=-u_L_ss+l_L_ss-e_L_ss;
system(12)=-u_ss+u_H_ss+u_L_ss;
system(13)=l_ss-u_ss-e_ss;
system(14)=-s_H_ss + l_H_ss-Param.rho_H_ss*e_H_ss;
system(15)=-s_L_ss + l_L_ss-Param.rho_L_ss*e_L_ss;
system(16)=fv_H_ss-Param.alpham_H*(Param.fs_H_ss/Param.alpham_H)^(-Param.alpha/(1-Param.alpha));
system(17)=fv_L_ss-Param.alpham_L*(Param.fs_L_ss/Param.alpham_L)^(-Param.alpha/(1-Param.alpha));
system(18)=v_H_ss-s_H_ss*Param.fs_H_ss/fv_H_ss;
system(19)=v_L_ss-s_L_ss*Param.fs_L_ss/fv_L_ss;
system(20)=-OmegaH_ss+c_eH_ss*(log(c_u_ss)-log(c_n_ss)-xi_bar_H*log(Param.mu-l_H_ss));
system(21)=-OmegaL_ss+c_eH_ss*(log(c_u_ss)-log(c_n_ss)-xi_bar_L*log(1-Param.mu-l_L_ss));
system(22)=-GammaH_ss+(c_eH_ss-x_ss)+c_eH_ss*(log(c_u_ss)-log(c_eH_ss)+(2+Param.iota)*Param.chi_bar_H*(e_H_ss^(1+Param.iota))/(1+Param.iota));
system(23)=-GammaL_ss+(c_eL_ss-x_ss)+c_eH_ss*(log(c_u_ss)-log(c_eL_ss)+(2+Param.iota)*Param.chi_bar_L*(e_L_ss^(1+Param.iota))/(1+Param.iota));
system(24)=xi_bar_H-((Param.fs_H_ss/(1-beta*Param.rho_H_ss*(1-Param.fs_H_ss)))*((1-tau_ss)*w_H_ss-GammaH_ss)+c_eH_ss*(log(c_u_ss)-log(c_n_ss)))/c_eH_ss*(1+log(Param.mu-l_H_ss));
system(25)=xi_bar_L-((Param.fs_L_ss/(1-beta*Param.rho_L_ss*(1-Param.fs_L_ss)))*((1-tau_ss)*Param.w_L-GammaL_ss)+c_eH_ss*(log(c_u_ss)-log(c_n_ss)))/c_eH_ss*(1+log(1-Param.mu-l_L_ss));
system(26)=k_H_ss-Param.z_ss*B_H*(Param.fs_H_ss)^Param.eta;
system(27)=k_L_ss-Param.z_ss*B_L*(Param.fs_L_ss)^Param.eta;
system(28)=w_H_ss-(1-Param.vartheta)*(GammaH_ss/(1-tau_ss))- Param.vartheta*(q_H_ss+beta*Param.rho_H_ss*Param.fs_H_ss*k_H_ss/fv_H_ss);
system(29)=q_H_ss-w_H_ss-(1-beta*Param.rho_H_ss)*k_H_ss/fv_H_ss;
system(30)=q_L_ss-Param.w_L-(1-beta*Param.rho_L_ss)*k_L_ss/fv_L_ss;
system(31)=dw_H_ss-q_H_ss*Param.z_ss*e_H_ss+w_H_ss*e_H_ss+k_H_ss*v_H_ss;
system(32)=dw_L_ss-q_L_ss*Param.z_ss*e_L_ss+Param.w_L*e_L_ss+k_L_ss*v_L_ss;
system(33)=PstarH_P_ss-p_aH_ss/p_bH_ss;
%system(33)=PstarH_P_ss-q_H_ss*Param.eps_p/(Param.eps_p-1);
system(34)=p_aH_ss-Param.eps_p*q_H_ss*varpsi_H_ss/(Param.eps_p-1)*(1-beta*(1-Param.theta));
system(35)=p_bH_ss-varpsi_H_ss/(1-beta*(1-Param.theta));
system(36)=varpsi_H_ss-Y_ss*PH_P_ss^(Param.eps_p-Param.eps_s);
system(37)=PstarL_P_ss-p_aL_ss/p_bL_ss;
%system(37)=PstarL_P_ss-q_L_ss*Param.eps_p/(Param.eps_p-1);
system(38)=p_aL_ss-Param.eps_p*q_L_ss*varpsi_L_ss/(Param.eps_p-1)*(1-beta*(1-Param.theta));
system(39)=p_bL_ss-varpsi_L_ss/(1-beta*(1-Param.theta));
system(40)=varpsi_L_ss-Y_ss*PL_P_ss^(Param.eps_p-Param.eps_s);
system(41)=PH_P_ss-PstarH_P_ss;
system(42)=PL_P_ss-PstarL_P_ss;
system(43)=Param.gamma*(PH_P_ss^(1-Param.eps_s))+(1-Param.gamma)*(PL_P_ss^(1-Param.eps_s))-1;
system(44)=d_H_ss-Y_ss*PH_P_ss^(1-Param.eps_s)+(1/Param.gamma)*q_H_ss*Param.z_ss*e_H_ss-dw_H_ss;
system(45)=d_L_ss-Y_ss*PL_P_ss^(1-Param.eps_s)+(1/(1-Param.gamma))*q_L_ss*Param.z_ss*e_L_ss-dw_L_ss;
system(46)=d_H_ss+d_L_ss-D_ss;
%system(47)=Y_H_ss-Param.gamma*Y_ss*(PH_P_ss)^(-Param.eps_s);
%system(48)=Y_L_ss-(1-Param.gamma)*Y_ss*(PL_P_ss)^(-Param.eps_s);
system(47)=Y_H_ss-e_H_ss;
system(48)=Y_L_ss-e_L_ss;
%system(49)=Y_ss-(Param.gamma^(1/Param.eps_s)*Y_H_ss^((Param.eps_s-1)/Param.eps_s)+(1-Param.gamma)^(1/Param.eps_s)*Y_L_ss^((Param.eps_s-1)/Param.eps_s))^(Param.eps_s/(Param.eps_s-1));
system(49)=Y_ss-Y_H_ss*(1/Param.gamma)*(PH_P_ss^Param.eps_s);
system(50)=u_ss*tau_u_ss-tau_ss*(w_H_ss*e_H_ss+D_ss+Param.w_L*e_L_ss);
system(51)=tau_u_ss-0.5*Param.w_L;
system(52)=(c_u_ss/c_eH_ss)-Targets.Cratio;
system(53)=i_bar-Targets.intrate;
system(54)=e_H_ss+u_H_ss-Targets.l_H;
system(55)=e_L_ss+u_L_ss-Targets.l_L;
system(56)=B_H*(1-Param.rho_H_ss)*(Param.fs_H_ss^Param.eta)/q_H_ss-Targets.B_Hconst;
system(57)=B_L*(1-Param.rho_L_ss)*(Param.fs_L_ss^Param.eta)/q_L_ss-Targets.B_Lconst;

