% % ch2ex2.m is a matlab file that solves the % ramsey model using kliens method % % ----- save output to file ----- % clear all diary ch2ex2.mout diary off delete ch2ex2.mout diary ch2ex2.mout % ----- display date and time of computation ----- % %format long date time0 = clock; % ----- define the parameters ----- % alpha = 0.36; delta = 0.025 ; beta = 0.99; abar = 1; phi = 0.95; % ----- steady states from ch2ex1 ----- % sol1 = [37.9893 2.7543]; kbar = [37.9893]; cbar = [2.7543]; % ----- define the parameters of the model ----- % A = [1, 0, 0 ; 0, -kbar/(cbar+kbar-(1-delta)*kbar), 0; beta*alpha*abar*kbar^(alpha-1)/cbar, beta*alpha*(alpha-1)*abar*kbar^(alpha-1)/cbar, -beta*(alpha*abar*kbar^(alpha-1)+1-delta)/cbar]; B = [phi, 0, 0 ; -1, [-alpha-(1-delta)*kbar/(cbar+kbar-(1-delta)*kbar)], cbar/(cbar+kbar-(1-delta)*kbar); 0, 0, -1/cbar ] ; % ----- find solution using kleins solab ----- % [f1,f2]=solab(A,B,2) % ----- exit ----- % comptime = etime(clock, time0) diary off