
function [ys,check]=model1_steadystate(junk,ys);

global M_ oo_


% invoke parameter file which also contains the steady-state restrictions
%param_safe

%!copy model_safe.mod model_safe_copy.mod

%dynare model_safe_copy

param_safe_no_shorting


% don't have gammap yet, need to solve for it

nparams = size(M_.param_names,1);
for icount = 1:nparams
    eval(['M_.params(icount) = ',M_.param_names{icount},';'])
end


check=0;


ys = zeros(M_.endo_nbr,1);
for this_var=1:M_.endo_nbr
    eval(['ys(this_var)=',M_.endo_names{this_var},';'])
end


% call fsolve for wrapper to model_safe_static
% wrapper calls model_safe_static and augments the derivative to conform
% with the fact that we have one more endogenous variable, gammap



% algo = char('active-set', 'trust-region-reflective', 'interior-point', 'interior-point-convex', 'levenberg-marquardt', 'trust-region-dogleg', 'lm-line-search','sqp');
% options = optimset('Display','iter','Jacobian','off','MaxFunEvals',1e4,'MaxIter',1e4,'TolFun',1e-12,'TolX',1e-12,'Algorithm',algo(5,:));
% 
% ys = fsolve('model_check_risky_wrapper',ys,options,zeros(M_.exo_nbr,1), M_.params);
% 
% 
% 
% 
% M_.params(strncmp(cellstr(M_.param_names),cellstr('gammap'),7)) = ys(strncmp(cellstr(M_.endo_names),cellstr('gamma_var'),10));
% 
% changes_names = 'gammap';
% changes_vec = M_.params(strncmp(cellstr(M_.param_names),cellstr('gammap'),7));

% unpack solution, send original endogenous variable back as output of
% _steadystate file and gammap back as a parameter in the param structure






end
% y = [ys];
% 
% algo = char('active-set', 'trust-region-reflective', 'interior-point', 'interior-point-convex', 'levenberg-marquardt', 'trust-region-dogleg', 'lm-line-search','sqp');
% options = optimset('Display','iter','Jacobian','off','MaxFunEvals',1e7,'MaxIter',1e4,'TolFun',1e-9,'TolX',1e-9,'Algorithm',algo(5,:));
% 
% ys = fsolve('model_safe_wrapper_no_gammap',y,options,zeros(M_.exo_nbr,1), M_.params);





