From b773a242c8ab33b0faf0f024da546551e68aeebe Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer <jpfeifer@gmx.de> Date: Mon, 12 Jun 2017 20:59:18 +0200 Subject: [PATCH] discretionary_policy_1.m: output which derivative is nonzero --- matlab/discretionary_policy_1.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/matlab/discretionary_policy_1.m b/matlab/discretionary_policy_1.m index 0837067b2f..b4f9cc35c8 100644 --- a/matlab/discretionary_policy_1.m +++ b/matlab/discretionary_policy_1.m @@ -68,6 +68,15 @@ if options_.steadystate_flag end [U,Uy,W] = feval([M_.fname,'_objective_static'],zeros(endo_nbr,1),[], M_.params); if any(any(Uy~=0)) + non_zero_derivs=find(any(Uy~=0)); + for ii=1:length(non_zero_derivs) + non_zero_deriv_names{ii,1}=deblank(M_.endo_names(non_zero_derivs(ii),:)); + end + disp_string=[non_zero_deriv_names{1,:}]; + for ii=2:size(non_zero_deriv_names,1) + disp_string=[disp_string,', ',non_zero_deriv_names{ii,:}]; + end + fprintf('\nThe derivative of the objective function w.r.t. to variable(s) %s is not 0\n',disp_string) error(['discretionary_policy: the objective function must have zero ' ... 'first order derivatives']) end -- GitLab