function g1 = dynamic_g1(T, y, x, params, steady_state, it_, T_flag)
% function g1 = dynamic_g1(T, y, x, params, steady_state, it_, T_flag)
%
% File created by Dynare Preprocessor from .mod file
%
% Inputs:
%   T             [#temp variables by 1]     double   vector of temporary terms to be filled by function
%   y             [#dynamic variables by 1]  double   vector of endogenous variables in the order stored
%                                                     in M_.lead_lag_incidence; see the Manual
%   x             [nperiods by M_.exo_nbr]   double   matrix of exogenous variables (in declaration order)
%                                                     for all simulation periods
%   steady_state  [M_.endo_nbr by 1]         double   vector of steady state values
%   params        [M_.param_nbr by 1]        double   vector of parameter values in declaration order
%   it_           scalar                     double   time period for exogenous variables for which
%                                                     to evaluate the model
%   T_flag        boolean                    boolean  flag saying whether or not to calculate temporary terms
%
% Output:
%   g1
%

if T_flag
    T = FiscalRE16022017_correct_tax.dynamic_g1_tt(T, y, x, params, steady_state, it_);
end
g1 = zeros(15, 22);
g1(1,4)=(-1);
g1(1,5)=(-(params(1)-(params(2)-1)/params(2)*params(3)));
g1(1,9)=1;
g1(2,3)=(-1);
g1(2,5)=1;
g1(2,9)=1;
g1(3,3)=1;
g1(3,15)=(-1);
g1(3,16)=1;
g1(4,3)=1;
g1(4,2)=(-1);
g1(4,17)=1;
g1(5,3)=(-1);
g1(5,1)=1;
g1(5,8)=1;
g1(5,12)=1;
g1(5,21)=(-1);
g1(6,3)=1;
g1(6,4)=(-params(4));
g1(6,7)=(-params(5));
g1(6,15)=(-params(6));
g1(7,3)=1;
g1(7,5)=(-(1-params(7)));
g1(7,1)=(-params(7));
g1(7,12)=(-params(7));
g1(7,21)=params(7);
g1(8,1)=T(1);
g1(8,6)=(-1);
g1(8,7)=params(11);
g1(8,12)=(-params(8))*params(9)/params(10);
g1(8,21)=(-T(1));
g1(9,8)=(-1)/(params(9)-1);
g1(9,12)=1;
g1(10,3)=(-1);
g1(10,5)=1;
g1(10,10)=1;
g1(11,4)=(-params(2));
g1(11,18)=params(2);
g1(11,5)=(-(params(3)*(1-params(2))));
g1(11,19)=params(3)*(1-params(2));
g1(11,20)=(-T(2));
g1(12,8)=(-((1-params(16))*params(8)*params(9)/params(13)));
g1(12,11)=1;
g1(13,6)=(-params(17));
g1(13,13)=params(14);
g1(13,14)=(-params(15));
g1(14,4)=(-(params(4)*params(19)));
g1(14,5)=(-((1-params(7))*params(18)));
g1(14,1)=(-T(4));
g1(14,8)=(-(params(8)*params(9)*params(17)*params(16)/params(10)));
g1(14,9)=(-((1-params(7))*params(18)));
g1(14,11)=T(3);
g1(14,2)=T(3);
g1(14,14)=(-params(15));
g1(14,15)=params(6);
g1(14,21)=T(4)-T(3);
g1(15,3)=params(6)+params(20)-T(5);
g1(15,2)=T(5);
g1(15,15)=(-params(6));
g1(15,21)=(-T(5));
g1(15,22)=1;

end
